Mark Sibly 8 years ago
parent
commit
fda36966cd

+ 0 - 2
modules/mojo/app/skin.monkey2

@@ -3,8 +3,6 @@ Namespace mojo.app
 
 Using std.resource
 
-#rem monkeydoc @hidden
-#end
 Class Skin Extends Resource
 
 	Property Image:Image()

+ 2 - 2
modules/mojo/app/theme.monkey2

@@ -29,7 +29,7 @@ Class Theme
 	
 	#rem monkeydoc Gets a font from the theme.
 	
-	If no font named `name` is found, [[App.DefaultFont]] is returned.
+	If no font named `name` is found, [[AppInstance.DefaultFont|App.DefaultFont]] is returned.
 
 	#end
 	Method GetFont:Font( name:String )
@@ -42,7 +42,7 @@ Class Theme
 	
 	#rem monkeydoc Gets a color from the theme.
 	
-	If no color named `name` is found, [[Color.Grey]] is returned.
+	If no color named `name` is found, [[std:std.graphics.Color.Grey|Color.Grey]] is returned.
 	
 	#end
 	Method GetColor:Color( name:String )

+ 3 - 9
modules/mojo/audio/audio.monkey2

@@ -25,18 +25,16 @@ End
 
 Public
 
-#rem monkeydoc Global instance of the AudioDevice class.
+#rem monkeydoc @hidden Global instance of the AudioDevice class.
 #end
 Const Audio:=New AudioDevice
 
-#rem monkeydoc The AudioDevice class.
+#rem monkeydoc @hidden The AudioDevice class.
 #end
 Class AudioDevice
 
-	'***** Internal *****
+	Internal
 	
-	#rem monkeydoc @hidden
-	#end
 	Method Init()
 	
 		Local error:=""
@@ -139,8 +137,6 @@ Class Sound Extends Resource
 	
 	Protected
 	
-	#rem monkeydoc @hidden
-	#end
 	Method OnDiscard() Override
 		
 		If _alBuffer alDeleteBuffers( 1,Varptr _alBuffer )
@@ -148,8 +144,6 @@ Class Sound Extends Resource
 		_alBuffer=0
 	End
 	
-	#rem monkeydoc @hidden
-	#end
 	Method OnFinalize() Override
 		
 		If _alBuffer alDeleteBuffers( 1,Varptr _alBuffer )

+ 1 - 1
modules/mojo/graphics/canvas.monkey2

@@ -21,7 +21,7 @@ End
 
 #rem monkeydoc The Canvas class.
 
-Canvas objects are used to perform rendering to either a mojo [[app.View]] or an 'off screen' [[mojo.graphics.Image]].
+Canvas objects are used to perform rendering to either a mojo [[View]] or an 'off screen' [[Image]].
 
 To draw to a canvas, use one of the 'Draw' methods. Drawing is affected by a number of draw states, including:
 

+ 4 - 1
modules/mojo/graphics/graphicsdevice.monkey2

@@ -450,7 +450,10 @@ Class GraphicsDevice
 		_modified=False
 		If _rtarget And _rtarget.NumColorTextures
 			Validate()
-			_rtarget.GetColorTexture(0).Modified( _viewport & _scissor )
+			For Local i:=0 Until _rtarget.NumColorTextures
+				Local texture:=_rtarget.GetColorTexture( i )
+				texture.Modified( _viewport & _scissor )
+			Next
 		Endif
 	End
 	

+ 55 - 51
modules/mojo/graphics/rendertarget.monkey2

@@ -8,6 +8,8 @@ Class RenderTarget Extends Resource
 		_colorTextures=colorTextures.Slice( 0 )
 		
 		_depthTexture=depthTexture
+
+		_size=_colorTextures ? _colorTextures[0].Size Else _depthTexture.Size
 		
 		_glDrawBufs=New GLenum[_colorTextures.Length]
 		
@@ -21,14 +23,19 @@ Class RenderTarget Extends Resource
 		Return _colorTextures.Length
 	End
 	
-	Property HasDepthTexture:Bool()
+	Property ColorTextures:Texture[]()
+		
+		Return _colorTextures.Slice( 0 )
+	End
+	
+	Property DepthTexture:Texture()
 		
 		Return _depthTexture
 	End
 	
 	Property Size:Vec2i()
 		
-		Return _colorTextures ? _colorTextures[0].Size Else _depthTexture.Size
+		Return _size
 	End
 	
 	Method GetColorTexture:Texture( index:Int )
@@ -36,55 +43,6 @@ Class RenderTarget Extends Resource
 		Return index>=0 And index<_colorTextures.Length ? _colorTextures[index] Else Null
 	End
 	
-	Method GetDepthTexture:Texture()
-		
-		Return _depthTexture
-	End
-	
-	'***** INTERNAL *****
-	
-	Method CheckStatus()
-		
-		Local status:=gles20.glCheckFramebufferStatus( GL_FRAMEBUFFER )
-		
-		If status=GL_FRAMEBUFFER_COMPLETE Return
-		
-		Local err:=""
-		
-		Select status
-		Case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
-			err="GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
-		Case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
-			err="GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"
-'		Case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
-'			err="GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS"
-		Case GL_FRAMEBUFFER_UNSUPPORTED
-			err="GL_FRAMEBUFFER_UNSUPPORTED"
-		Default
-			err="GL_FRAMEBUFFER_?????"
-		End
-		
-		Print "ColorTexture0 format="+(_colorTextures ? Cast<Int>( _colorTextures[0].Format ) Else 0)
-		Print "DepthTexture format="+(_depthTexture ? Cast<Int>( _depthTexture.Format ) Else 0)
-		
-		RuntimeError( "Framebuffer incomplete: status="+err )
-	End
-	
-	Method Bind()
-	
-		glBindFramebuffer( GL_FRAMEBUFFER,ValidateGLFramebuffer() )
-
-		If glexts.GL_draw_buffers 
-			glDrawBuffers( _glDrawBufs.Length,_glDrawBufs.Data )
-		Endif
-
-		If glexts.GL_read_buffer
-			glReadBuffer( _glDrawBufs ? _glDrawBufs[0] Else GL_NONE )
-		Endif
-
-		CheckStatus()
-	End
-	
 	Protected
 	
 	#rem monkeydoc Discards the rendertarget
@@ -106,10 +64,29 @@ Class RenderTarget Extends Resource
 		If _glSeq=glGraphicsSeq glDeleteFramebuffers( 1,Varptr _glFramebuffer )
 	End
 	
+	Internal
+	
+	Method Bind()
+	
+		glBindFramebuffer( GL_FRAMEBUFFER,ValidateGLFramebuffer() )
+
+		If glexts.GL_draw_buffers 
+			glDrawBuffers( _glDrawBufs.Length,_glDrawBufs.Data )
+		Endif
+
+		If glexts.GL_read_buffer
+			glReadBuffer( _glDrawBufs ? _glDrawBufs[0] Else GL_NONE )
+		Endif
+
+		CheckStatus()
+	End
+	
 	Private
 	
 	Field _colorTextures:Texture[]
 	Field _depthTexture:Texture
+	Field _size:Vec2i
+	
 	Field _glDrawBufs:GLenum[]
 	
 	Field _glFramebuffer:GLuint
@@ -148,4 +125,31 @@ Class RenderTarget Extends Resource
 		Return _glFramebuffer
 	End
 	
+	Method CheckStatus()
+		
+		Local status:=gles20.glCheckFramebufferStatus( GL_FRAMEBUFFER )
+		
+		If status=GL_FRAMEBUFFER_COMPLETE Return
+		
+		Local err:=""
+		
+		Select status
+		Case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+			err="GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
+		Case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
+			err="GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"
+'		Case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
+'			err="GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS"
+		Case GL_FRAMEBUFFER_UNSUPPORTED
+			err="GL_FRAMEBUFFER_UNSUPPORTED"
+		Default
+			err="GL_FRAMEBUFFER_?????"
+		End
+		
+		Print "ColorTexture0 format="+(_colorTextures ? Cast<Int>( _colorTextures[0].Format ) Else 0)
+		Print "DepthTexture format="+(_depthTexture ? Cast<Int>( _depthTexture.Format ) Else 0)
+		
+		RuntimeError( "Framebuffer incomplete: status="+err )
+	End
+	
 End

+ 4 - 0
modules/mojo/graphics/shader.monkey2

@@ -3,6 +3,8 @@ Namespace mojo.graphics
 
 #Import "shaders/@/shaders"
 
+Internal
+
 Const A_POSITION:=0
 Const A_TEXCOORD0:=1
 Const A_TEXCOORD1:=2
@@ -12,6 +14,8 @@ Const A_TANGENT:=5
 Const A_WEIGHTS:=6
 Const A_BONES:=7
 
+Private
+
 Class GLUniform
 
 	Field name:String

+ 2 - 2
modules/mojo/input/keyboard.monkey2

@@ -25,7 +25,7 @@ Const Keyboard:=New KeyboardDevice
 
 To access the keyboard device, use the global [[Keyboard]] constant.
 
-The keyboard device should only used after a new [[app.AppInstance]] is created.
+The keyboard device should only used after a new [[AppInstance]] is created.
 
 All methods that take a `key` parameter can also be combined with 'raw' keys.
 
@@ -173,7 +173,7 @@ Class KeyboardDevice Extends InputDevice
 	
 	Removes all queued characters in the character queue.
 	
-	Note that [[app.App.ResetPolledInput]] also flushes the character queue.
+	Note that [[AppInstance.ResetPolledInput|App.ResetPolledInput]] also flushes the character queue.
 	
 	#end
 	Method FlushChars()

+ 1 - 1
modules/mojo/input/mouse.monkey2

@@ -60,7 +60,7 @@ End
 
 To access the mouse device, use the global [[Mouse]] constant.
 
-The mouse device should only used after a new [[app.AppInstance]] is created.
+The mouse device should only used after a new [[AppInstance]] is created.
 
 #end
 Class MouseDevice Extends InputDevice

+ 1 - 1
modules/mojo/input/touch.monkey2

@@ -9,7 +9,7 @@ Const Touch:=New TouchDevice
 
 To access the touch device, use the global [[Touch]] constant.
 
-The touch device should only used after a new [[app.AppInstance]] is created.
+The touch device should only used after a new [[AppInstance]] is created.
 
 #end
 Class TouchDevice Extends InputDevice