Mark Sibly 7 سال پیش
والد
کامیت
1e54c7e5df
2فایلهای تغییر یافته به همراه28 افزوده شده و 26 حذف شده
  1. 17 17
      modules/mojo/app/app.monkey2
  2. 11 9
      modules/mojo/graphics/texture.monkey2

+ 17 - 17
modules/mojo/app/app.monkey2

@@ -83,17 +83,17 @@ Class AppInstance
 	
 	
 	The following environment variables can be set prior to constructing a new AppInstance:
 	The following environment variables can be set prior to constructing a new AppInstance:
 	
 	
-	MX2_MOJO_OPENGL_PROFILE : Should be set to one of "es", "compatibility" or "core". Defaults to "compatibility" on macos and linux, "es" on all other targets. Uses 'Angle' for es support on windows.
-	
-	MX2_MOJO_OPENGL_VERSION_MAJOR : defaults to "2".
-	
-	MX2_MOJO_OPENGL_VERSION_MINOR : defaults to "1".
-	
-	MX2_MOJO_COLOR_BUFFER_BITS : Minimum depth buffer bit depth. defaults to "8".
+	MOJO_OPENGL_PROFILE : Should be set to one of "es", "compatibility" or "core". Defaults to "compatibility" on macos and linux, "es" on all other targets. Uses 'Angle' for es support on windows.
+
+	MOJO_OPENGL_VERSION_MAJOR : defaults to "2".
+
+	MOJO_OPENGL_VERSION_MINOR : defaults to "1".
+
+	MOJO_COLOR_BUFFER_BITS : Minimum depth buffer bit depth. defaults to "8".
 	
 	
-	MX2_MOJO_DEPTH_BUFFER_BITS : Minimum depth buffer bit depth. defaults to "0".
+	MOJO_DEPTH_BUFFER_BITS : Minimum depth buffer bit depth. defaults to "0".
 
 
-	MX2_MOJO_STENCIL_BUFFER_BITS : Minimum stencil buffer bit depth. defaults to "0".
+	MOJO_STENCIL_BUFFER_BITS : Minimum stencil buffer bit depth. defaults to "0".
 	
 	
 	Environment variables may be set using the [[std::std.filesystem.SetEnv|SetEnv]] function.
 	Environment variables may be set using the [[std::std.filesystem.SetEnv|SetEnv]] function.
 	
 	
@@ -127,7 +127,7 @@ Class AppInstance
 		'
 		'
 		Local gl_profile:Int,gl_major:Int=2,gl_minor:Int=0
 		Local gl_profile:Int,gl_major:Int=2,gl_minor:Int=0
 
 
-		Select GetEnv( "MX2_MOJO_OPENGL_PROFILE" )
+		Select GetConfig( "MOJO_OPENGL_PROFILE" )
 		Case "core"
 		Case "core"
 			gl_profile=SDL_GL_CONTEXT_PROFILE_CORE
 			gl_profile=SDL_GL_CONTEXT_PROFILE_CORE
 		Case "compatibility"
 		Case "compatibility"
@@ -143,18 +143,18 @@ Class AppInstance
 		End
 		End
 
 
 		SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,gl_profile )
 		SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,gl_profile )
-		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,Int( GetEnv( "MX2_MOJO_OPENGL_VERSION_MAJOR",gl_major ) ) ) 
-		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,Int( GetEnv( "MX2_MOJO_OPENGL_VERSION_MINOR",gl_minor ) ) )
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,Int( GetConfig( "MOJO_OPENGL_VERSION_MAJOR",gl_major ) ) ) 
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,Int( GetConfig( "MOJO_OPENGL_VERSION_MINOR",gl_minor ) ) )
 		
 		
 		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,1 )
 		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,1 )
 		
 		
