Load_GL_version_1_2x not run for OpenGL > 1.2
Original Reporter info from Mantis: crlab @neurolabusc1
-
Reporter name: Chris Rorden
Original Reporter info from Mantis: crlab @neurolabusc1
- Reporter name: Chris Rorden
Description:
If one calls Load_GL_version_X_Y, it should sequentially install itself and all early versions. For example
Load_GL_version_2_1 invokes Load_GL_version_2_0x which invokes Load_GL_version_1_5x which invokes Load_GL_version_1_4x which invokes Load_GL_version_1_3x. However, Load_GL_version_1_3x FAILS to invoke Load_GL_version_1_2x. Therefore, functions defined in OpenGL 1.2 are not defined when the user loads higher versions. This is incorrect, as OpenGL versions 1.2..2.1 are a superset of prior versions (OpenGL 3.3 core removed deprecated functions, though retain classic functions like OpenGL 1.2's glTexImage3D.xml). Consider:
https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTexImage3D.xml
glTexImage3D is available only if the GL version is 1.2 or greater.
https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTexSubImage3D.xml
glTexSubImage3D is available only if the GL version is 1.2 or greater.
However, "Load_GL_version_2_1 " will fail to assign glTexSubImage3D(). This can be fixed by calling "Load_GL_version_1_2x" from the last line in Load_GL_version_1_3x
procedure Load_GL_version_1_3x(var allOK: Boolean);
begin
...
if not Assigned(glGetCompressedTexImage) then allOK := false;
Load_GL_version_1_2x(allOK);
end;
Steps to reproduce:
The code below will report
Load_GL_version_2_1 did not assign glTexImage3D!
The ugly kludge has assigned glTexImage3D!
----------------------------------
if not Load_GL_version_2_1 then
writeln('Unable to load OpenGL v2.1: ');
if not Assigned(glTexImage3D) then
writeln('Load_GL_version_2_1 did not assign glTexImage3D!');
glext_LoadExtension('GL_version_1_2'); //required for glTexSubImage3D
if not Assigned(glTexImage3D) then
writeln('glext_LoadExtension(GL_version_1_2) did not assign glTexImage3D!')
else
writeln('The ugly kludge has assigned glTexImage3D!');