1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-13 14:27:08 +03:00

0025091: Visualization - use FBO for layer with immediate objects

This commit is contained in:
kgv
2015-01-29 16:01:07 +03:00
committed by bugmaster
parent af99433e4e
commit b86bb3df20
16 changed files with 328 additions and 42 deletions

View File

@@ -20,22 +20,6 @@
IMPLEMENT_STANDARD_HANDLE (OpenGl_FrameBuffer, OpenGl_Resource)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_FrameBuffer, OpenGl_Resource)
static inline bool isOddNumber (const GLsizei theNumber)
{
return theNumber & 0x01;
}
static inline GLsizei getEvenNumber (const GLsizei theNumber)
{
return isOddNumber (theNumber) ? (theNumber + 1) : theNumber;
}
//! Notice - 0 is not power of two here
static inline bool isPowerOfTwo (const GLsizei theNumber)
{
return !(theNumber & (theNumber - 1));
}
// =======================================================================
// function : OpenGl_FrameBuffer
// purpose :
@@ -176,6 +160,24 @@ void OpenGl_FrameBuffer::BindBuffer (const Handle(OpenGl_Context)& theGlCtx)
theGlCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myGlFBufferId);
}
// =======================================================================
// function : BindDrawBuffer
// purpose :
// =======================================================================
void OpenGl_FrameBuffer::BindDrawBuffer (const Handle(OpenGl_Context)& theGlCtx)
{
theGlCtx->arbFBO->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, myGlFBufferId);
}
// =======================================================================
// function : BindReadBuffer
// purpose :
// =======================================================================
void OpenGl_FrameBuffer::BindReadBuffer (const Handle(OpenGl_Context)& theGlCtx)
{
theGlCtx->arbFBO->glBindFramebuffer (GL_READ_FRAMEBUFFER, myGlFBufferId);
}
// =======================================================================
// function : UnbindBuffer
// purpose :