当前位置:网站首页>openGL_01-創建窗口
openGL_01-創建窗口
2022-06-09 04:16: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;
}


边栏推荐
- Rigidbody2d SweepTest Rigidbody2D. Cast but for rotation rotation
- [excellent design] opencv based face recognition punch in / sign in / attendance management system (the simplest basic library development, which can be based on raspberry pie)
- Test website construction + penetration + audit Part 1 start the website with idea
- VS Code `launch. Json` and `task Predefined variables available in json`
- (4)数据响应式
- Domain name resolution (public network)
- (8)样式绑定
- Pdf splitting based on pyqt5
- Graph to document function based on pyqt5
- 软件测试(二)
猜你喜欢

Win10安装appium环境

MySQL queries which table in the database has the most fields

rigidbody2d 围绕某固定点point进行旋转rotate

ISCC-2022-reverse-mobile-部分wp

基于PyQt5完成的抠图界面

Attention OCR Chinese version mas ter code running logic

(7) Attribute binding

测试网站搭建+渗透+审计之第三篇Swagger接口渗透测试

Software testing (II)

《Attention-ocr-Chinese-Version-mas # ter》代碼運行邏輯
随机推荐
PHP e-signature SaaS API docking process
hisi3559av100,MIPI相机输入接口调试
Page components of wechat applet development
PHP e签宝电子签名Saas API 对接流程
人才缺口50万以上,平均薪资20K?网络安全,测试员的下一个风口~
Golang-- concurrent runtime package
举例说明tf中LSTMCell的cell、num_unit是什么意思
Multi table query in MySQL
Give an example to illustrate the cell and num of lstmcell in TF_ What does unit mean
测试网站搭建+渗透+审计之第一篇使用IDEA启动网站
How is the little red dot that you can't help but click when you see it on the app realized?
Introduction of ravless speech emotion classification data set
MySQL: common statistics, grouping statistics and time format conversion
rigidbody2d 围绕某固定点point进行旋转rotate
Matting interface based on pyqt5
【word】錯誤!文檔中沒有指定樣式的文字。 1
Binary processing of opcv image
VS Code `launch.json` 和 `task.json` 中可使用的预定义变量
How to write a blueprint for the data center
Expansion chip, hisi3559av100 I2C debugging