Jump to content

Strange buffers behaviour.


Thareh
 Share

Recommended Posts

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? :)

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Oh and btw, where'd the Bug Reports section go? :)

Access it from the the following menu at the top of the forum page: Community / Bug Tracker

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Oh okey, Thanks! :)

What's the best way to create a texture with the dimensions 2x1 and two different colors on each of the pixels then? :)

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

And why isn't it safe to create buffers smaller than 64x64 pixels?

I simply need a way to do 'Render to Texture' on textures smaller than 64x64 pixels.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...