New cross platform render module - almost ready.

Miscellaneous Forums/General Discussion/New cross platform render module - almost ready.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

With all this talk about software rendering and people telling me that it could not be done using standard DX7 and OGL installs I decided to give it a bash.

The Challenges :
1) Maintain system compatibilities on 3D and non 3D systems
2) Maintain cross-platform compatibilities
3) Provide the fastest possible rendering speeds whilst supporting the BMX graphics command set
4) Support for FullScreen and Windowed

My Solution :
A module that plugs into BMAX that enables software fallback on Windows and Mac. Render Acceleration enabled by an integrated DirtyRects system. ** This is straight out of the box, you don't need .dll's you don't need wrapper modules! It's autosensing so it'll drop back to whatever mode it needs.

http://modules.indiepath.com/forum/viewtopic.php?p=170

Example Code :
Strict

' Simple DirtyRect Implementation 
' Test for BMAX software Render mode
' Copyright 2006 Indiepath Ltd.

Include "MOD_Dirty2.bmx"

Global DrawMode
Global ShowDirty = False
Global screenwidth=640
Global screenheight=480

HideMouse()

Graphics 640,480,0

Local TestImage:TImage 	= LoadImage("image.png",0)
Local Test1:DirtyImage 	= DirtyImage.Create(TestImage)
Local Test2:DirtyImage 	= DirtyImage.Create(TestImage)
Local back:DirtyImage 		= DirtyImage.Load("bg1.jpg",FILTEREDIMAGE)

Local x:Float = 0
Local y:Float= 0

MoveMouse(80,70)

DrawMode = DrawAll

While Not KeyHit(KEY_ESCAPE)

	SetBlend(ALPHABLEND)
	SetAlpha(Sin(MilliSecs()/5)/4+0.75)
	SetColor(100,100,255)
	Test1.Draw(MouseX(),MouseY())
	
	SetAlpha(1)
	SetColor(Rnd(0,255),Rnd(0,255),Rnd(0,255))
	Test2.Draw(Int(Sin(x/10)*x),Int(Cos(x/10)*x))

	SetColor(255,255,255)
	back._Draw(DrawBG)
	
	DirtyRect._Flip
	DirtyRect._Cls
	DirtyRect.KillAll

	x:+ 0.002
	If x > 620 Then x = 0
	
Wend