mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
+ | First window
This commit is contained in:
34
srcs/RT.cpp
34
srcs/RT.cpp
@ -12,8 +12,40 @@
|
||||
|
||||
#include "RT.h"
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
if (!glfwInit())
|
||||
{
|
||||
fprintf( stderr, "Failed to initialize GLFW\n" );
|
||||
return (-1);
|
||||
}
|
||||
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 4);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
|
||||
GLFWwindow* window;
|
||||
window = glfwCreateWindow(WIDTH, HEIGHT, "RT_GPU", NULL, NULL);
|
||||
if (!window )
|
||||
{
|
||||
fprintf( stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n" );
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
2138
srcs/gl.cpp
Normal file
2138
srcs/gl.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user