小编Mat*_*rim的帖子

glfwOpenWindowHint未在此范围GLFW3和GLEW中声明

在OpenGL 3+的一些OpenGL教程之后,我已经遇到了一些差异,这是我设法得到的代码,但是刚出门,我得到了大量的错误,没有其中说它找不到包含的标题,只是标题没有定义核心功能.

#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glfw3.h>
#include <glm/glm.hpp>

int main(){

// Initialise GLFW
if( !glfwInit() )
{
    fprintf( stderr, "Failed to initialize GLFW\n" );
    return -1;
}

glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); // 4x antialiasing
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); //I don't want the
                                                                   //old OpenGL

// Open a window and create its OpenGL context
if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) )
{
    fprintf( stderr, "Failed to open GLFW window\n" );
    glfwTerminate();
    return -1;
}

// …
Run Code Online (Sandbox Code Playgroud)

c c++ opengl glfw opengl-3

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

标签 统计

c ×1

c++ ×1

glfw ×1

opengl ×1

opengl-3 ×1