Hi,
 
the attached patch solved that issue for me.
 
Michael
 
Gesendet: Mittwoch, 20. August 2014 um 11:31 Uhr
Von: "Michael Raab" <michael-r...@gmx.de>
An: opensg-users@lists.sourceforge.net
Betreff: Re: [Opensg-users] TextureObjChunk - GL_VERSION_1_2
> the GL_VERSION_x_y defines are defined by the OpenGL header(s), that is
> GL/gl.h
 
Ok I see, but OSG adds the missing definitions via OSGGLExt.h. Why deciding which method to call (glTexSubImage3D or glTexSubImage3DEXT) during compile time? Depends more on the driver or?
 
Michael
 
Gesendet: Mittwoch, 20. August 2014 um 11:17 Uhr
Von: "Carsten Neumann" <carsten.p.neum...@gmail.com>
An: opensg-users@lists.sourceforge.net
Cc: carsten.p.neum...@googlemail.com
Betreff: Re: [Opensg-users] TextureObjChunk - GL_VERSION_1_2
Hello Michael,

On 2014-08-20 11:11, Michael Raab wrote:
> TextureObjChunk.cpp contains the following lines:
> // define GL_TEXTURE_3D, if not defined yet
> #ifndef GL_VERSION_1_2
> # define GL_FUNC_TEXIMAGE3D OSG_DLSYM_UNDERSCORE"glTexImage3DEXT"
> # define GL_FUNC_TEXSUBIMAGE3D OSG_DLSYM_UNDERSCORE"glTexSubImage3DEXT"
> #else
> # define GL_FUNC_TEXIMAGE3D OSG_DLSYM_UNDERSCORE"glTexImage3D"
> # define GL_FUNC_TEXSUBIMAGE3D OSG_DLSYM_UNDERSCORE"glTexSubImage3D"
> #endif
> The token GL_VERSION_1_2 is nowhere defined in the source tree,
> therefore the EXT functions are used. At the moment my test Intel HD
> system crashes as extension GL_EXT_texture3D is present but function
> glTexSubImage3DEXT returns a NULL pointer.

I'll bite my tongue on this one... ;)

> Is there a reason for this construct? Who was intended to define
> GL_VERSION_1_2? Using glTexSubImage3D everything runs fine with the
> Intel chip..

the GL_VERSION_x_y defines are defined by the OpenGL header(s), that is
GL/gl.h

Cheers,
Carsten

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users
------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/_______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users
 Source/System/State/Base/OSGTextureObjChunk.cpp | 47 ++++++++++++++++---------
 Source/System/State/Base/OSGTextureObjChunk.h   |  2 ++
 2 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/Source/System/State/Base/OSGTextureObjChunk.cpp b/Source/System/State/Base/OSGTextureObjChunk.cpp
index 8f6789c..18d04c9 100644
--- a/Source/System/State/Base/OSGTextureObjChunk.cpp
+++ b/Source/System/State/Base/OSGTextureObjChunk.cpp
@@ -84,7 +84,9 @@ UInt32 TextureObjChunk::_extShadow                   = Win::invalidExtensionID;
 UInt32 TextureObjChunk::_extDepthTexture             = Win::invalidExtensionID;
 
 UInt32 TextureObjChunk::_funcTexImage3D              = Win::invalidFunctionID;
+UInt32 TextureObjChunk::_funcTexImage3DExt           = Win::invalidFunctionID;
 UInt32 TextureObjChunk::_funcTexSubImage3D           = Win::invalidFunctionID;
+UInt32 TextureObjChunk::_funcTexSubImage3DExt        = Win::invalidFunctionID;
 UInt32 TextureObjChunk::_funcCompressedTexImage1D    = Win::invalidFunctionID;
 UInt32 TextureObjChunk::_funcCompressedTexSubImage1D = Win::invalidFunctionID;
 UInt32 TextureObjChunk::_funcCompressedTexImage2D    = Win::invalidFunctionID;
@@ -92,15 +94,6 @@ UInt32 TextureObjChunk::_funcCompressedTexSubImage2D = Win::invalidFunctionID;
 UInt32 TextureObjChunk::_funcCompressedTexImage3D    = Win::invalidFunctionID;
 UInt32 TextureObjChunk::_funcCompressedTexSubImage3D = Win::invalidFunctionID;
 
