Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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);

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Posted

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

Posted

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?

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.

×
×
  • Create New...