#15 OpenGL Extensions and Entry points per rendering context

closed
nobody
None
8
2010-08-18
2010-04-16
YarUnderoaker
No

Need to do OpenGL extensions and entry points per rendering context.
In the first aproximation

TOpenGLExtensions = class
GL_ARB_blend_func_extended,
GL_ARB_color_buffer_float,
GL_ARB_compatibility,
....
GLU_EXT_Texture: Boolean;
end;

TOpenGLEntryPoints = class
BlendColor: procedure...
BlendEquation: procedure...
....
CopyImageSubDataNV: procedure(...
end;

{$IFDEF MULTITHREADOPENGL}
threadvar
{$else}
var
{$ENDIF}
glExt: TOpenGLExtensions;
gl: TOpenGLEntryPoints;

so all opengl API will look like that

Code:
if glExt.GL_ARB_blend_func_extended then
gl.BlendColor(...);

Each rendering context have own FglExt and Fgl
and when activated first time it's created and filled.
Then glExt and gl replaced.

Discussion

  • YarUnderoaker
    YarUnderoaker
    2010-08-18

    • status: open --> closed