1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0032712: Visualization, OpenGl_Context.hxx - avoid including OpenGL headers

This commit is contained in:
kgv 2021-12-03 19:51:07 +03:00 committed by smoskvin
parent ccd3858e63
commit 7ce8fe052d
4 changed files with 16 additions and 12 deletions

View File

@ -286,7 +286,7 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
#endif #endif
#endif #endif
memset (myFuncs.operator->(), 0, sizeof(OpenGl_GlFunctions)); memset (myFuncs.get(), 0, sizeof(OpenGl_GlFunctions));
myShaderManager = new OpenGl_ShaderManager (this); myShaderManager = new OpenGl_ShaderManager (this);
} }
@ -3142,7 +3142,7 @@ bool OpenGl_Context::SetSampleAlphaToCoverage (bool theToEnable)
// function : GetBufferSubData // function : GetBufferSubData
// purpose : // 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) if (!hasGetBufferData)
{ {

View File

@ -42,10 +42,11 @@
#include <TColStd_IndexedDataMapOfStringString.hxx> #include <TColStd_IndexedDataMapOfStringString.hxx>
#include <TColStd_PackedMapOfInteger.hxx> #include <TColStd_PackedMapOfInteger.hxx>
#include <OpenGl_Clipping.hxx> #include <OpenGl_Clipping.hxx>
#include <OpenGl_GlCore11.hxx>
#include <NCollection_Shared.hxx> #include <NCollection_Shared.hxx>
#include <memory>
//! Forward declarations //! Forward declarations
#if defined(__APPLE__) #if defined(__APPLE__)
#import <TargetConditionals.h> #import <TargetConditionals.h>
@ -74,6 +75,8 @@ struct OpenGl_ArbSamplerObject;
struct OpenGl_ArbTexBindless; struct OpenGl_ArbTexBindless;
struct OpenGl_ExtGS; struct OpenGl_ExtGS;
struct OpenGl_GlCore11Fwd;
struct OpenGl_GlCore11;
struct OpenGl_GlCore12; struct OpenGl_GlCore12;
struct OpenGl_GlCore13; struct OpenGl_GlCore13;
struct OpenGl_GlCore14; struct OpenGl_GlCore14;
@ -348,7 +351,7 @@ public:
Standard_Integer VersionMinor() const { return myGlVerMinor; } Standard_Integer VersionMinor() const { return myGlVerMinor; }
//! Access entire map of loaded OpenGL functions. //! 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). //! Clean up errors stack for this GL context (glGetError() in loop).
//! @return true if some error has been cleared //! @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() return theIndex >= myDrawBuffers.Lower()
&& theIndex <= myDrawBuffers.Upper() && theIndex <= myDrawBuffers.Upper()
? myDrawBuffers.Value (theIndex) ? myDrawBuffers.Value (theIndex)
: GL_NONE; : 0; // GL_NONE
} }
//! Switch draw buffer, wrapper for ::glDrawBuffer(). //! 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 1.5+ (desktop) via glGetBufferSubData();
//! - OpenGL ES 3.0+ via glMapBufferRange(); //! - OpenGL ES 3.0+ via glMapBufferRange();
//! - WebGL 2.0+ via gl.getBufferSubData(). //! - WebGL 2.0+ via gl.getBufferSubData().
//! @param theTarget [in] target buffer to map //! @param[in] theTarget target buffer to map {GLenum}
//! @param theOffset [in] offset to the beginning of sub-data //! @param[in] theOffset offset to the beginning of sub-data {GLintptr}
//! @param theSize [in] number of bytes to read //! @param[in] theSize number of bytes to read {GLsizeiptr}
//! @param theData [out] destination pointer to fill //! @param[out] theData destination pointer to fill
//! @return FALSE if functionality is unavailable //! @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. //! Return Graphics Driver's vendor.
const TCollection_AsciiString& Vendor() const { return myVendor; } const TCollection_AsciiString& Vendor() const { return myVendor; }
@ -1090,7 +1093,7 @@ private: // context info
OpenGl_Clipping myClippingState; //!< state of clip planes OpenGl_Clipping myClippingState; //!< state of clip planes
void* myGlLibHandle; //!< optional handle to GL library void* myGlLibHandle; //!< optional handle to GL library
NCollection_Handle<OpenGl_GlFunctions> std::unique_ptr<OpenGl_GlFunctions>
myFuncs; //!< mega structure for all GL functions myFuncs; //!< mega structure for all GL functions
Aspect_GraphicsLibrary myGapi; //!< GAPI name Aspect_GraphicsLibrary myGapi; //!< GAPI name
Handle(Image_SupportedFormats) Handle(Image_SupportedFormats)

View File

@ -15,6 +15,7 @@
#include <OpenGl_IndexBuffer.hxx> #include <OpenGl_IndexBuffer.hxx>
#include <OpenGl_Context.hxx> #include <OpenGl_Context.hxx>
#include <OpenGl_GlCore15.hxx>
#include <Standard_Assert.hxx> #include <Standard_Assert.hxx>
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_IndexBuffer, OpenGl_Buffer) IMPLEMENT_STANDARD_RTTIEXT(OpenGl_IndexBuffer, OpenGl_Buffer)

View File

@ -13,7 +13,7 @@
#include <OpenGl_UniformBuffer.hxx> #include <OpenGl_UniformBuffer.hxx>
#include <OpenGl_Context.hxx> #include <OpenGl_GlCore15.hxx>
#include <Standard_Assert.hxx> #include <Standard_Assert.hxx>
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_UniformBuffer, OpenGl_Buffer) IMPLEMENT_STANDARD_RTTIEXT(OpenGl_UniformBuffer, OpenGl_Buffer)