1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023428: Extend OpenGl_Context to use Geometry Shaders extension

Additional corrective integration
This commit is contained in:
osa 2012-10-12 13:37:55 +04:00
parent d891ede670
commit 37eb478791
2 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include <OpenGl_ArbTBO.hxx>
#include <OpenGl_ArbIns.hxx>
#include <OpenGl_ExtFBO.hxx>
#include <OpenGl_ExtGS.hxx>
#include <OpenGl_GlCore20.hxx>
#include <Standard_ProgramError.hxx>
@ -77,6 +78,7 @@ OpenGl_Context::OpenGl_Context()
arbTBO (NULL),
arbIns (NULL),
extFBO (NULL),
extGS (NULL),
atiMem (Standard_False),
nvxMem (Standard_False),
mySharedResources (new OpenGl_ResourcesMap()),
@ -125,6 +127,7 @@ OpenGl_Context::~OpenGl_Context()
delete myGlCore20;
delete arbVBO;
delete extFBO;
delete extGS;
}
// =======================================================================
@ -530,6 +533,18 @@ void OpenGl_Context::init()
}
}
// initialize GS extension (EXT)
if (CheckExtension ("GL_EXT_geometry_shader4"))
{
extGS = new OpenGl_ExtGS();
memset (extGS, 0, sizeof(OpenGl_ExtGS)); // nullify whole structure
if (!FindProcShort (extGS, glProgramParameteriEXT))
{
delete extGS;
extGS = NULL;
}
}
myGlCore20 = new OpenGl_GlCore20();
memset (myGlCore20, 0, sizeof(OpenGl_GlCore20)); // nullify whole structure

View File

@ -44,6 +44,7 @@ struct OpenGl_ArbVBO;
struct OpenGl_ArbTBO;
struct OpenGl_ArbIns;
struct OpenGl_ExtFBO;
struct OpenGl_ExtGS;
//! This class generalize access to the GL context and available extensions.
//!
@ -234,6 +235,7 @@ public: // extensions
OpenGl_ArbTBO* arbTBO; //!< GL_ARB_texture_buffer_object
OpenGl_ArbIns* arbIns; //!< GL_ARB_draw_instanced
OpenGl_ExtFBO* extFBO; //!< GL_EXT_framebuffer_object
OpenGl_ExtGS* extGS; //!< GL_EXT_geometry_shader4
Standard_Boolean atiMem; //!< GL_ATI_meminfo
Standard_Boolean nvxMem; //!< GL_NVX_gpu_memory_info