-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
33 lines (29 loc) · 894 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include<iostream>
#include "GLFW/glfw3.h"
#include "configure.h"
float add(float ,float);
int main(){
std::cout<<"Hi, baby"<<std::endl;
std::cout<<"result of 6.2 + 145.67 ="<<add(6.2,145.67)<<std::endl;
std::cout<<"version :"<<VERSION_MAJOR<<"."<<VERSION_MINOR<<std::endl;
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow* window = glfwCreateWindow(800, 600, "lern opengl", nullptr, nullptr);
if (window == nullptr)
{
printf("error world");
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
while (!glfwWindowShouldClose(window))
{
//交换帧刷新界面
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwTerminate();
return 0;
}