-		Local n:=Int( GetEnv( "MX2_MOJO_COLOR_BUFFER_BITS",8 ) )
+		Local n:=Int( GetConfig( "MOJO_COLOR_BUFFER_BITS",8 ) )
 
 
 		SDL_GL_SetAttribute( SDL_GL_RED_SIZE,n )
 		SDL_GL_SetAttribute( SDL_GL_RED_SIZE,n )
 		SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE,n )
 		SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE,n )
 		SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE,n )
 		SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE,n )
-		SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE,Int( GetEnv( "MX2_MOJO_DEPTH_BUFFER_BITS" ) ) )
-		SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE,Int( GetEnv( "MX2_MOJO_STENCIL_BUFFER_BITS" ) ) )
+		SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE,Int( GetConfig( "MOJO_DEPTH_BUFFER_BITS" ) ) )
+		SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE,Int( GetConfig( "MOJO_STENCIL_BUFFER_BITS" ) ) )
 		
 		
 #If __DESKTOP_TARGET__
 #If __DESKTOP_TARGET__
 
 
@@ -184,9 +184,9 @@ Class AppInstance
 		
 		
 		_theme=New Theme
 		_theme=New Theme
 		
 		
-		Local themePath:=GetEnv( "MX2_MOJO_INITIAL_THEME","default" )
+		Local themePath:=GetConfig( "MOJO_INITIAL_THEME","default" )
 		
 		
-		Local themeScale:=Float( GetEnv( "MX2_MOJO_INITIAL_THEME_SCALE",1 ) )
+		Local themeScale:=Float( GetConfig( "MOJO_INITIAL_THEME_SCALE",1 ) )
 		
 		
 		_theme.Load( themePath,New Vec2f( themeScale ) )
 		_theme.Load( themePath,New Vec2f( themeScale ) )
 		
 		

+ 11 - 9
modules/mojo/graphics/texture.monkey2

@@ -98,19 +98,21 @@ Enum CubeFace
 	NegativeZ
 	NegativeZ
 End
 End
 
 
-#Rem monkeydoc The Texture class.
-
-The environment variable "MX2_MOJO_TEXTURE_MAX_ANISOTROPY" can be used to control texture max anisotropy.
-
-If this env variable is not set, texture max anisotropy is set to the max level.
-	
-Environment variables may be set using the [[std::std.filesystem.SetEnv|SetEnv]] function.
-	
+#rem monkeydoc The Texture class.
 #end
 #end
 Class Texture Extends Resource
 Class Texture Extends Resource
 	
 	
 	Private
 	Private
 	
 	
+	#rem monkeydoc Creates a new texture.
+	
+	The config setting "MOJO_TEXTURE_MAX_ANISOTROPY" can be used to set the new texture's max anisotropy value.
+
+	If this config setting does not exist, the texture's max anisotropy is set to the max level.
+		
+	Config settings may be changed using the [[std::std.filesystem.SetConfig|SetConfig]] function.
+	
+	#end
 	Method New( face:GLenum,cubeMap:Texture )
 	Method New( face:GLenum,cubeMap:Texture )
 		
 		
 		_size=cubeMap._size
 		_size=cubeMap._size
@@ -448,7 +450,7 @@ Class Texture Extends Resource
 '					If glexts.GL_texture_filter_anisotropic
 '					If glexts.GL_texture_filter_anisotropic
 						Local max:Int=0
 						Local max:Int=0
 						glGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY,Varptr max )
 						glGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY,Varptr max )
-						Local n:=Min( Int(GetEnv( "MX2_MOJO_TEXTURE_MAX_ANISOTROPY",max )),max )
+						Local n:=Min( Int(GetConfig( "MOJO_TEXTURE_MAX_ANISOTROPY",max )),max )
 						glTexParameteri( _glTarget,GL_TEXTURE_MAX_ANISOTROPY,n )
 						glTexParameteri( _glTarget,GL_TEXTURE_MAX_ANISOTROPY,n )
 '					Endif
 '					Endif
 				Endif
 				Endif