Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #define GLEW_STATIC
- #include<GL/glew.h>
- #include<GLFW/glfw3.h>
- using namespace std;
- int main() {
- glfwInit();
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
- glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
- glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
- GLFWwindow* window = glfwCreateWindow(800, 600, "Test", nullptr, nullptr);
- if (window == nullptr) {
- cout << "FAILED TO CREATE GLFW WINDOW" << endl;
- glfwTerminate();
- return -1;
- }
- if (glewInit() != GLEW_OK) {
- cout << "FAILED TO INITIALIZE GLEW";
- return -2;
- }
- int width, height;
- glfwGetFramebufferSize(window, &width, &height);
- glViewport(0,0, width, height);
- while(!glfwWindowShouldClose(window)) {
- glfwPollEvents();
- glfwSwapBuffers(window);
- }
- glfwTerminate();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement