增加RenderDevice定义
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
add_executable(NullWindow main.cpp)
|
||||
|
||||
target_link_libraries(NullWindow PRIVATE MathGeoLib)
|
||||
target_link_libraries(NullWindow PRIVATE MathGeoLib glfw GL)
|
||||
|
@@ -1,7 +1,38 @@
|
||||
#include<iostream>
|
||||
#include<GLFW/glfw3.h>
|
||||
|
||||
int main(int,char **)
|
||||
int main(void)
|
||||
{
|
||||
std::cout<<"hello,world!"<<std::endl;
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user