From 37eb4787919d0babc6a322ebd4e887555c54a618 Mon Sep 17 00:00:00 2001 From: osa Date: Fri, 12 Oct 2012 13:37:55 +0400 Subject: [PATCH] 0023428: Extend OpenGl_Context to use Geometry Shaders extension Additional corrective integration --- src/OpenGl/OpenGl_Context.cxx | 15 +++++++++++++++ src/OpenGl/OpenGl_Context.hxx | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index 00f8c2f0f9..74747aa076 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -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 diff --git a/src/OpenGl/OpenGl_Context.hxx b/src/OpenGl/OpenGl_Context.hxx index 1d30704018..0fd25a32b0 100644 --- a/src/OpenGl/OpenGl_Context.hxx +++ b/src/OpenGl/OpenGl_Context.hxx @@ -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 -- 2.20.1