WtymonrW Posted March 11, 2015 Share Posted March 11, 2015 Have anyone code exapmles with buffers using? In wiki it is VERY old Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted March 11, 2015 Share Posted March 11, 2015 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); 2 Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted March 11, 2015 Share Posted March 11, 2015 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". 1 Quote Link to comment Share on other sites More sharing options...
WtymonrW Posted March 11, 2015 Author Share Posted March 11, 2015 Oh! I've didn't know what class drow buffers. So, it's Context? Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted March 11, 2015 Share Posted March 11, 2015 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. 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.