diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index da868a036c..f5274a6d46 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -286,7 +286,7 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps) #endif #endif - memset (myFuncs.operator->(), 0, sizeof(OpenGl_GlFunctions)); + memset (myFuncs.get(), 0, sizeof(OpenGl_GlFunctions)); myShaderManager = new OpenGl_ShaderManager (this); } @@ -3142,7 +3142,7 @@ bool OpenGl_Context::SetSampleAlphaToCoverage (bool theToEnable) // function : GetBufferSubData // purpose : // ======================================================================= -bool OpenGl_Context::GetBufferSubData (GLenum theTarget, GLintptr theOffset, GLsizeiptr theSize, void* theData) +bool OpenGl_Context::GetBufferSubData (unsigned int theTarget, intptr_t theOffset, intptr_t theSize, void* theData) { if (!hasGetBufferData) { diff --git a/src/OpenGl/OpenGl_Context.hxx b/src/OpenGl/OpenGl_Context.hxx index 82d1891942..ed3418d3d5 100644 --- a/src/OpenGl/OpenGl_Context.hxx +++ b/src/OpenGl/OpenGl_Context.hxx @@ -42,10 +42,11 @@ #include #include #include -#include #include +#include + //! Forward declarations #if defined(__APPLE__) #import @@ -74,6 +75,8 @@ struct OpenGl_ArbSamplerObject; struct OpenGl_ArbTexBindless; struct OpenGl_ExtGS; +struct OpenGl_GlCore11Fwd; +struct OpenGl_GlCore11; struct OpenGl_GlCore12; struct OpenGl_GlCore13; struct OpenGl_GlCore14; @@ -348,7 +351,7 @@ public: Standard_Integer VersionMinor() const { return myGlVerMinor; } //! Access entire map of loaded OpenGL functions. - const OpenGl_GlFunctions* Functions() const { return myFuncs.operator->(); } + const OpenGl_GlFunctions* Functions() const { return myFuncs.get(); } //! Clean up errors stack for this GL context (glGetError() in loop). //! @return true if some error has been cleared @@ -745,7 +748,7 @@ public: //! @name methods to alter or retrieve current state return theIndex >= myDrawBuffers.Lower() && theIndex <= myDrawBuffers.Upper() ? myDrawBuffers.Value (theIndex) - : GL_NONE; + : 0; // GL_NONE } //! Switch draw buffer, wrapper for ::glDrawBuffer(). @@ -964,12 +967,12 @@ public: //! @name methods to alter or retrieve current state //! - OpenGL 1.5+ (desktop) via glGetBufferSubData(); //! - OpenGL ES 3.0+ via glMapBufferRange(); //! - WebGL 2.0+ via gl.getBufferSubData(). - //! @param theTarget [in] target buffer to map - //! @param theOffset [in] offset to the beginning of sub-data - //! @param theSize [in] number of bytes to read - //! @param theData [out] destination pointer to fill + //! @param[in] theTarget target buffer to map {GLenum} + //! @param[in] theOffset offset to the beginning of sub-data {GLintptr} + //! @param[in] theSize number of bytes to read {GLsizeiptr} + //! @param[out] theData destination pointer to fill //! @return FALSE if functionality is unavailable - Standard_EXPORT bool GetBufferSubData (GLenum theTarget, GLintptr theOffset, GLsizeiptr theSize, void* theData); + Standard_EXPORT bool GetBufferSubData (unsigned int theTarget, intptr_t theOffset, intptr_t theSize, void* theData); //! Return Graphics Driver's vendor. const TCollection_AsciiString& Vendor() const { return myVendor; } @@ -1090,7 +1093,7 @@ private: // context info OpenGl_Clipping myClippingState; //!< state of clip planes void* myGlLibHandle; //!< optional handle to GL library - NCollection_Handle + std::unique_ptr myFuncs; //!< mega structure for all GL functions Aspect_GraphicsLibrary myGapi; //!< GAPI name Handle(Image_SupportedFormats) diff --git a/src/OpenGl/OpenGl_IndexBuffer.cxx b/src/OpenGl/OpenGl_IndexBuffer.cxx index 0dcf7e7d9d..fb09e40efa 100644 --- a/src/OpenGl/OpenGl_IndexBuffer.cxx +++ b/src/OpenGl/OpenGl_IndexBuffer.cxx @@ -15,6 +15,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(OpenGl_IndexBuffer, OpenGl_Buffer) diff --git a/src/OpenGl/OpenGl_UniformBuffer.cxx b/src/OpenGl/OpenGl_UniformBuffer.cxx index af7fa0bfb2..5e5af556e4 100644 --- a/src/OpenGl/OpenGl_UniformBuffer.cxx +++ b/src/OpenGl/OpenGl_UniformBuffer.cxx @@ -13,7 +13,7 @@ #include -#include +#include #include IMPLEMENT_STANDARD_RTTIEXT(OpenGl_UniformBuffer, OpenGl_Buffer)