Render to Texture: Read on.....

BlitzMax Forums/BlitzMax Programming/Render to Texture: Read on.....

I'll release it tomorrow, I got too much going on right now.

The following example code creates an empty image, when you click the mouse it renders a white square and a Purple Circle to the image and attaches it to the mouse.
Strict

Import Indiepath.Render2Texture

Graphics 640,480

tRender.Initialise()

Local myImage:TImage = tRender.Create(128,128)


While Not KeyHit(KEY_ESCAPE)
  Cls
  If MouseHit(1)
  	tRender.TextureRender_Begin(myImage)
		Cls
		SetColor 255,255,255
    		DrawRect 0,0,40,40
		SetColor 255,0,255
		DrawOval 10,10,20,20
	tRender.TextureRender_End()
  EndIf

  SetColor 255,255,255

  tRender.BackBufferRender_Begin()
	  DrawImage myImage,MouseX(),MouseY()
  tRender.BackBufferRender_End()

  Flip

Wend
	
EndGraphics()