How to check for frame buffer support,
Members - Reputation: 116
Posted 03 October 2012 - 09:49 AM
I'm after a way to check for frame buffer support to automatically adjust what I'm using.
How do I check for this in Java?
Start my java program that will render water.
I want to know if frame buffers are supported so I choose how I'm going to represent the water: a simple plane or a filter with ripples, reflection and whatnot.
I'm using jMonkeyEngine3 that uses lwjgl to get to the opengl.
Members - Reputation: 2143
Posted 03 October 2012 - 10:17 AM
If you are using an older OpenGL version than 3.0, you'll have to detect if there is some extension present on the system that enables similar functionality. One such extension is GL_EXT_framebuffer_object. If you detect that extension, you can call all the functions specified in that extension (glBindRenderBufferEXT etc...).
You'll find that the OpenGL 3.0 FBO docs and the GL_EXT_framebuffer_object docs are very similar (== most probably identical, except for function naming), and in fact the OpenGL 3.0 FBO feature is a result of the GL_EXT_framebuffer_object extension being "accepted" to the core.
This is very much how Khronos/OpenGL rolls. They play this game for all features in OpenGL, so it's a common OpenGL "programming pattern" to detect functionality first by checking the OpenGL version, and then by checking if one or more equivalent extensions exists. As a programmer, you'll need to be prepared to have codepaths for the "present in core" case as well as the case of each extension you want to support, in case there are functional differences.
As for how to do this check in Java/jMonkeyEngine3/lwjgl, I don't know. Try to find if there's a function for checking the OpenGL version and then if there's a function for checking for extensions.