• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






中華大帝

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

随笔分类 -  OpenGL

OpenGL,永远的 OpenGL。
 
Windows 下 EGL PBuffer 测试代码
摘要:Windows 上使用 glad 加载浏览器的 LibEGL.dll 和 LibGLESV2.dll,测试 EGL 在 Windows 上的实现,代码: 1 #include <stdio.h> 2 3 #include "include/glad/egl.h" 4 #include "includ 阅读全文
posted @ 2024-09-19 19:27 中華大帝 阅读(145) 评论(0) 推荐(0)
GLSL Uniform Buffer Editor 变量对齐编辑器
摘要:GLSL Uniform Buffer Editor,std140 对齐编辑器,环境:glfw + glew + imgui。 源码: https://gitee.com/sdragonx/uboeditor github 上传中…… 阅读全文
posted @ 2024-05-24 12:15 中華大帝 阅读(40) 评论(0) 推荐(0)
OpenGL freetype 示例
摘要:glfw + glew + imgui + freetype2,效果如下: 直接上代码: OpenGL 字体示例 阅读全文
posted @ 2024-03-06 23:33 中華大帝 阅读(111) 评论(0) 推荐(0)
glfw C++ 封装简单例子
摘要:直接上代码,glfw_window.hpp: #ifndef GLFW_WINDOW_HPP #define GLFW_WINDOW_HPP #include <cstdlib> // onexit() #pragma execution_character_set("utf-8") // utf8 阅读全文
posted @ 2022-04-11 13:48 中華大帝 阅读(400) 评论(0) 推荐(0)
关于 wglShareLists 的使用,以及 OpenGL 多线程、多窗口的理解
摘要:这里有一篇文章: OpengGL 中的同步及资源共享 | 柯幽 (keyou.github.io) 然后是实际使用。 windows上面创建共享上下文,之前一直失败,没有找到原因,今天测试成功。原因就是:要共享的 OpenGL 上下文,创建好之后,什么也不要修改,马上共享。这样创建的纹理就能共享使用 阅读全文
posted @ 2022-03-26 20:32 中華大帝 阅读(711) 评论(1) 推荐(0)
glsl include 简单实现(正确定位错误文件)
摘要:glsl include 的实现,使用 C++ 标准库(c++98),实现了磁盘文件的支持。此库代码简短,并且可以将错误代码正确定位到相关文件。只支持简单 #include 标记,对于 #define 没有进行解析,通过 #if #else 等预处理命令 include 的方式暂时没有实现。 git 阅读全文
posted @ 2022-01-24 15:26 中華大帝 阅读(430) 评论(0) 推荐(0)
glm C++ 98 版本
摘要:glm C++ 98 版本 https://github.com/sdragonx/glm glm 原库作为图形基础库,下载使用量没有 cglm 多,其中一个原因就是,这个库竟然用 C++ 11。这里是一个 C++ 98 版本的 glm 库,兼容比较老的编译器。虽然有些方法在实现上,C++ 11 比 阅读全文
posted @ 2021-11-20 03:45 中華大帝 阅读(215) 评论(0) 推荐(1)
使用 wglCreateContextAttribsARB 创建 OpenGL
摘要:// 祖传设置像素格式函数 bool set_pixel_format(HDC hdc) { PIXELFORMATDESCRIPTOR pfd = { 0 }; pfd.nSize = sizeof(pfd); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO 阅读全文
posted @ 2020-08-27 17:25 中華大帝 阅读(1740) 评论(0) 推荐(0)
tesselator 库(修改原版的 gluTess)
摘要:libtess https://github.com/sdragonx/libtess this is refactored version of the original libtess which comes with the GLU reference implementation.this 阅读全文
posted @ 2020-03-10 16:50 中華大帝 阅读(748) 评论(0) 推荐(0)
OpenGL 程序使用独显运行的方法
摘要:在exe里面导出下面两个变量,同时对N卡和A卡都有效,程序默认打开就会使用独显运行。导出的变量名字必须和下面的一致,不能有前置下划线。D3D这些年没琢磨过,理论这个设置D3D也能用。这个方法是系统层显卡驱动在程序执行时检测的一个标记,有这个标记,则用独显运行。 // http://developer 阅读全文
posted @ 2020-01-12 17:13 中華大帝 阅读(2953) 评论(2) 推荐(1)
OpenGL 字体绘制
摘要:/* glfont.hpp sdragonx 2019-08-15 00:03:33 opengl字体类,提供初学者参考学习 opengl初始化之后,创建字体 font.init(L"微软雅黑", 32, 512); 然后在绘制函数里面添加以下测试代码: //开启2D模式,后面的800x600要根据 阅读全文
posted @ 2019-08-15 14:34 中華大帝 阅读(1097) 评论(0) 推荐(0)
OpenGL 2D模式
摘要:// // left top 这里设置的默认是左上角 // void push_view2d(int left, int top, int width, int height) { //glPushAttrib(GL_TRANSFORM_BIT|GL_VIEWPORT_BIT); glPushAtt 阅读全文
posted @ 2019-06-08 07:00 中華大帝 阅读(450) 评论(0) 推荐(0)