I want to do some render-to-texture functionality in my game. When I try to call glFramebufferTexture2DEXT(), I get the following error when I try to compile it:
[ 83%] Building CXX object Plugins/TextureSet/C64SpindizzyTextureSet/CMakeFiles/TextureSet_C64SpindizzyTextureSet.dir/C64SpindizzyTexture.cpp.o
/home/martin/spindizzyremake/Plugins/TextureSet/C64SpindizzyTextureSet/C64SpindizzyTexture.cpp: In member function 'void C64SpindizzyTexture::setRenderTarget()':
/home/martin/spindizzyremake/Plugins/TextureSet/C64SpindizzyTextureSet/C64SpindizzyTexture.cpp:25: error: 'glFramebufferTexture2DEXT' was not declared in this scope
make[2]: *** [Plugins/TextureSet/C64SpindizzyTextureSet/CMakeFiles/TextureSet_C64SpindizzyTextureSet.dir/C64SpindizzyTexture.cpp.o] Error 1
make[1]: *** [Plugins/TextureSet/C64SpindizzyTextureSet/CMakeFiles/TextureSet_C64SpindizzyTextureSet.dir/all] Error 2
make: *** [all] Error 2
My function that calls this function simply looks like this:
void C64SpindizzyTexture::setRenderTarget() {
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, cTextureID, 0);
}
I've trying include both <GL/gl.h> and <GL/glext.h>, but still get the same error.
Surprisingly, I could not find any formal documentation on the use of this function on Google. Does anyone know how I can proceed to use this function so that I can perform render-to-texture in my game?
With Kind Regards,
MartinB