Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leadwerks 3 C++ Buffer use


WtymonrW

Recommended Posts

You can look at the files I posted over there:

http://www.leadwerks.com/werkspace/topic/11579-3d-screen-mode-for-3d-glasses/#entry83580

If you open the StereoRender.cpp from the zip-file, you can see, how you can use buffers.

 

Basically that file creates a Buffer called "leftEye" by using:

Buffer* leftEye = Buffer::Create(context->GetWidth() + 1, context->GetHeight(), 1, 1, 0);

 

This buffer can be cleared by

leftEye->Clear()

 

Rendering to this Buffer is done by:

context->Disable();
leftEye->Enable();
world->Render();
leftEye->Disable();
context->Enable();

 

The example then draws the leftEye-image over the context's image by using

int blendModeOld = context->GetBlendMode();
context->SetBlendMode(Blend::Alpha);
context->DrawImage(leftEye->GetColorTexture(), 0, 0, context->GetWidth()+1, context->GetHeight()+1);
context->SetBlendMode(blendModeOld);

Link to post

I don't really understand the question but I guess it's about the relationship between Context and Buffer.

The Context-class inherits from / extends / is a sub-class of the Buffer-class, so basically the context is a special sort of buffer.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

Facebook Twitter Youtube Github Steam
×
×
  • Create New...