Kaynağa Gözat

Adds support for resizeable graphics objects.

woollybah 7 yıl önce
ebeveyn
işleme
915cfe44c9
1 değiştirilmiş dosya ile 14 ekleme ve 0 silme
  1. 14 0
      graphics.mod/graphics.bmx

+ 14 - 0
graphics.mod/graphics.bmx

@@ -87,6 +87,10 @@ Type TGraphicsDriver
 	
 	Method Flip( sync ) Abstract
 	
+	Method CanResize:Int()
+		Return False
+	End Method
+
 End Type
 
 Private
@@ -282,6 +286,16 @@ Function SetGraphics( g:TGraphics )
 	_graphics=g
 End Function
 
+Rem
+bbdoc: Resize the current graphics object to @width, @height.
+End Rem
+Function GraphicsResize( width:Int, height:Int )
+	If _driver And _driver.CanResize() And _graphics Then
+		_gWidth = width
+		_gHeight = height
+	End If
+End Function
+
 Rem
 bbdoc: Get width of current graphics object
 returns: The width, in pixels, of the current graphics object