Jump to content

Recommended Posts

Posted

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

  • Upvote 2
Posted

For all available methods you should take a look at [LeadwerksInstallDir]/Include/Classes/Buffer.h.

You can easily bring it up by pressing "Ctrl"+"," in Visual Studio and then typing "Buffer".

  • Upvote 1
Posted

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.

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...