ScrapExplorer - main.cpp

Home / lab / opengl / src Lines: 1 | Size: 681 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1#include <GLFW/glfw3.h> 2// No errors with full path 3#include <iostream> 4 5// Example OpenGL to test 6int main() { 7 if (!glfwInit()) { 8 std::cerr << "Failed to initialize GLFW" << std::endl; 9 return -1; 10 } 11 12 GLFWwindow *window = 13 glfwCreateWindow(800, 600, "Hello OpenGL", nullptr, nullptr); 14 if (!window) { 15 std::cerr << "Failed to create GLFW window" << std::endl; 16 glfwTerminate(); 17 return -1; 18 } 19 20 glfwMakeContextCurrent(window); 21 22 while (!glfwWindowShouldClose(window)) { 23 glClearColor(1.0f, 0.0f, 0.0f, 1.0f); // Red screen 24 glClear(GL_COLOR_BUFFER_BIT); 25 26 glfwSwapBuffers(window); 27 glfwPollEvents(); 28 } 29 30 glfwTerminate(); 31 return 0; 32} 33
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.