当前位置:网站首页>openGL_01-创建窗口
openGL_01-创建窗口
2022-06-09 04:15:00 【Hxm5211314】
#include <iostream>
#define GLEW_STATIC
#include<GL/glew.h> // 显卡/OpenGL 的扩展函数
#include<GLFW/glfw3.h> // 窗口管理、事件、读取输入等功能
int main()
{
#pragma region 初始化GLFW
//1:初始化glfw
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);//主版本号
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);//次版本号
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);//可编程流水线
//2:使用glfw创建窗口
GLFWwindow* window = glfwCreateWindow(800, 600, "openGL", NULL, NULL);
if (window == nullptr)
{
printf("窗口创建失败");
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);//设置为主窗口
#pragma endregion
#pragma region 初始化GLEW(openGLAPI)
glewExperimental = true;
if (glewInit() != GLEW_OK)
{
printf("glew初始化失败");
return -1;
}
#pragma endregion
#pragma region 循环体
while (true)
{
}
#pragma endregion
return 0;
}


边栏推荐
- keepalived配置虚拟IP
- 测试网站搭建+渗透+审计之第二篇渗透测试
- (三)VGG复现
- View local public IP
- Golang-- concurrent runtime package
- WinForm UI interface design routine - Custom Control ProgressBar
- Hisi3559av100, Mipi camera input interface debugging
- Iscc-2022-reverse-mobile- part WP
- Implementation of horizontal and vertical center of unknown width and height elements
- 渲染管线----通俗易懂向面试官介绍
猜你喜欢
随机推荐
(3) VGg reproduction
模板:常系数齐次线性递推(线性代数、多项式)
opcv图像二值化处理
Attention OCR Chinese version mas # ter Code Running Logic
(8) Style binding
RAVDESS语音情感分类数据集的介绍
通用泛型 列表 实现map max min
基于PyQt5完成的抠图功能-程序实现
Matting interface based on pyqt5
Common port record
Large factory outsourcing or self research company? How to choose a job for a tester?
1264_ Analysis of FreeRTOS task initialization and stack initialization processing
golang---redis操作
PHP e-signature SaaS API docking process
查看本机公网IP
Geometric application problems
Wechat applet: (exception) expected begin_ Object but was string at line 1 column 1 path $solution and analysis process
渲染管线----通俗易懂向面试官介绍
Lua string
App上看到就忍不住点的小红点是如何实现的?








