ChrisMAN Posted October 29, 2012 Share Posted October 29, 2012 I posted a gist describing the effect. download as start.lua and run engine. https://gist.github.com/3971641 I am switching buffers and issuing drawing commands. The output drastically changes based upon whether or not I am drawing on the current frame. When there is no drawing on the current frame it renders more how i would expect it. I am lacking intuition on how buffers work so any help is welcome. Thanks Chris Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted October 30, 2012 Author Share Posted October 30, 2012 Would it sweeten the pot if I said I will release a lua based GUI kit as soon as I can use this for clipping stuff outside of a renerable area ?? pwetty pwease *kitten eyes Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted October 30, 2012 Author Share Posted October 30, 2012 How did other people learn how buffers work? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted October 30, 2012 Share Posted October 30, 2012 I take it you've looked around here: http://www.leadwerks...erence/buffers/ and/or here: http://www.leadwerks...p?title=Buffers That said, I never cared for them and most other engines don't use them. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted October 30, 2012 Share Posted October 30, 2012 Hi Chris, This is ripped from my code in C++ I changed the variable names more genereic names. I have no idea how to do it in lua, but this may help. TTexture bufferTexture; TBuffer buf; if(flags & flagsUpdateBuffer) { flags &= ~flagsUpdateBuffer; if(bufferTexture)FreeTexture(bufferTexture); bufferTexture = 0; bufferTexture = CreateTexture(20, 20, TEXTURE_RGBA); SetColorBuffer(buf, bufferTexture, 0, 0); SetBuffer(buf); //Do the buffer drawing here SetBlend(BLEND_ALPHA); //Draw red a rectangle in the buffer SetColor(1.0F, 0.0F, 0.0F, 1.0F); DrawRect(0, 0, 10, 10); SetColor(1.0F, 1.0F,1.0F, 1.0F); SetBuffer(BackBuffer()); } //Draw the rectangle DrawImage(bufferTexture, 0, 0, 20, 20); Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted October 30, 2012 Author Share Posted October 30, 2012 I am drawing a buffer on to another buffer on to the back buffer. I could probably render all of the pieces on a flat higharchy. It's wierd because the colors are getting inverted based upon whether i am drawing on the same frame as its rendering Quote Link to comment Share on other sites More sharing options...
tjheldna Posted October 30, 2012 Share Posted October 30, 2012 Hmm don't know, my knowledge of the matter is minimal I needed help from other users to come up with that. Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted October 31, 2012 Author Share Posted October 31, 2012 Not being good with c++ is a serious impedance to making a game. Not knowing the graphics subsystems is just about as bad. Can I trade in my l33t web skills for low level and compantency with math? Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted October 31, 2012 Author Share Posted October 31, 2012 When I recreate the buffer on every frame I get rid of all of the problems. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.