Monday 15 April 2013

Debuging OpenGL 3.0 without direct API ( aka glBegin() ... ) -



Debuging OpenGL 3.0 without direct API ( aka glBegin() ... ) -

it clear me direct api (like glbegin(); glvertex(); glbegin(); ) not effective rendering complex scenes , real world applications games.

but debugging , testing little things useful. eg. debugging physics of object in scene ( visualization of vectors, velocity vector, forcefulness ... ).

you may inquire - why not fall opengl 1.x such little things? because rest of programme utilize opengl 3.0 features, , because fragment shaders.

is there way utilize opengl 3.0 , higher ? or strategy debuging if don't want write whole ceremony

glgenvertexarrays(1, &vao); glbindvertexarray(vao); glgenbuffers(2, vbo); glbindbuffer(gl_array_buffer, vbo[0]); glbufferdata(gl_array_buffer, 8 * sizeof(glfloat), diamond, gl_static_draw); glvertexattribpointer(0, 2, gl_float, gl_false, 0, 0); glenablevertexattribarray(0); glbindbuffer(gl_array_buffer, vbo[1]); glbufferdata(gl_array_buffer, 12 * sizeof(glfloat), colors, gl_static_draw); glvertexattribpointer(1, 3, gl_float, gl_false, 0, 0); glenablevertexattribarray(1); gldrawarrays(gl_lines, 0, 4); gldisablevertexattribarray(0); gldisablevertexattribarray(1); gldeleteprogram(shaderprogram); gldeletebuffers(2, vbo); gldeletevertexarrays(1, &vao);

for every single arrow want plot?

you can still utilize legacy features opengl 3.2 or later if create context compatibility profile. core profile has legacy features removed.

most platforms still seem back upwards compatibility profile. 1 notable exception mac os, 3.x contexts supported core profile.

up opengl 3.1, there single profile. split compatibility , core happened in 3.2.

using newer interfaces isn't bad 1 time got hang of it. if debugging utilize relatively repetitive, write nice utility classes provide more convenient interface.

opengl opengl-3

No comments:

Post a Comment