Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes
OpenGl_Window Class Reference

This class represents low-level wrapper over window with GL context. The window itself should be provided to constructor.

#include <OpenGl_Window.hxx>

Inheritance diagram for OpenGl_Window:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_Window (const Handle< OpenGl_Display > &theDisplay, const CALL_DEF_WINDOW &theCWindow, Aspect_RenderingContext theGContext, const Handle< OpenGl_Context > &theShareCtx)
 Main constructor - prepare GL context for specified window.
virtual ~OpenGl_Window ()
 Destructor.
void Resize (const CALL_DEF_WINDOW &theCWindow)
 Resizes the window.
void ReadDepths (const Standard_Integer theX, const Standard_Integer theY, const Standard_Integer theWidth, const Standard_Integer theHeight, float *theDepths)
 Reads depth component for current scene into specified buffer.
void SetBackgroundColor (const Standard_ShortReal theR, const Standard_ShortReal theG, const Standard_ShortReal theB)
void EnablePolygonOffset () const
void DisablePolygonOffset () const
Standard_Integer Width () const
Standard_Integer Height () const
const TEL_COLOURBackgroundColor () const
Standard_Boolean Dither () const
Standard_Boolean BackDither () const
const Handle< OpenGl_Display > & GetDisplay () const
const Handle< OpenGl_Context > & GetGlContext () const
GLCONTEXT GetGContext () const
 This method will be removed in future version!

Protected Member Functions

void Init ()
 Activates GL context and setup viewport.
virtual Standard_Boolean Activate ()
 Makes GL context for this window active in current thread.
void EnableFeatures () const
void DisableFeatures () const
void MakeFrontBufCurrent () const
 Draw directly to the FRONT buffer. Can cause artifacts on the screen.
void MakeBackBufCurrent () const
 Draw to BACK buffer. Normal and default state.
void MakeFrontAndBackBufCurrent () const
 Draw simultaneously to BACK and FRONT buffers. Abnormal usage.

Protected Attributes

Handle< OpenGl_DisplaymyDisplay
Handle< OpenGl_ContextmyGlContext
Standard_Boolean myOwnGContext
 set to TRUE if GL context was not created by this class
Standard_Integer myWidth
Standard_Integer myHeight
TEL_COLOUR myBgColor
Standard_Boolean myDither
Standard_Boolean myBackDither

Constructor & Destructor Documentation

OpenGl_Window::OpenGl_Window ( const Handle< OpenGl_Display > &  theDisplay,
const CALL_DEF_WINDOW theCWindow,
Aspect_RenderingContext  theGContext,
const Handle< OpenGl_Context > &  theShareCtx 
)
virtual OpenGl_Window::~OpenGl_Window ( ) [virtual]

Member Function Documentation

virtual Standard_Boolean OpenGl_Window::Activate ( ) [protected, virtual]

Reimplemented in OpenGl_Workspace.

void OpenGl_Window::DisableFeatures ( ) const [protected]
void OpenGl_Window::EnableFeatures ( ) const [protected]
void OpenGl_Window::Init ( ) [protected]
void OpenGl_Window::MakeBackBufCurrent ( ) const [protected]
void OpenGl_Window::ReadDepths ( const Standard_Integer  theX,
const Standard_Integer  theY,
const Standard_Integer  theWidth,
const Standard_Integer  theHeight,
float *  theDepths 
)

Field Documentation


The documentation for this class was generated from the following file: