Atlas - redanim.cpp
Home / lab / opengl / src / demos Lines: 1 | Size: 677 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1#include <GLFW/glfw3.h> 2#include <iostream> 3 4int main() { 5 if (!glfwInit()) { 6 std::cerr << "Failed to initialize GLFW" << std::endl; 7 return -1; 8 } 9 10 GLFWwindow *window = 11 glfwCreateWindow(800, 600, "Hello OpenGL", nullptr, nullptr); 12 if (!window) { 13 std::cerr << "Failed to create GLFW window" << std::endl; 14 glfwTerminate(); 15 return -1; 16 } 17 18 glfwMakeContextCurrent(window); 19 int x = 0; 20 while (!glfwWindowShouldClose(window)) { 21 glClearColor(x / 255.0f, 0.0f, 0.0f, 1.0f); // Animated red screen 22 glClear(GL_COLOR_BUFFER_BIT); 23 24 glfwSwapBuffers(window); 25 glfwPollEvents(); 26 x = (x + 1) % 256; 27 } 28 29 glfwTerminate(); 30 return 0; 31} 32[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.