开发者

glGenRenderbuffersEXT not declared but glGenFramebuffersEXT works

开发者 https://www.devze.com 2023-02-25 20:08 出处:网络
I am trying to use RBOs in a project which uses QGLWidget. Now, when I want to use RBOs for a fast read of a texture the compiler says \'glGenRenderbuffersEXT\' was not declared in this scope. The sam

I am trying to use RBOs in a project which uses QGLWidget. Now, when I want to use RBOs for a fast read of a texture the compiler says 'glGenRenderbuffersEXT' was not declared in this scope. The same with FBO (glGenFramebuffersEXT) works fine.

The gl relevant includes I use:

#include <GL/glew.h>
#include <QtOpenGL>

I link against the glew library, too. Here a dump of my 开发者_如何学GoCMakeLists.txt:

include_directories(
    ${GLEW_INCLUDE_PATH}
    ${PROJECT_SOURCE_DIR}/include
    ${OpenCV_INCLUDE_DIRS}
    ${CG_INCLUDE_PATH}
)

set(LIBS
    ${GLEW_LIBRARY}
    ${OPENGL_gl_LIBRARY}
    ${OPENGL_glu_LIBRARY}
    ${CG_LIBRARY}
    ${CG_GL_LIBRARY}
    ${OpenCV_LIBS}
    ${GFlags_LIBS}
    ${QT_LIBRARIES}
    common
    ndiolib
    optimization-static
    LightingLib-static
)

SOURCE_GROUP("Shader Files" FILES ${SHADER_FILES})

add_executable(Relighting ${HDRS} ${SRCS} ${MOCSRC} ${SHADER_FILES} main.cxx)
target_link_libraries(Project ${LIBS})

Anybody has an idea, what could be wrong? When I tried to use glext.h (+gl.h) instead of glew.h, both the RBOs and the FBOs weren't found.

Side-question: Should I use RBOs for reading out a texture at all? Or is it equally fast to use the FBO which I use to read out the texture?


I check OpenGL site and it seems that the function you mentioned is defined only if you have GL_GLEXT_PROTOTYPES defined.

http://www.opengl.org/registry/api/glext.h

Further digging shows that you do need to define this symbol in order to use prototypes of extensions.

http://www.opengl.org/registry/ABI/#5

0

精彩评论

暂无评论...
验证码 换一张
取 消