|
| OpenGl_Context (const Handle< OpenGl_Caps > &theCaps=NULL) |
| Empty constructor. You should call Init() to perform initialization with bound GL context.
|
|
virtual | ~OpenGl_Context () |
| Destructor.
|
|
void | forcedRelease () |
| Release all resources, including shared ones.
|
|
void | Share (const Handle< OpenGl_Context > &theShareCtx) |
| Share GL context resources. theShareCtx - handle to context to retrieve handles to shared resources.
|
|
Standard_Boolean | Init (const Standard_Boolean theIsCoreProfile=Standard_False) |
| Initialize class from currently bound OpenGL context. Method should be called only once.
|
|
Standard_Boolean | IsValid () const |
|
Standard_Boolean | Init (const Aspect_Drawable theSurface, const Aspect_Display theDisplay, const Aspect_RenderingContext theContext, const Standard_Boolean theIsCoreProfile=Standard_False) |
| Initialize class from specified surface and rendering context. Method should be called only once. The meaning of parameters is platform-specific.
|
|
Aspect_Drawable | Window () const |
| Return window handle currently bound to this OpenGL context (EGLSurface | HWND | GLXDrawable).
|
|
Aspect_Display | GetDisplay () const |
| Return display / window device context (EGLDisplay | HDC | Display*).
|
|
Aspect_RenderingContext | RenderingContext () const |
| Return rendering context (EGLContext | HGLRC | GLXContext | EAGLContext* | NSOpenGLContext*).
|
|
Standard_Boolean | CheckExtension (const char *theExtName) const |
| Check if theExtName extension is supported by active GL context.
|
|
template<typename FuncType_t > |
Standard_Boolean | FindProcVerbose (const char *&theLastFailFuncName, const char *theFuncName, FuncType_t &theFuncPtr) |
| Auxiliary template to retrieve GL function pointer. Pointer to function retrieved from library is statically casted to requested type - there no way to check real signature of exported function. The context should be bound before call.
|
|
template<typename FuncType_t > |
Standard_Boolean | FindProc (const char *theFuncName, FuncType_t &theFuncPtr) |
| Auxiliary template to retrieve GL function pointer. Same as FindProcVerbose() but without auxiliary last function name argument.
|
|
Aspect_GraphicsLibrary | GraphicsLibrary () const |
| Return active graphics library.
|
|
Standard_Boolean | IsGlGreaterEqual (const Standard_Integer theVerMajor, const Standard_Integer theVerMinor) const |
|
Standard_Integer | VersionMajor () const |
| Return cached GL version major number.
|
|
Standard_Integer | VersionMinor () const |
| Return cached GL version minor number.
|
|
const OpenGl_GlFunctions * | Functions () const |
| Access entire map of loaded OpenGL functions.
|
|
bool | ResetErrors (const bool theToPrintErrors=false) |
| Clean up errors stack for this GL context (glGetError() in loop).
|
|
Standard_Boolean | IsCurrent () const |
| This method uses system-dependent API to retrieve information about GL context bound to the current thread.
|
|
Standard_Boolean | MakeCurrent () |
| Activates current context. Class should be initialized with appropriate info.
|
|
void | SwapBuffers () |
| Swap front/back buffers for this GL context (should be activated before!).
|
|
Standard_Boolean | SetSwapInterval (const Standard_Integer theInterval) |
| Setup swap interval (VSync).
|
|
Standard_Boolean | IsRender () const |
| Return true if active mode is GL_RENDER (cached state)
|
|
Standard_Boolean | IsFeedback () const |
| Return true if active mode is GL_FEEDBACK (cached state)
|
|
Standard_Size | AvailableMemory () const |
| This function retrieves information from GL about free GPU memory that is:
|
|
TCollection_AsciiString | MemoryInfo () const |
| This function retrieves information from GL about GPU memory and contains more vendor-specific values than AvailableMemory().
|
|
void | MemoryInfo (TColStd_IndexedDataMapOfStringString &theDict) const |
| This function retrieves information from GL about GPU memory.
|
|
void | DiagnosticInformation (TColStd_IndexedDataMapOfStringString &theDict, Graphic3d_DiagnosticInfo theFlags) const |
| Fill in the dictionary with OpenGL info. Should be called with bound context.
|
|
void | WindowBufferBits (Graphic3d_Vec4i &theColorBits, Graphic3d_Vec2i &theDepthStencilBits) const |
| Fetches information about window buffer pixel format.
|
|
const Handle< OpenGl_Resource > & | GetResource (const TCollection_AsciiString &theKey) const |
| Access shared resource by its name.
|
|
template<typename TheHandleType > |
Standard_Boolean | GetResource (const TCollection_AsciiString &theKey, TheHandleType &theValue) const |
| Access shared resource by its name.
|
|
Standard_Boolean | ShareResource (const TCollection_AsciiString &theKey, const Handle< OpenGl_Resource > &theResource) |
| Register shared resource. Notice that after registration caller shouldn't release it by himself - it will be automatically released on context destruction.
|
|
void | ReleaseResource (const TCollection_AsciiString &theKey, const Standard_Boolean theToDelay=Standard_False) |
| Release shared resource. If there are more than one reference to this resource (also used by some other existing object) then call will be ignored. This means that current object itself should nullify handle before this call. Notice that this is unrecommended operation at all and should be used only in case of fat resources to release memory for other needs.
|
|
template<class T > |
void | DelayedRelease (Handle< T > &theResource) |
| Append resource to queue for delayed clean up. Resources in this queue will be released at next redraw call.
|
|
void | ReleaseDelayed () |
| Clean up the delayed release queue.
|
|
const OpenGl_ResourcesMap & | SharedResources () const |
| Return map of shared resources.
|
|
OpenGl_Clipping & | ChangeClipping () |
|
const OpenGl_Clipping & | Clipping () const |
|
const Handle< OpenGl_ShaderManager > & | ShaderManager () const |
|
Standard_Integer | TextureWrapClamp () const |
| Either GL_CLAMP_TO_EDGE (1.2+) or GL_CLAMP (1.1).
|
|
Standard_Boolean | HasTextureBaseLevel () const |
|
const Handle< Image_SupportedFormats > & | SupportedTextureFormats () const |
| Return map of supported texture formats.
|
|
Standard_Integer | MaxDegreeOfAnisotropy () const |
|
Standard_Integer | MaxTextureSize () const |
|
Standard_Integer | MaxCombinedTextureUnits () const |
|
Standard_Integer | MaxTextureUnitsFFP () const |
| This method returns the multi-texture limit for obsolete fixed-function pipeline. Use MaxCombinedTextureUnits() instead for limits for using programmable pipeline.
|
|
Graphic3d_TextureUnit | SpriteTextureUnit () const |
| Return texture unit to be used for sprites (Graphic3d_TextureUnit_PointSprite by default).
|
|
Standard_Boolean | HasTextureMultisampling () const |
|
Standard_Integer | MaxMsaaSamples () const |
|
Standard_Integer | MaxDumpSizeX () const |
|
Standard_Integer | MaxDumpSizeY () const |
|
Standard_Integer | MaxDrawBuffers () const |
|
Standard_Integer | MaxColorAttachments () const |
|
Standard_Integer | MaxClipPlanes () const |
| Get maximum number of clip planes supported by OpenGl. This value is implementation dependent. At least 6 planes should be supported by OpenGl (see specs).
|
|
Standard_Boolean | HasRayTracing () const |
|
Standard_Boolean | HasRayTracingTextures () const |
|
Standard_Boolean | HasRayTracingAdaptiveSampling () const |
|
Standard_Boolean | HasRayTracingAdaptiveSamplingAtomic () const |
|
bool | HasSRGB () const |
| Returns TRUE if sRGB rendering is supported.
|
|
bool | ToRenderSRGB () const |
| Returns TRUE if sRGB rendering is supported and permitted.
|
|
bool | IsWindowSRGB () const |
| Returns TRUE if window/surface buffer is sRGB-ready.
|
|
void | SetWindowSRGB (bool theIsSRgb) |
| Overrides if window/surface buffer is sRGB-ready or not (initialized with the context).
|
|
bool | IsWindowDeepColor () const |
| Returns TRUE if window/surface buffer has deep color (10bit per component / 30bit RGB) or better precision.
|
|
OpenGl_Vec4 | Vec4FromQuantityColor (const OpenGl_Vec4 &theColor) const |
| Convert Quantity_ColorRGBA into vec4 with conversion or no conversion into non-linear sRGB basing on ToRenderSRGB() flag.
|
|
const OpenGl_Vec4 & | Vec4LinearFromQuantityColor (const OpenGl_Vec4 &theColor) const |
| Convert Quantity_ColorRGBA into vec4. Quantity_Color is expected to be linear RGB, hence conversion is NOT required.
|
|
OpenGl_Vec4 | Vec4sRGBFromQuantityColor (const OpenGl_Vec4 &theColor) const |
| Convert Quantity_ColorRGBA (linear RGB) into non-linear sRGB vec4.
|
|
Standard_Boolean | HasPBR () const |
| Returns TRUE if PBR shading model is supported. Basically, feature requires OpenGL 3.0+ / OpenGL ES 3.0+ hardware; more precisely:
|
|
Graphic3d_TextureUnit | PBREnvLUTTexUnit () const |
| Returns texture unit where Environment Lookup Table is expected to be bound, or 0 if PBR is unavailable.
|
|
Graphic3d_TextureUnit | PBRDiffIBLMapSHTexUnit () const |
| Returns texture unit where Diffuse (irradiance) IBL map's spherical harmonics coefficients is expected to be bound, or 0 if PBR is unavailable.
|
|
Graphic3d_TextureUnit | PBRSpecIBLMapTexUnit () const |
| Returns texture unit where Specular IBL map is expected to be bound, or 0 if PBR is unavailable.
|
|
Graphic3d_TextureUnit | ShadowMapTexUnit () const |
| Returns texture unit where shadow map is expected to be bound, or 0 if unavailable.
|
|
Graphic3d_TextureUnit | DepthPeelingDepthTexUnit () const |
| Returns texture unit for occDepthPeelingDepth within enabled Depth Peeling.
|
|
Graphic3d_TextureUnit | DepthPeelingFrontColorTexUnit () const |
| Returns texture unit for occDepthPeelingFrontColor within enabled Depth Peeling.
|
|
bool | ToUseVbo () const |
| Returns true if VBO is supported and permitted.
|
|
Standard_Boolean | IsGlNormalizeEnabled () const |
|
Standard_Boolean | SetGlNormalizeEnabled (Standard_Boolean isEnabled) |
| Sets GL_NORMALIZE enabled or disabled.
|
|
Standard_Integer | PolygonMode () const |
|
Standard_Integer | SetPolygonMode (const Standard_Integer theMode) |
| Sets polygon rasterization mode (glPolygonMode() function).
|
|
bool | IsPolygonHatchEnabled () const |
|
bool | SetPolygonHatchEnabled (const bool theIsEnabled) |
| Sets enabled state of polygon hatching rasterization without affecting currently selected hatching pattern.
|
|
Standard_Integer | PolygonHatchStyle () const |
|
Standard_Integer | SetPolygonHatchStyle (const Handle< Graphic3d_HatchStyle > &theStyle) |
| Sets polygon hatch pattern. Zero-index value is a default alias for solid filling.
|
|
void | SetPolygonOffset (const Graphic3d_PolygonOffset &theOffset) |
| Sets and applies current polygon offset.
|
|
const Graphic3d_PolygonOffset & | PolygonOffset () const |
| Returns currently applied polygon offset parameters.
|
|
const Handle< Graphic3d_Camera > & | Camera () const |
| Returns camera object.
|
|
void | SetCamera (const Handle< Graphic3d_Camera > &theCamera) |
| Sets camera object to the context and update matrices.
|
|
void | ApplyModelWorldMatrix () |
| Applies matrix into shader manager stored in ModelWorldState to OpenGl. In "model -> world -> view -> projection" it performs: model -> world.
|
|
void | ApplyWorldViewMatrix () |
| Applies matrix stored in WorldViewState to OpenGl. In "model -> world -> view -> projection" it performs: model -> world -> view, where model -> world is identical matrix.
|
|
void | ApplyModelViewMatrix () |
| Applies combination of matrices stored in ModelWorldState and WorldViewState to OpenGl. In "model -> world -> view -> projection" it performs: model -> world -> view.
|
|
void | ApplyProjectionMatrix () |
| Applies matrix stored in ProjectionState to OpenGl. In "model -> world -> view -> projection" it performs: view -> projection.
|
|
const Handle< Message_Messenger > & | Messenger () const |
|
void | PushMessage (const unsigned int theSource, const unsigned int theType, const unsigned int theId, const unsigned int theSeverity, const TCollection_ExtendedString &theMessage) |
| Callback for GL_ARB_debug_output extension.
|
|
Standard_Boolean | ExcludeMessage (const unsigned int theSource, const unsigned int theId) |
| Adds a filter for messages with theId and theSource (GL_DEBUG_SOURCE_)
|
|
Standard_Boolean | IncludeMessage (const unsigned int theSource, const unsigned int theId) |
| Removes a filter for messages with theId and theSource (GL_DEBUG_SOURCE_)
|
|
Standard_Boolean | HasStereoBuffers () const |
|
Public Member Functions inherited from Standard_Transient |
| Standard_Transient () |
| Empty constructor.
|
|
| Standard_Transient (const Standard_Transient &) |
| Copy constructor – does nothing.
|
|
Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter.
|
|
virtual | ~Standard_Transient () |
| Destructor must be virtual.
|
|
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object.
|
|
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type.
|
|
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
| Returns a true value if this is an instance of TypeName.
|
|
Standard_Boolean | IsKind (const opencascade::handle< Standard_Type > &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
|
|
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
|
|
Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
|
|
Standard_Integer | GetRefCount () const noexcept |
| Get the reference counter of this object.
|
|
void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object.
|
|
Standard_Integer | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value.
|
|
virtual void | Delete () const |
| Memory deallocator for transient classes.
|
|
|
|
OpenGl_GlCore11 * | core11ffp |
| OpenGL 1.1 core functionality.
|
|
OpenGl_GlCore11Fwd * | core11fwd |
| OpenGL 1.1 without deprecated entry points.
|
|
OpenGl_GlCore15 * | core15 |
| OpenGL 1.5 without deprecated entry points.
|
|
OpenGl_GlCore20 * | core20 |
| OpenGL 2.0 without deprecated entry points.
|
|
OpenGl_GlCore30 * | core30 |
| OpenGL 3.0 without deprecated entry points.
|
|
OpenGl_GlCore32 * | core32 |
| OpenGL 3.2 core profile.
|
|
OpenGl_GlCore33 * | core33 |
| OpenGL 3.3 core profile.
|
|
OpenGl_GlCore41 * | core41 |
| OpenGL 4.1 core profile.
|
|
OpenGl_GlCore42 * | core42 |
| OpenGL 4.2 core profile.
|
|
OpenGl_GlCore43 * | core43 |
| OpenGL 4.3 core profile.
|
|
OpenGl_GlCore44 * | core44 |
| OpenGL 4.4 core profile.
|
|
OpenGl_GlCore45 * | core45 |
| OpenGL 4.5 core profile.
|
|
OpenGl_GlCore46 * | core46 |
| OpenGL 4.6 core profile.
|
|
OpenGl_GlCore15 * | core15fwd |
| obsolete entry left for code portability; core15 should be used instead
|
|
OpenGl_GlCore20 * | core20fwd |
| obsolete entry left for code portability; core20 should be used instead
|
|
Handle< OpenGl_Caps > | caps |
| context options
|
|
|
Standard_Boolean | hasGetBufferData |
| flag indicating if GetBufferSubData() is supported
|
|
Standard_Boolean | hasPackRowLength |
| supporting of GL_PACK_ROW_LENGTH parameters (any desktop OpenGL; OpenGL ES 3.0)
|
|
Standard_Boolean | hasUnpackRowLength |
| supporting of GL_UNPACK_ROW_LENGTH parameters (any desktop OpenGL; OpenGL ES 3.0)
|
|
Standard_Boolean | hasHighp |
| highp in GLSL ES fragment shader is supported
|
|
Standard_Boolean | hasUintIndex |
| GLuint for index buffer is supported (always available on desktop; on OpenGL ES - since 3.0 or as extension GL_OES_element_index_uint)
|
|
Standard_Boolean | hasTexRGBA8 |
| always available on desktop; on OpenGL ES - since 3.0 or as extension GL_OES_rgb8_rgba8
|
|
Standard_Boolean | hasTexFloatLinear |
| texture-filterable state for 32-bit floating texture formats (always on desktop, GL_OES_texture_float_linear within OpenGL ES)
|
|
Standard_Boolean | hasTexSRGB |
| sRGB texture formats (desktop OpenGL 2.1, OpenGL ES 3.0 or OpenGL ES 2.0 + GL_EXT_sRGB)
|
|
Standard_Boolean | hasFboSRGB |
| sRGB FBO render targets (desktop OpenGL 2.1, OpenGL ES 3.0)
|
|
Standard_Boolean | hasSRGBControl |
| sRGB write control (any desktop OpenGL, OpenGL ES + GL_EXT_sRGB_write_control extension)
|
|
Standard_Boolean | hasFboRenderMipmap |
| FBO render target could be non-zero mipmap level of texture.
|
|
OpenGl_FeatureFlag | hasFlatShading |
| Complex flag indicating support of Flat shading (Graphic3d_TypeOfShadingModel_Phong) (always available on desktop; on OpenGL ES - since 3.0 or as extension GL_OES_standard_derivatives)
|
|
OpenGl_FeatureFlag | hasGlslBitwiseOps |
| GLSL supports bitwise operations; OpenGL 3.0 / OpenGL ES 3.0 (GLSL 130 / GLSL ES 300) or OpenGL 2.1 + GL_EXT_gpu_shader4.
|
|
OpenGl_FeatureFlag | hasDrawBuffers |
| Complex flag indicating support of multiple draw buffers (desktop OpenGL 2.0, OpenGL ES 3.0, GL_ARB_draw_buffers, GL_EXT_draw_buffers)
|
|
OpenGl_FeatureFlag | hasFloatBuffer |
| Complex flag indicating support of float color buffer format (desktop OpenGL 3.0, GL_ARB_color_buffer_float, GL_EXT_color_buffer_float)
|
|
OpenGl_FeatureFlag | hasHalfFloatBuffer |
| Complex flag indicating support of half-float color buffer format (desktop OpenGL 3.0, GL_ARB_color_buffer_float, GL_EXT_color_buffer_half_float)
|
|
OpenGl_FeatureFlag | hasSampleVariables |
| Complex flag indicating support of MSAA variables in GLSL shader (desktop OpenGL 4.0, GL_ARB_sample_shading)
|
|
OpenGl_FeatureFlag | hasGeometryStage |
| Complex flag indicating support of Geometry shader (desktop OpenGL 3.2, OpenGL ES 3.2, GL_EXT_geometry_shader)
|
|
Standard_Boolean | arbDrawBuffers |
| GL_ARB_draw_buffers.
|
|
Standard_Boolean | arbNPTW |
| GL_ARB_texture_non_power_of_two.
|
|
Standard_Boolean | arbTexRG |
| GL_ARB_texture_rg.
|
|
Standard_Boolean | arbTexFloat |
| GL_ARB_texture_float (on desktop OpenGL - since 3.0 or as extension GL_ARB_texture_float; on OpenGL ES - since 3.0);.
|
|
OpenGl_ArbSamplerObject * | arbSamplerObject |
| GL_ARB_sampler_objects (on desktop OpenGL - since 3.3 or as extension GL_ARB_sampler_objects; on OpenGL ES - since 3.0)
|
|
OpenGl_ArbTexBindless * | arbTexBindless |
| GL_ARB_bindless_texture.
|
|
OpenGl_ArbTBO * | arbTBO |
| GL_ARB_texture_buffer_object (on desktop OpenGL - since 3.1 or as extension GL_ARB_texture_buffer_object; on OpenGL ES - since 3.2)
|
|
Standard_Boolean | arbTboRGB32 |
| GL_ARB_texture_buffer_object_rgb32 (3-component TBO), in core since 4.0 (on OpenGL ES - since 3.2)
|
|
Standard_Boolean | arbClipControl |
| GL_ARB_clip_control, in core since 4.5.
|
|
OpenGl_ArbIns * | arbIns |
| GL_ARB_draw_instanced (on desktop OpenGL - since 3.1 or as extension GL_ARB_draw_instanced; on OpenGL ES - since 3.0 or as extension GL_ANGLE_instanced_arrays to WebGL 1.0)
|
|
OpenGl_ArbDbg * | arbDbg |
| GL_ARB_debug_output (on desktop OpenGL - since 4.3 or as extension GL_ARB_debug_output; on OpenGL ES - since 3.2 or as extension GL_KHR_debug)
|
|
OpenGl_ArbFBO * | arbFBO |
| GL_ARB_framebuffer_object.
|
|
OpenGl_ArbFBOBlit * | arbFBOBlit |
| glBlitFramebuffer function, moved out from OpenGl_ArbFBO structure for compatibility with OpenGL ES 2.0
|
|
Standard_Boolean | arbSampleShading |
| GL_ARB_sample_shading.
|
|
Standard_Boolean | arbDepthClamp |
| GL_ARB_depth_clamp (on desktop OpenGL - since 3.2 or as extensions GL_ARB_depth_clamp,NV_depth_clamp; unavailable on OpenGL ES)
|
|
Standard_Boolean | extFragDepth |
| GL_EXT_frag_depth on OpenGL ES 2.0 (gl_FragDepthEXT built-in variable, before OpenGL ES 3.0)
|
|
Standard_Boolean | extDrawBuffers |
| GL_EXT_draw_buffers.
|
|
OpenGl_ExtGS * | extGS |
| GL_EXT_geometry_shader4.
|
|
Standard_Boolean | extBgra |
| GL_EXT_bgra or GL_EXT_texture_format_BGRA8888 on OpenGL ES.
|
|
Standard_Boolean | extTexR16 |
| GL_EXT_texture_norm16 on OpenGL ES; always available on desktop.
|
|
Standard_Boolean | extAnis |
| GL_EXT_texture_filter_anisotropic.
|
|
Standard_Boolean | extPDS |
| GL_EXT_packed_depth_stencil.
|
|
Standard_Boolean | atiMem |
| GL_ATI_meminfo.
|
|
Standard_Boolean | nvxMem |
| GL_NVX_gpu_memory_info.
|
|
Standard_Boolean | oesSampleVariables |
| GL_OES_sample_variables.
|
|
Standard_Boolean | oesStdDerivatives |
| GL_OES_standard_derivatives.
|
|
|
static Standard_Boolean | CheckIsTransparent (const OpenGl_Aspects *theAspect, const Handle< Graphic3d_PresentationAttributes > &theHighlight, Standard_ShortReal &theAlphaFront, Standard_ShortReal &theAlphaBack) |
| Checks if transparency is required for the given aspect and highlight style.
|
|
static Standard_Boolean | CheckIsTransparent (const OpenGl_Aspects *theAspect, const Handle< Graphic3d_PresentationAttributes > &theHighlight) |
| Checks if transparency is required for the given aspect and highlight style.
|
|
const Handle< OpenGl_FrameStats > & | FrameStats () const |
| Return structure holding frame statistics.
|
|
void | SetFrameStats (const Handle< OpenGl_FrameStats > &theStats) |
| Set structure holding frame statistics. This call makes sense only if application defines OpenGl_FrameStats sub-class.
|
|
const Standard_Integer * | Viewport () const |
| Return cached viewport definition (x, y, width, height).
|
|
void | ResizeViewport (const Standard_Integer theRect[4]) |
| Resize the viewport (alias for glViewport).
|
|
const Standard_Integer * | VirtualViewport () const |
| Return virtual viewport definition (x, y, width, height).
|
|
Standard_Integer | ReadBuffer () |
| Return active read buffer.
|
|
void | SetReadBuffer (const Standard_Integer theReadBuffer) |
| Switch read buffer, wrapper for ::glReadBuffer().
|
|
Standard_Integer | DrawBuffer (Standard_Integer theIndex=0) const |
| Return active draw buffer attached to a render target referred by index (layout location).
|
|
void | SetDrawBuffer (const Standard_Integer theDrawBuffer) |
| Switch draw buffer, wrapper for ::glDrawBuffer().
|
|
void | SetDrawBuffers (const Standard_Integer theNb, const Standard_Integer *theDrawBuffers) |
| Switch draw buffer, wrapper for ::glDrawBuffers (GLsizei, const GLenum*).
|
|
void | SetReadDrawBuffer (const Standard_Integer theBuffer) |
| Switch read/draw buffers.
|
|
bool | IsFrameBufferSRGB () const |
| Returns cached GL_FRAMEBUFFER_SRGB state. If TRUE, GLSL program is expected to write linear RGB color. Otherwise, GLSL program might need manually converting result color into sRGB color space.
|
|
void | SetFrameBufferSRGB (bool theIsFbo, bool theIsFboSRgb=true) |
| Enables/disables GL_FRAMEBUFFER_SRGB flag. This flag can be set to:
|
|
const NCollection_Vec4< bool > & | ColorMaskRGBA () const |
| Return cached flag indicating writing into color buffer is enabled or disabled (glColorMask).
|
|
void | SetColorMaskRGBA (const NCollection_Vec4< bool > &theToWriteColor) |
| Enable/disable writing into color buffer (wrapper for glColorMask).
|
|
bool | ColorMask () const |
| Return cached flag indicating writing into color buffer is enabled or disabled (glColorMask).
|
|
bool | SetColorMask (bool theToWriteColor) |
| Enable/disable writing into color buffer (wrapper for glColorMask). Alpha component writes will be disabled unconditionally in case of caps->buffersOpaqueAlpha.
|
|
bool | AllowSampleAlphaToCoverage () const |
| Return TRUE if GL_SAMPLE_ALPHA_TO_COVERAGE usage is allowed.
|
|
void | SetAllowSampleAlphaToCoverage (bool theToEnable) |
| Allow GL_SAMPLE_ALPHA_TO_COVERAGE usage.
|
|
bool | SampleAlphaToCoverage () const |
| Return GL_SAMPLE_ALPHA_TO_COVERAGE state.
|
|
bool | SetSampleAlphaToCoverage (bool theToEnable) |
| Enable/disable GL_SAMPLE_ALPHA_TO_COVERAGE.
|
|
Graphic3d_TypeOfBackfacingModel | FaceCulling () const |
| Return back face culling state.
|
|
void | SetFaceCulling (Graphic3d_TypeOfBackfacingModel theMode) |
| Enable or disable back face culling (glEnable (GL_CULL_FACE)).
|
|
bool | ToCullBackFaces () const |
| Return back face culling state.
|
|
void | SetCullBackFaces (bool theToEnable) |
| Enable or disable back face culling (glCullFace() + glEnable(GL_CULL_FACE)).
|
|
void | FetchState () |
| Fetch OpenGl context state. This class tracks value of several OpenGl state variables. Consulting the cached values is quicker than doing the same via OpenGl API. Call this method if any of the controlled OpenGl state variables has a possibility of being out-of-date.
|
|
const Handle< OpenGl_TextureSet > & | ActiveTextures () const |
|
Handle< OpenGl_TextureSet > | BindTextures (const Handle< OpenGl_TextureSet > &theTextures) |
| Bind specified texture set to current context taking into account active GLSL program.
|
|
Handle< OpenGl_TextureSet > | BindTextures (const Handle< OpenGl_TextureSet > &theTextures, const Handle< OpenGl_ShaderProgram > &theProgram) |
| Bind specified texture set to current context, or unbind previous one when NULL specified.
|
|
const Handle< OpenGl_ShaderProgram > & | ActiveProgram () const |
|
Standard_Boolean | BindProgram (const Handle< OpenGl_ShaderProgram > &theProgram) |
| Bind specified program to current context, or unbind previous one when NULL specified.
|
|
void | SetShadingMaterial (const OpenGl_Aspects *theAspect, const Handle< Graphic3d_PresentationAttributes > &theHighlight) |
| Setup current shading material.
|
|
void | SetColor4fv (const OpenGl_Vec4 &theColor) |
| Setup current color.
|
|
void | SetTypeOfLine (const Aspect_TypeOfLine theType, const Standard_ShortReal theFactor=1.0f) |
| Setup type of line.
|
|
void | SetLineStipple (const uint16_t thePattern) |
| Setup stipple line pattern with 1.0f factor; wrapper for glLineStipple().
|
|
void | SetLineStipple (const Standard_ShortReal theFactor, const uint16_t thePattern) |
| Setup type of line; wrapper for glLineStipple().
|
|
void | SetLineWidth (const Standard_ShortReal theWidth) |
| Setup width of line.
|
|
void | SetPointSize (const Standard_ShortReal theSize) |
| Setup point size.
|
|
void | SetPointSpriteOrigin () |
| Setup point sprite origin using GL_POINT_SPRITE_COORD_ORIGIN state:
|
|
void | SetTextureMatrix (const Handle< Graphic3d_TextureParams > &theParams, const Standard_Boolean theIsTopDown) |
| Setup texture matrix to active GLSL program or to FFP global state using glMatrixMode (GL_TEXTURE).
|
|
void | BindDefaultVao () |
| Bind default Vertex Array Object.
|
|
const Handle< OpenGl_FrameBuffer > & | DefaultFrameBuffer () const |
| Default Frame Buffer Object.
|
|
Handle< OpenGl_FrameBuffer > | SetDefaultFrameBuffer (const Handle< OpenGl_FrameBuffer > &theFbo) |
| Setup new Default Frame Buffer Object and return previously set. This call doesn't change Active FBO!
|
|
Standard_Boolean | IsDebugContext () const |
| Return debug context initialization state.
|
|
void | EnableFeatures () const |
| Checks if transparency is required for the given aspect and highlight style.
|
|
void | DisableFeatures () const |
| Checks if transparency is required for the given aspect and highlight style.
|
|
unsigned int | Resolution () const |
| Return resolution for rendering text.
|
|
Standard_ShortReal | ResolutionRatio () const |
| Resolution scale factor (rendered resolution to standard resolution). This scaling factor for parameters like text size to be properly displayed on device (screen / printer).
|
|
Standard_ShortReal | RenderScale () const |
| Rendering scale factor (rendering viewport height to real window buffer height).
|
|
Standard_Boolean | HasRenderScale () const |
| Return TRUE if rendering scale factor is not 1.
|
|
Standard_ShortReal | RenderScaleInv () const |
| Rendering scale factor (inverted value).
|
|
Standard_ShortReal | LineWidthScale () const |
| Return scale factor for line width.
|
|
void | SetResolution (unsigned int theResolution, Standard_ShortReal theRatio, Standard_ShortReal theScale) |
| Set resolution ratio. Note that this method rounds @theRatio to nearest integer.
|
|
void | SetResolutionRatio (const Standard_ShortReal theRatio) |
| Set resolution ratio. Note that this method rounds @theRatio to nearest integer.
|
|
Standard_ShortReal | LineFeather () const |
| Return line feater width in pixels.
|
|
void | SetLineFeather (Standard_ShortReal theValue) |
| Set line feater width.
|
|
bool | GetBufferSubData (unsigned int theTarget, intptr_t theOffset, intptr_t theSize, void *theData) |
| Wrapper over glGetBufferSubData(), implemented as:
|
|
const TCollection_AsciiString & | Vendor () const |
| Return Graphics Driver's vendor.
|
|
void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const |
| Dumps the content of me into the stream.
|
|
void | DumpJsonOpenGlState (Standard_OStream &theOStream, Standard_Integer theDepth=-1) |
| Dumps the content of openGL state into the stream.
|
|
void | SetShadeModel (Graphic3d_TypeOfShadingModel theModel) |
| Set GL_SHADE_MODEL value.
|
|
This class generalize access to the GL context and available extensions.
Functions related to specific OpenGL version or extension are grouped into structures which can be accessed as fields of this class. The most simple way to check that required functionality is available - is NULL check for the group:
if (myContext->core20 != NULL)
{
myGlProgram = myContext->core20->glCreateProgram();
.. do more stuff ..
}
else
{
.. compatibility with outdated configurations ..
}
Current implementation provide access to OpenGL core functionality up to 4.6 version (core12, core13, core14, etc.) as well as several extensions (arbTBO, arbFBO, etc.).
OpenGL context might be initialized in Core Profile. In this case deprecated functionality become unavailable. To select which core** function set should be used in specific case:
- Determine the minimal OpenGL version required for implemented functionality and use it to access all functions. For example, if algorithm requires OpenGL 2.1+, it is better to write core20fwd->glEnable() rather than core11fwd->glEnable() for uniformity.
- Validate minimal requirements at initialization/creation time and omit checks within code where algorithm should be already initialized. Properly escape code incompatible with Core Profile. The simplest way to check Core Profile is "if (core11ffp == NULL)".
Simplified extensions classification:
- prefixed with NV, AMD, ATI are vendor-specific (however may be provided by other vendors in some cases);
- prefixed with EXT are accepted by 2+ vendors;
- prefixed with ARB are accepted by Architecture Review Board and are candidates for inclusion into GL core functionality. Some functionality can be represented in several extensions simultaneously. In this case developer should be careful because different specification may differ in aspects (like enumeration values and error-handling).
Notice that some systems provide mechanisms to simultaneously incorporate with GL contexts with different capabilities. For this reason OpenGl_Context should be initialized and used for each GL context independently.
Matrices of OpenGl transformations: model -> world -> view -> projection These matrices might be changed for local transformation, transform persistent using direct access to current matrix of ModelWorldState, WorldViewState and ProjectionState After, these matrices should be applied using ApplyModelWorldMatrix, ApplyWorldViewMatrix, ApplyModelViewMatrix or ApplyProjectionMatrix.