Hi!
I have a little problem with buffers here, run the code below and it works fine.
Rem the first code block, and unrem the second one and it'll crash.
Is it supposed to behave this way?
(BlitzMax code)
Framework Leadwerks.Engine
RegisterAbstractPath AppDir
Graphics 1024,768
CreateWorld
MoveEntity CreateCamera(),Vec3(0,0,-10)
MoveEntity CreatePointLight(5),Vec3(0,0,-3)
Local cube:TMesh=CreateCube()
Local buffer:TBuffer=CreateBuffer(1024,768,BUFFER_COLOR0|BUFFER_DEPTH|BUFFER_NORMAL)
'####################################################################################
Local TempBuffer:TBuffer = CreateBuffer( 1, 2, BUFFER_COLOR )
SetBuffer( TempBuffer )
SetColor( Vec4( 1, 0, 0, 1 ) )
Plot( 0, 0 )
SetColor( Vec4( 0, 1, 0, 1 ) )
Plot( 0, 1 )
SetColor( Vec4( 1, 1, 1, 1 ) )
SetBuffer( BackBuffer() )
'####################################################################################
'####################################################################################
Rem
Local TempBuffer:TBuffer = CreateBuffer( 2, 1, BUFFER_COLOR )
SetBuffer( TempBuffer )
SetColor( Vec4( 1, 0, 0, 1 ) )
Plot( 0, 0 )
SetColor( Vec4( 0, 1, 0, 1 ) )
Plot( 1, 0 )
SetColor( Vec4( 1, 1, 1, 1 ) )
SetBuffer( BackBuffer() )
End Rem
'####################################################################################
While Not KeyHit(KEY_ESCAPE)
TurnEntity cube,Vec3(1,1,2)
SetBuffer buffer
RenderWorld
SetBuffer BackBuffer()
RenderLights buffer
DrawImage( GetColorBuffer( TempBuffer ), 0, 0, 100, 100 )
Flip 1
Wend
End
Oh and btw, where'd the Bug Reports section go?