|
@@ -59,11 +59,13 @@ Type TGraphics
|
|
|
|
|
|
Method Driver:TGraphicsDriver() Abstract
|
|
Method Driver:TGraphicsDriver() Abstract
|
|
|
|
|
|
- Method GetSettings( width Var,height Var,depth Var,hertz Var,flags Var ) Abstract
|
|
|
|
|
|
+ Method GetSettings( width Var,height Var,depth Var,hertz Var,flags Var, x Var, y Var ) Abstract
|
|
|
|
|
|
Method Close() Abstract
|
|
Method Close() Abstract
|
|
|
|
|
|
Method Resize(width:Int, height:Int) Abstract
|
|
Method Resize(width:Int, height:Int) Abstract
|
|
|
|
+
|
|
|
|
+ Method Position(x:Int, y:Int) Abstract
|
|
|
|
|
|
End Type
|
|
End Type
|
|
|
|
|
|
@@ -83,7 +85,7 @@ Type TGraphicsDriver
|
|
|
|
|
|
Method AttachGraphics:TGraphics( widget:Byte Ptr,flags ) Abstract
|
|
Method AttachGraphics:TGraphics( widget:Byte Ptr,flags ) Abstract
|
|
|
|
|
|
- Method CreateGraphics:TGraphics( width,height,depth,hertz,flags ) Abstract
|
|
|
|
|
|
+ Method CreateGraphics:TGraphics( width,height,depth,hertz,flags,x,y ) Abstract
|
|
|
|
|
|
Method SetGraphics( g:TGraphics ) Abstract
|
|
Method SetGraphics( g:TGraphics ) Abstract
|
|
|
|
|
|
@@ -100,7 +102,7 @@ Private
|
|
Global _defaultFlags
|
|
Global _defaultFlags
|
|
Global _driver:TGraphicsDriver
|
|
Global _driver:TGraphicsDriver
|
|
Global _graphicsModes:TGraphicsMode[]
|
|
Global _graphicsModes:TGraphicsMode[]
|
|
-Global _graphics:TGraphics,_gWidth,_gHeight,_gDepth,_gHertz,_gFlags
|
|
|
|
|
|
+Global _graphics:TGraphics,_gWidth,_gHeight,_gDepth,_gHertz,_gFlags,_gx,_gy
|
|
|
|
|
|
Global _exGraphics:TGraphics
|
|
Global _exGraphics:TGraphics
|
|
|
|
|
|
@@ -142,6 +144,8 @@ Function SetGraphicsDriver( driver:TGraphicsDriver,defaultFlags=GRAPHICS_BACKBUF
|
|
_gDepth=0
|
|
_gDepth=0
|
|
_gHertz=0
|
|
_gHertz=0
|
|
_gFlags=0
|
|
_gFlags=0
|
|
|
|
+ _gx=0
|
|
|
|
+ _gy=0
|
|
End Function
|
|
End Function
|
|
|
|
|
|
Rem
|
|
Rem
|
|
@@ -223,11 +227,11 @@ first have to select it using #SetGraphics.
|
|
The kind of graphics object returned depends upon the current graphics driver as set by
|
|
The kind of graphics object returned depends upon the current graphics driver as set by
|
|
#SetGraphicsDriver.
|
|
#SetGraphicsDriver.
|
|
End Rem
|
|
End Rem
|
|
-Function CreateGraphics:TGraphics( width,height,depth,hertz,flags )
|
|
|
|
|
|
+Function CreateGraphics:TGraphics( width,height,depth,hertz,flags,x,y )
|
|
flags:|_defaultFlags
|
|
flags:|_defaultFlags
|
|
Local g:TGraphics
|
|
Local g:TGraphics
|
|
Try
|
|
Try
|
|
- g=_driver.CreateGraphics( width,height,depth,hertz,flags )
|
|
|
|
|
|
+ g=_driver.CreateGraphics( width,height,depth,hertz,flags,x,y )
|
|
Catch ex:Object
|
|
Catch ex:Object
|
|
?Debug
|
|
?Debug
|
|
WriteStdout "CreateGraphics failed:"+ex.ToString()
|
|
WriteStdout "CreateGraphics failed:"+ex.ToString()
|
|
@@ -275,6 +279,8 @@ Function SetGraphics( g:TGraphics )
|
|
_gDepth=0
|
|
_gDepth=0
|
|
_gHertz=0
|
|
_gHertz=0
|
|
_gFlags=0
|
|
_gFlags=0
|
|
|
|
+ _gx=0
|
|
|
|
+ _gy=0
|
|
Return
|
|
Return
|
|
EndIf
|
|
EndIf
|
|
Local d:TGraphicsDriver=g.Driver()
|
|
Local d:TGraphicsDriver=g.Driver()
|
|
@@ -283,7 +289,7 @@ Function SetGraphics( g:TGraphics )
|
|
_graphicsModes=Null
|
|
_graphicsModes=Null
|
|
_driver=d
|
|
_driver=d
|
|
EndIf
|
|
EndIf
|
|
- g.GetSettings _gWidth,_gHeight,_gDepth,_gHertz,_gFlags
|
|
|
|
|
|
+ g.GetSettings _gWidth,_gHeight,_gDepth,_gHertz,_gFlags,_gx,_gy
|
|
d.SetGraphics g
|
|
d.SetGraphics g
|
|
_graphics=g
|
|
_graphics=g
|
|
End Function
|
|
End Function
|
|
@@ -299,6 +305,17 @@ Function GraphicsResize( width:Int, height:Int )
|
|
End If
|
|
End If
|
|
End Function
|
|
End Function
|
|
|
|
|
|
|
|
+Rem
|
|
|
|
+bbdoc: Sets the position of the graphics window to @x, @y.
|
|
|
|
+End Rem
|
|
|
|
+Function GraphicsPosition( x:Int, y:Int )
|
|
|
|
+ If _driver And _graphics Then
|
|
|
|
+ _gx = x
|
|
|
|
+ _gy = y
|
|
|
|
+ _graphics.Position(x, y)
|
|
|
|
+ End If
|
|
|
|
+End Function
|
|
|
|
+
|
|
Rem
|
|
Rem
|
|
bbdoc: Get width of current graphics object
|
|
bbdoc: Get width of current graphics object
|
|
returns: The width, in pixels, of the current graphics object
|
|
returns: The width, in pixels, of the current graphics object
|
|
@@ -349,6 +366,14 @@ Function GraphicsFlags()
|
|
Return _gFlags
|
|
Return _gFlags
|
|
End Function
|
|
End Function
|
|
|
|
|
|
|
|
+Function GraphicsX:Int()
|
|
|
|
+ Return _gx
|
|
|
|
+End Function
|
|
|
|
+
|
|
|
|
+Function GraphicsY:Int()
|
|
|
|
+ Return _gy
|
|
|
|
+End Function
|
|
|
|
+
|
|
Rem
|
|
Rem
|
|
bbdoc: Flip current graphics object
|
|
bbdoc: Flip current graphics object
|
|
about:
|
|
about:
|
|
@@ -441,15 +466,15 @@ Once #Graphics has executed, you can begin rendering immediately without any nee
|
|
#Graphics also enables #{polled input} mode, providing a simple way to monitor the keyboard
|
|
#Graphics also enables #{polled input} mode, providing a simple way to monitor the keyboard
|
|
and mouse.
|
|
and mouse.
|
|
End Rem
|
|
End Rem
|
|
-Function Graphics:TGraphics( width,height,depth=0,hertz=60,flags=0 )
|
|
|
|
|
|
+Function Graphics:TGraphics( width,height,depth=0,hertz=60,flags=0,x=-1,y=-1 )
|
|
EndGraphics
|
|
EndGraphics
|
|
flags:|_defaultFlags
|
|
flags:|_defaultFlags
|
|
|
|
|
|
- Local g:TGraphics=CreateGraphics( width,height,depth,hertz,flags )
|
|
|
|
|
|
+ Local g:TGraphics=CreateGraphics( width,height,depth,hertz,flags,x,y )
|
|
If Not g Return
|
|
If Not g Return
|
|
|
|
|
|
BumpGraphicsSeq
|
|
BumpGraphicsSeq
|
|
-
|
|
|
|
|
|
+
|
|
SetGraphics g
|
|
SetGraphics g
|
|
|
|
|
|
If depth
|
|
If depth
|