"PS C:\2022\Work\programming\engineering\my-works\my_game\programs> cd "c:\2022\Work\programming\engineering\my-works\my_game\programs\" ; if ($?) { g++ open_gl_1_test.cpp -o open_gl_1_test } ;if
($?) { .\open_gl_1_test }
open_gl_1_test.cpp:1:10: fatal error: GL/glew.h: No such file or directory
1 | #include <GL/glew.h>
| ^~~~~~~~~~~
compilation terminated.
PS C:\2022\Work\programming\engineering\my-works\my_game\programs>".
Here is the program code itself:
Expand|Select|Wrap|Line Numbers
- #include <GL/glew.h>
- #include <GLFW/glfw3.h>
- #include <iostream>
- using namespace std;
- void init(GLFWwindow *window) {}
- void display(GLFWwindow *window, double currentTime)
- {
- glClearColor(1.0, 0.0, 0.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
- }
- int main(void)
- {
- if (!glfwInit())
- {
- exit(EXIT_FAILURE);
- }
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
- GLFWwindow *window = glfwCreateWindow(600, 600, "Chapter2 - program1", NULL, NULL);
- glfwMakeContextCurrent(window);
- if (glewInit() != GLEW_OK)
- {
- exit(EXIT_FAILURE);
- }
- glfwSwapInterval(1);
- init(window);
- while (!glfwWindowShouldClose(window))
- {
- display(window, glfwGetTime());
- glfwSwapBuffers(window);
- glfwPollEvents();
- }
- glfwDestroyWindow(window);
- glfwTerminate();
- exit(EXIT_SUCCESS);
- }