Skip to content

Commit

Permalink
Fixed latest build issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
woollybah committed Jul 7, 2023
1 parent ff3a5f9 commit 93f1552
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 17 deletions.
23 changes: 19 additions & 4 deletions d3d9odd2d.mod/d3d9odd2d.bmx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Strict
SuperStrict

Rem
bbdoc: Graphics/Direct3D9 Odd2D
Expand Down Expand Up @@ -87,16 +87,28 @@ Type TD3D9Odd2DDriver Extends TOdd2DDriver

' Method GraphicsModes:TGraphicsMode[]() Abstract

Method AttachGraphics:TMax2DGraphics( widget:Byte Ptr, flags:Int )
Method AttachGraphics:TMax2DGraphics( widget:Byte Ptr, flags:Long )
Local g:TD3D9Graphics=D3D9GraphicsDriver().AttachGraphics( widget,flags )
If g Return TMax2DGraphics.Create( g,Self )
End Method

Method CreateGraphics:TGraphics( width:Int, height:Int ,depth:Int, hertz:Int, flags:Int, x:Int, y:Int )
Method CreateGraphics:TGraphics( width:Int, height:Int ,depth:Int, hertz:Int, flags:Long, x:Int, y:Int )
Local g:TD3D9Graphics=D3D9GraphicsDriver().CreateGraphics( width,height,depth,hertz,flags,x,y )
If g Return TMax2DGraphics.Create( g,Self )
End Method


Method CreateRenderImageFrame:TImageFrame(width:UInt, height:UInt, flags:Int)
' TODO
End Method

Method SetBackBuffer()
' TODO
End Method

Method SetRenderImageFrame(RenderImageFrame:TImageFrame)
' TODO
End Method

Method SetGraphics( g:TGraphics )
Super.SetGraphics g
If g Then _d3dDev=TD3D9Graphics(TMax2DGraphics(g)._graphics).GetDirect3DDevice()
Expand Down Expand Up @@ -142,6 +154,9 @@ Type TD3D9Odd2DDriver Extends TOdd2DDriver
TOD3D9ImageFrame(iframe).DrawPoly xyuv,handlex,handley,originx,originy
End Method

Method ToString:String()
Return "Direct3D9 Odd2D Driver"
End Method
End Type

Rem
Expand Down
2 changes: 1 addition & 1 deletion examples/odd2dtest.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Framework ODD.GLOdd2D
?Win32
Import ODD.D3D9Odd2D
?
Import brl.RandomDefault
Import brl.Random

SetGraphicsDriver GLOdd2DDriver()
'Uncomment a driver to try it (Windows only)
Expand Down
21 changes: 18 additions & 3 deletions glodd2d.mod/glodd2d.bmx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Strict
SuperStrict

Rem
bbdoc: Graphics/OpenGL Odd2D
Expand Down Expand Up @@ -77,16 +77,28 @@ Type TGLOdd2DDriver Extends TOdd2DDriver

' Method GraphicsModes:TGraphicsMode[]() Abstract

Method AttachGraphics:TMax2DGraphics( widget:Byte Ptr, flags:Int )
Method AttachGraphics:TMax2DGraphics( widget:Byte Ptr, flags:Long )
Local g:TGLGraphics=GLGraphicsDriver().AttachGraphics( widget,flags )
If g Return TMax2DGraphics.Create( g,Self )
End Method

Method CreateGraphics:TGraphics( width:Int, height:Int ,depth:Int, hertz:Int, flags:Int, x:Int, y:Int )
Method CreateGraphics:TGraphics( width:Int, height:Int ,depth:Int, hertz:Int, flags:Long, x:Int, y:Int )
Local g:TGLGraphics=GLGraphicsDriver().CreateGraphics( width,height,depth,hertz,flags,x,y )
If g Return TMax2DGraphics.Create( g,Self )
End Method

Method CreateRenderImageFrame:TImageFrame(width:UInt, height:UInt, flags:Int)
' TODO
End Method

