Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GLFW/glfw3.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main(void)
- {
- GLFWwindow* window;
- if (!glfwInit())
- exit(EXIT_FAILURE);
- window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
- if (!window) {
- glfwTerminate();
- exit(EXIT_FAILURE);
- }
- glfwMakeContextCurrent(window);
- float inval = 0.0f;
- glClearColor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- while (!glfwWindowShouldClose(window))
- {
- glColor3f(1,1,1);
- glBegin(GL_POINTS);
- glVertex2f(-1.0f + inval/5.0f, sinf(inval));
- glEnd();
- glfwSwapBuffers(window);
- glfwPollEvents();
- inval += 0.01f;
- }
- glfwDestroyWindow(window);
- glfwTerminate();
- exit(EXIT_SUCCESS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement