Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Display.hpp"
- #include <stdio.h>
- #include <stdlib.h>
- #include <GL/GLEW.h>
- #include <GLFW/glfw3.h>
- #include <glm/glm.hpp>
- namespace glm {
- Display::Display(int width, int height, const char* title) {
- //Initialize GLFW
- glewExperimental = true;
- if(!glfwInit()){
- fprintf(stderr, "Failed to initialize GLFW!\n");
- }
- glfwWindowHint(GLFW_SAMPLES, 2);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
- glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
- glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
- GLFWwindow* window;
- window = glfwCreateWindow(width, height, title, NULL, NULL);
- if(window==NULL){
- fprintf(stderr, "Failed to create window!\n");
- }
- glfwMakeContextCurrent(window);
- glewExperimental=true;
- if (glewInit() != GLEW_OK) {
- fprintf(stderr, "Failed to initialize GLEW!\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement