// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Text Shader" )
SetWindowSize( 640, 360 , 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 100, 100 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 0, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
RenderImageID=CreateRenderImage(400,240,0,0)
ObjectID=CreateObjectBox(1,1,1)
SpriteID=CreateSprite(RenderImageID)
SetSpriteSize(SpriteID,50,50)
do
Print( ScreenFPS() )
Angle#=Angle#+10.0*GetFrameTime()
SetObjectRotation(ObjectID,Angle#,Angle#,0)
//~ Update(0)
SetRenderToImage(RenderImageID,-1)
ClearScreen()
//~ Render2DBack()
Render3D()
SetRenderToScreen()
//~ Render2DFront()
//~ swap()
Sync()
loop
loop
I think Opethmaniac does have the right approach... using RenderTargets
After trying my code, please consider removing the "//~" and comment the "sync()" command instead, for performance reasons.