使用glfw建立opengl应用程序
来源:互联网 发布:倾斜摄影数据处理软件 编辑:程序博客网 时间:2024/05/22 06:50
这里有篇答疑的文章
http://stackoverflow.com/questions/17768008/how-to-build-install-glfw-3-and-use-it-in-a-linux-project
不过看得多也没有什么用。
重点是如何编译下面这个源程序
gcc glfw-demo.c -L/usr/local/lib -lglfw3 -lrt -lXrandr -lXinerama -lXi -lXcursor -lGL -lm -ldl -lXrender -ldrm -lXdamage -lX11-xcb -lxcb-glx -lxcb-dri2 -lxcb-dri3 -lxcb-present -lxcb-sync -lxshmfence -lXxf86vm -lXfixes -lXext -lX11 -lpthread -lxcb -lXau -lXdmcp
是不是超级长,但是这个编译是正确的,会生成a.out程序,运行会有一个窗口。
#include <GLFW/glfw3.h>int main(void){ GLFWwindow* window; /* Initialize the library */ if (!glfwInit()) return -1; /* Create a windowed mode window and its OpenGL context */ window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); if (!window) { glfwTerminate(); return -1; } /* Make the window's context current */ glfwMakeContextCurrent(window); /* Loop until the user closes the window */ while (!glfwWindowShouldClose(window)) { /* Render here */ glClear(GL_COLOR_BUFFER_BIT); /* Swap front and back buffers */ glfwSwapBuffers(window); /* Poll for and process events */ glfwPollEvents(); } glfwTerminate(); return 0;}
0 0
- 使用glfw建立opengl应用程序
- 使用glew和glfw进行opengl编程
- 使用glew、glfw配置OpenGL开发环境
- OpenGL 使用GLFW创建全屏窗口
- 使用glew、glfw配置OpenGL开发环境
- 在mac下使用glfw进行OpenGL编程
- Window平台OpenGL渲染环境之使用GLFW搭建
- Golang glfw中使用opengl库的问题
- Cmake 编译opengl开源库glfw工程及使用
- 配置GLEW+GLFW并使用Xcode写OpenGL应用
- 【OpenGL】GLFW配置
- [OpenGL] 初识GLFW
- vs2010 OpenGL+glfw+glew+glm
- OpenGL入门——GLFW
- Xcode + glfw 配置openGL环境
- OpenGL学习入门-GLFW配置
- OpenGL — GLFW — 颜色
- VS2015配置OpenGL(glfw,glew)
- 1041. 考试座位号(15)
- 105. Construct Binary Tree from Preorder and Inorder Traversal
- Mysql学习笔记十五——列的增删改
- MySQL插入记录时 ERROR:1366 问题
- 一分钟写一个简单的安卓网络请求测试服务器
- 使用glfw建立opengl应用程序
- 栈指针esp和帧指针ebp
- JDBC连接MySQL和Oracle数据库的规范写法
- C语言中函数的进一步理解
- zoj 3962 Seven Segment Display 数位dp
- msyql Mac忘记root密码与终端登录
- 使用jdbc连接ORACLE数据库进行查询的一个例子
- imx6ul yocto project image build
- 小小知识点