小编Pin*_*tiu的帖子

GLFW 窗口没有响应

我正在开发一个使用 openGL ES 2.0 而不是普通 openGL 的 GLFW 桌面应用程序!

我编写的代码编译得很好,但是当我运行应用程序时,我听到我的笔记本电脑发出一些奇怪的声音,几秒钟后,当我关闭窗口时,应用程序的窗口没有响应,声音停止了!

是硬件/软件问题还是我做错了什么?

这是我的 main.cpp:

#ifndef GLFW_INCLUDE_ES2
#define GLFW_INCLUDE_ES2
#endif
#include "game.h"
#include <GLFW/glfw3.h>

int init_gl();
void shutdown_gl();
void set_main_loop();

GLFWwindow* window;

int main()
{
    if (init_gl() == GL_TRUE) {
        on_surface_created();
        on_surface_changed();
        set_main_loop();
    }
    shutdown_gl();
    return 0;
}

void shutdown_gl()
{
    glfwDestroyWindow(window);
    glfwTerminate();
}

int init_gl()
{
    const int width = 480,
         height = 800;

     if (glfwInit() != GL_TRUE) {
         return GL_FALSE;
     }

     window = glfwCreateWindow(width, height, "Simple example", NULL, NULL);

     if …
Run Code Online (Sandbox Code Playgroud)

c++ opengl-es

1
推荐指数
1
解决办法
2250
查看次数

标签 统计

c++ ×1

opengl-es ×1