Browse Source

Enabled seamless cubemaps on macos/linux.

Mark Sibly 8 năm trước cách đây
mục cha
commit
8414f68f72

+ 4 - 2
modules/mojo/graphics/glexts/glexts.cpp

@@ -16,6 +16,7 @@ namespace bbGLexts{
 	bool GL_texture_float;
 	bool GL_texture_half_float;
 	bool GL_depth_texture;
+	bool GL_seamless_cube_map;
 	
 	PFNGLDRAWBUFFERSPROC glDrawBuffers;
 	
@@ -60,12 +61,13 @@ namespace bbGLexts{
 			SDL_GL_ExtensionSupported( "GL_WEBGL_depth_texture" ) ||
 			SDL_GL_ExtensionSupported( "GL_OES_depth_texture" );
 		
+		GL_seamless_cube_map=SDL_GL_ExtensionsSupported( "GL_ARB_seamless_cube_map" );
+			
 //		bb_printf( "GL_draw_buffers=%i\n",int( GL_draw_buffers ) );
 //		bb_printf( "GL_texture_float=%i\n",int( GL_texture_float ) );
 //		bb_printf( "GL_texture_half_float=%i\n",int( GL_texture_half_float ) );
 //		bb_printf( "GL_depth_texture=%i\n",int( GL_depth_texture ) );
-		
-		fflush( stdout );
+//		fflush( stdout );
 	}
 	
 }

+ 1 - 0
modules/mojo/graphics/glexts/glexts.h

@@ -14,6 +14,7 @@ namespace bbGLexts{
 	extern bool GL_texture_float;
 	extern bool GL_texture_half_float;
 	extern bool GL_depth_texture;
+	extern bool GL_seamless_cube_map;
 	
 	typedef void (GL_APIENTRY *PFNGLDRAWBUFFERSPROC)( GLsizei n,const GLenum *bufs );
 

+ 13 - 3
modules/mojo/graphics/glexts/glexts.monkey2

@@ -8,6 +8,8 @@ Namespace mojo.graphics.glexts
 
 #Endif
 
+Const GL_TEXTURE_CUBE_MAP_SEAMLESS:=$884f
+
 Const GL_DRAW_BUFFER:=$0c01
 
 Const GL_READ_BUFFER:=$0c01
@@ -35,17 +37,19 @@ Const GL_COLOR_ATTACHMENT13:Int=$8CED
 Const GL_COLOR_ATTACHMENT14:Int=$8CEE
 Const GL_COLOR_ATTACHMENT15:Int=$8CEF
 
+'GLES2 targets
 #If __TARGET__="windows" Or __MOBILE_TARGET__ Or __WEB_TARGET__
 
 Const GL_draw_buffer:Bool=False
 Const GL_read_buffer:Bool=False
+Const GL_seamless_cube_map:bool=False
 
 Extern
 
 Const GL_draw_buffers:Bool="bbGLexts::GL_draw_buffers"
+Const GL_depth_texture:bool="bbGLexts::GL_depth_texture"
 Const GL_texture_float:Bool="bbGLexts::GL_texture_float"
 Const GL_texture_half_float:bool="bbGLexts::GL_texture_half_float"
-Const GL_depth_texture:bool="bbGLexts::GL_depth_texture"
 
 Function glDrawBuffers( n:Int,bufs:GLenum Ptr )="bbGLexts::glDrawBuffers"
 
@@ -62,14 +66,16 @@ Function glReadBuffer( mode:GLenum )
 	RuntimeError( "glReadBuffer unsupported" )
 End
 
+'GL targets
 #Elseif __TARGET__="macos" Or __TARGET__="linux"
 
 Const GL_draw_buffer:Bool=True
 Const GL_read_buffer:Bool=True
 Const GL_draw_buffers:Bool=True
+Const GL_depth_texture:bool=True
 Const GL_texture_float:Bool=True
 Const GL_texture_half_float:bool=True
-Const GL_depth_texture:bool=True
+Const GL_seamless_cube_map:bool=True
 
 Extern
 
@@ -82,12 +88,16 @@ Public
 Function InitGLexts()
 End
 
+'?
 #Else
 
+Const GL_draw_buffer:Bool=False
+Const GL_read_buffer:Bool=False
 Const GL_draw_buffers:Bool=False
+Const GL_depth_texture:bool=False
 Const GL_texture_float:Bool=False
 Const GL_texture_half_float:bool=False
-Const GL_depth_texture:bool=False
+Const GL_seamless_cube_map:Bool=False
 
 Function glDrawBuffers( n:Int,bufs:GLenum Ptr )
 	RuntimeError( "glDrawBuffers unsupported" )

+ 2 - 0
modules/mojo/graphics/graphicsdevice.monkey2

@@ -443,6 +443,8 @@ Class GraphicsDevice
 		If GL_draw_buffer glGetIntegerv( GL_DRAW_BUFFER,Varptr _defaultDrawBuf )
 		If GL_read_buffer glGetIntegerv( GL_READ_BUFFER,Varptr _defaultReadBuf )
 			
+		if GL_seamless_cube_map glEnable( GL_TEXTURE_CUBE_MAP_SEAMLESS )
+			
 		glCheck()
 	End