Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <GLEW\GL\glew.h>
- #include <GLFW\glfw3.h>
- int main(void)
- {
- if (!glfwInit())
- {
- fprintf(stderr, "GLFW error");
- return -1;
- }
- glfwWindowHint(GLFW_SAMPLES, 4);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
- glfwWindowHint(GLFW_VERSION_MINOR, 0);
- glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
- GLFWwindow* window;
- window = glfwCreateWindow(
- 512,
- 512,
- "Hello World",
- NULL, NULL);
- if (window == NULL)
- {
- fprintf(stderr, "Window failed.");
- glfwTerminate();
- return -1;
- }
- glfwMakeContextCurrent(window);
- glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
- do
- {
- glfwSwapBuffers(window);
- glfwPollEvents();
- } while (glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS &&
- glfwWindowShouldClose(window) == 0);
- glfwTerminate();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement