小编cj1*_*094的帖子

为什么我的GLFW窗口这么慢?

由于某种原因,以下代码生成如下结果: 在此输入图像描述

我不知道为什么渲染每一帧需要一两秒钟.代码对我来说似乎是正常的,但我不知道为什么它如此缓慢地呈现它.

#define GLFW_INCLUDE_GLU
#define GLEW_STATIC
#include"GL/glew.c"
#include"GLFW/glfw3.h"
#include<cmath>
#include<ctime>
#include<stdlib.h>
using namespace std;

int main( ) {
    // init glfw
    if ( !glfwInit( ) ) return 0;

    // create window and set active context
    GLFWwindow* window = glfwCreateWindow( 640, 480, "Test", NULL, NULL );
    glfwMakeContextCurrent( window );

    // init glew
    if ( glewInit( ) != GLEW_OK ) return 0;

    // set swap interval
    glfwSwapInterval( 1 );

    // render loop
    while ( !glfwWindowShouldClose( window ) ) {
        srand( time( NULL …
Run Code Online (Sandbox Code Playgroud)

opengl performance

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

标签 统计

opengl ×1

performance ×1