-// define GL_TEXTURE_3D, if not defined yet
-#ifndef GL_VERSION_1_2
-#  define GL_FUNC_TEXIMAGE3D    OSG_DLSYM_UNDERSCORE"glTexImage3DEXT"
-#  define GL_FUNC_TEXSUBIMAGE3D OSG_DLSYM_UNDERSCORE"glTexSubImage3DEXT"
-#else
-#  define GL_FUNC_TEXIMAGE3D    OSG_DLSYM_UNDERSCORE"glTexImage3D"
-#  define GL_FUNC_TEXSUBIMAGE3D OSG_DLSYM_UNDERSCORE"glTexSubImage3D"
-#endif
-
 
 StatElemDesc<StatIntOnceElem> TextureObjChunk::statNTextures(
     "NTextures",
@@ -147,14 +140,17 @@ void TextureObjChunk::initMethod(InitPhase ePhase)
         _extDepthTexture =
             Window::registerExtension("GL_ARB_depth_texture"  );
 
-        _funcTexImage3D    =
-            Window::registerFunction (GL_FUNC_TEXIMAGE3D,
-                                      _extTex3D,
-                                      0x0102 );
-        _funcTexSubImage3D =
-            Window::registerFunction (GL_FUNC_TEXSUBIMAGE3D,
-                                      _extTex3D,
-                                      0x0102);
+        _funcTexImage3D              = Window::registerFunction (
+			OSG_DLSYM_UNDERSCORE"glTexImage3D", _extTex3D, 0x0102 );
+
+		_funcTexImage3DExt           = Window::registerFunction (
+			OSG_DLSYM_UNDERSCORE"glTexImage3DEXT", _extTex3D, 0x0102 );
+
+        _funcTexSubImage3D           = Window::registerFunction (
+			OSG_DLSYM_UNDERSCORE"glTexSubImage3D", _extTex3D, 0x0102);
+
+		_funcTexSubImage3DExt        = Window::registerFunction (
+			OSG_DLSYM_UNDERSCORE"glTexSubImage3DEXT", _extTex3D, 0x0102);
 
         _funcCompressedTexImage1D    = Window::registerFunction(
             OSG_DLSYM_UNDERSCORE"glCompressedTexImage1DARB"             ,
@@ -529,11 +525,28 @@ void TextureObjChunk::handleTexture(Window                  *win,
                               osgGlTexImage3D,
                              _funcTexImage3D,    
                               win);
+		
+		if(!osgGlTexImage3D)
+		{
+			OSGGETGLFUNCBYID_GL3( glTexImage3DEXT,    
+				osgGlTexImage3D,
+				_funcTexImage3DExt,    
+				win);
+		}
+
         OSGGETGLFUNCBYID_GL3( glTexSubImage3D, 
                               osgGlTexSubImage3D,
                              _funcTexSubImage3D, 
                               win);
 
+		if(!osgGlTexSubImage3D)
+		{
+			OSGGETGLFUNCBYID_GL3( glTexSubImage3DEXT, 
+				osgGlTexSubImage3D,
+				_funcTexSubImage3DExt, 
+				win);
+		}
+
 #ifndef OSG_OGL_ES2
         // Compressed texture functions
         OSGGETGLFUNCBYID_GL3   ( glCompressedTexImage1D,    
diff --git a/Source/System/State/Base/OSGTextureObjChunk.h b/Source/System/State/Base/OSGTextureObjChunk.h
index 28a45b8..a7918e1 100644
--- a/Source/System/State/Base/OSGTextureObjChunk.h
+++ b/Source/System/State/Base/OSGTextureObjChunk.h
@@ -228,7 +228,9 @@ class OSG_SYSTEM_DLLMAPPING TextureObjChunk : public TextureObjChunkBase
 
     // extension indices for used fucntions;
     static UInt32 _funcTexImage3D;
+	static UInt32 _funcTexImage3DExt;
     static UInt32 _funcTexSubImage3D;
+	static UInt32 _funcTexSubImage3DExt;
     static UInt32 _arbCubeTex;
     static UInt32 _funcCompressedTexImage1D;
     static UInt32 _funcCompressedTexSubImage1D;
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to