Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GL/glew.h>
- #include <GLFW/glfw3.h>
- #include <iostream>
- int main(void) {
- // initialise the windows
- GLFWwindow *window;
- if (!glfwInit()) {
- return -1;
- }
- // create a windows
- window = glfwCreateWindow(640, 480, "Test", NULL, NULL);
- if (!window) {
- fprintf(stderr, "Failed to initialize GLFWn");
- glfwTerminate();
- return -1;
- }
- // make the window's current context
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
- // loop until the window close
- while (!glfwWindowShouldClose(window)) {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- // swap back and front buffers
- glfwSwapBuffers(window);
- // poll the events
- glfwPollEvents();
- }
- std::cout << "finished ";
- glfwTerminate();
- return 0;
- while (!glfwWindowShouldClose(window)) {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glClearColor(1, 1, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement