r2t - Sourcecode.

BlitzMax Forums/BlitzMax Programming/r2t - Sourcecode.

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.

Hi Tim,
This doesn't look right...
Strict

Import Indiepath.Render2Texture

HideMouse()
'SetGraphicsDriver GLMax2DDriver()
Graphics 512,512

tRender.Initialise()

Local myImage:TImage = tRender.Create(256,256)
Local image:TImage=LoadImage("max.png")
Delay (500)
' Do Normal Render to Backbuffer

Local ms=MilliSecs()

tRender.BackBufferRender_Begin()
	Cls
	DrawImage image , 0 , 0
	SetColor 255,0,0
	DrawRect 100 , 100 , 100 , 100
	SetColor 255,255,255
tRender.BackBufferRender_End()	

Flip 0

Print MilliSecs()-ms

WaitKey()
Cls

' Do Render To Texture Then draw Textured image on screen

ms=MilliSecs()

tRender.TextureRender_Begin(myImage)
	Cls
	DrawImage image , 0 , 0
	SetColor 255,0,0
	DrawRect 100 , 100 , 100 , 100
	SetColor 255,255,255
tRender.TextureRender_End()

SetColor 255,255,255

tRender.BackBufferRender_Begin()
	Cls
  	DrawImage myImage,20,0
tRender.BackBufferRender_End()

Flip 0

Print MilliSecs()-ms

WaitKey()

The render-to-texture image size is reduced.