Method SetBackBuffer()
' TODO
End Method

Method SetRenderImageFrame(RenderImageFrame:TImageFrame)
' TODO
End Method

' Method SetGraphics( g:TGraphics ) Abstract

' Method Flip( sync ) Abstract
Expand Down Expand Up @@ -128,6 +140,9 @@ Type TGLOdd2DDriver Extends TOdd2DDriver
TOGLImageFrame(iframe).DrawPoly xyuv,handlex,handley,originx,originy
End Method

Method ToString:String()
Return "OpenGL Odd2D Driver"
End Method
End Type

Rem
Expand Down
18 changes: 9 additions & 9 deletions odd2d.mod/odd2d.bmx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Strict
SuperStrict

Rem
bbdoc: Graphics/Odd2D
Expand Down Expand Up @@ -43,7 +43,7 @@ Type TOdd2DDriver Extends TMax2DDriver
Field adj_vp_x:Int, adj_vp_y:Int, adj_vp_width:Int, adj_vp_height:Int

Field m2d_blend:Int, m2d_alpha:Float, m2d_linewidth:Float
Field m2d_clsred:Int, m2d_clsgreen:Int, m2d_clsblue:Int
Field m2d_clsred:Int, m2d_clsgreen:Int, m2d_clsblue:Int,m2d_clsalpha:Float
Field m2d_red:Int, m2d_green:Int, m2d_blue:Int
Field m2d_ix:Float, m2d_iy:Float, m2d_jx:Float, m2d_jy:Float

Expand All @@ -61,7 +61,7 @@ Type TOdd2DDriver Extends TMax2DDriver
_odd2dDriver=TOdd2DDriver(_max2dDriver)
End Method

Method Flip( sync:Int )
Method Flip:Int( sync:Int )
ClearBorder
_m2ddriver.Flip sync
End Method
Expand All @@ -83,9 +83,9 @@ Type TOdd2DDriver Extends TMax2DDriver
_m2dDriver.SetColor red,green,blue
End Method

Method SetClsColor( red:Int, green:Int, blue:Int )
m2d_clsred=red;m2d_clsgreen=green;m2d_clsblue=blue
_m2dDriver.SetClsColor red,green,blue
Method SetClsColor( red:Int, green:Int, blue:Int, alpha:Float )
m2d_clsred=red;m2d_clsgreen=green;m2d_clsblue=blue;m2d_clsalpha=alpha
_m2dDriver.SetClsColor red,green,blue,alpha
End Method

Method SetViewport( x:Int, y:Int, width:Int, height:Int )
Expand Down Expand Up @@ -162,7 +162,7 @@ Type TOdd2DDriver Extends TMax2DDriver
SetScale sclx,scly
End Method

Method DrawPoly( xy#[],handlex#,handley#,originx#,originy# )
Method DrawPoly( xy#[],handlex#,handley#,originx#,originy#, indices:Int[] )
Local rot:Float=GetRotation()
Local sclx:Float,scly:Float
GetScale sclx,scly
Expand All @@ -172,7 +172,7 @@ Type TOdd2DDriver Extends TMax2DDriver
originx:+focus_x+border_x
originy:+focus_y+border_y

_m2dDriver.DrawPoly xy,handlex,handley,originx,originy
_m2dDriver.DrawPoly xy,handlex,handley,originx,originy,indices

SetRotation rot
SetScale sclx,scly
Expand Down Expand Up @@ -329,7 +329,7 @@ Type TOdd2DDriver Extends TMax2DDriver
m2d_blend=MASKBLEND
m2d_alpha=1
m2d_linewidth=1
m2d_clsred=0;m2d_clsgreen=0;m2d_clsblue=0
m2d_clsred=0;m2d_clsgreen=0;m2d_clsblue=0;m2d_clsalpha=1
m2d_red=255;m2d_green=255;m2d_blue=255
End Method

Expand Down

0 comments on commit 93f1552

Please sign in to comment.