PDA

View Full Version : Useful things to querry about at init



jaketehsnake
05-26-2016, 11:06 AM
There are a lot of things to quarry your opengl context. I would like to print useful information, so that I can compare the results when running my application on different GPU vendors. I'd also like to test stuff so that I can shut down the application in a controlled manner, rather than just have it crash. But I don't really know what to query. There are so many things to choose from, and I'm not very versed in the subject.

Right now I'm checking frambuffer bit depth:

glGetFramebufferAttachmentParameteri(GL_FRAMEBUFFE R, GL_STENCIL, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE))

And also depth, red, green, blue alpha....

I'm checking version and vendor:

glGetString(GL_VERSION))
glGetString(GL_VENDOR) + ", " + glGetString(GL_RENDERER))


I'm printing this for some reason:

System.out.println("---Supported Shader Attributes: " + glGetInteger(GL_MAX_VERTEX_ATTRIBS));
System.out.println("---Supported Shader Uniforms: " + glGetInteger(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS));


... And I'm doing this:

if (!c.GL_ARB_shader_objects && c.GL_ARB_vertex_shader && c.GL_ARB_fragment_shader)
throw new IllegalStateException("shaders arent Supported. Get a 'modern' computer!");

... Where c is a LJWGL class called GlContext, which has lots and lost of Boolean values, that I don't know what they stand for. I don't know if I'm testing the right Booleans in my test.

So my question/topic of discussion is what are your tips? What do you quarry and test when starting up your opengl App? What useful information is there?