Partage
  • Partager sur Facebook
  • Partager sur Twitter

probleme opengl

crash

    9 octobre 2019 à 23:25:25

    bonjour a toutes et tous

    je bosse sur un programme et depuis quelques jour j'ai un crash que je ne comprend pas.

    Pourtant il me semble avoir tout initialisé et tout est bien alloué

    void processInput(GLFWwindow *window)
    {
    	if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
    		glfwSetWindowShouldClose(window, true);
    }
    
    
    void framebuffer_size_callback(GLFWwindow* window, int width, int height)
    {
           glViewport(0, 0, width, height);
    }
    
    void GameManager::init()
    {
    
    
    	glfwInit();
    	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    	glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    
    	m_pWindow = glfwCreateWindow(this->width, this->height, "LearnOpenGL", NULL, NULL);
    
    	if (m_pWindow == NULL)
    	{
    		std::cout << "Failed to create GLFW window" << std::endl;
    		glfwTerminate();
    		exit(-1);
    	}
    
    
    	glfwMakeContextCurrent(m_pWindow);
    	glfwSetFramebufferSizeCallback(m_pWindow, framebuffer_size_callback);
    
    	
    	if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
    	{
    		std::cout << "Failed to initialize GLAD" << std::endl;
    		exit(-1);
    	}
    
    	
    }
    void GameManager::update()
    {
    
    	while (!glfwWindowShouldClose(m_pWindow))
    	{
    
    		SceneManager::getSingleton()->update();
    
    		glfwSwapBuffers(m_pWindow);
    		glfwPollEvents();
    	}
    }

    -
    Edité par JEANBAPTISTECOMTE1 9 octobre 2019 à 23:31:50

    • Partager sur Facebook
    • Partager sur Twitter
      10 octobre 2019 à 12:05:15

      callstack, SVP.
      • Partager sur Facebook
      • Partager sur Twitter
      Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.

      probleme opengl

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown