Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

GLRC Class Reference
[UtilsGLUtilsGL]

OpenGL context handling
Attention:
Include windows.h before using this file! Usage:
  GLRC glrc;
  // inside window creation
  glrc.Create(wnd);
  // before rendering into window
  glrc.MakeCurrent();
  // ... 
  // display in the screen (in case of double buffering)
  glrc.SwapBuffers();
  // ..
  // delete gl context (may be avoided, because called in destructor anyway)
  glrc.Destroy();
.
More...

#include <gmlglrc.h>

List of all members.

Public Member Functions

Class Construction/Destruction
 GLRC (HWND wnd)
 Constructor from Window Handle (HWND).

 GLRC (HDC hdc)
 Constructor form Device Context Handle(HDC).

void Destroy ()
 Destory GL context (also called in destructor).

virtual ~GLRC ()
Context members
virtual bool Create ()
 Member, needed to create context. Call this before use of OpenGL.

bool IsCurrent () const
 Member, that return true if opengl is ready to draw.

bool MakeCurrent ()
 Prepare current context for use.

void SwapBuffers ()
 Call this insted of opengl's swap buffer, at the end of the drawing.


Protected Attributes

bool m_created
 true inside Create() / Destory() pair

HWND m_wnd
 Window handle.

HDC m_dc
 Device Context handle.

HGLRC m_glrc
 OpenGL Context handle.


Detailed Description

OpenGL context handling
Attention:
Include windows.h before using this file! Usage:
  GLRC glrc;
  // inside window creation
  glrc.Create(wnd);
  // before rendering into window
  glrc.MakeCurrent();
  // ... 
  // display in the screen (in case of double buffering)
  glrc.SwapBuffers();
  // ..
  // delete gl context (may be avoided, because called in destructor anyway)
  glrc.Destroy();
.

Todo:
Add possibility to select pixel format (double/single buffer, stencil, etc)


Constructor & Destructor Documentation

virtual ~GLRC  )  [virtual]
 

Virtual Destructor


The documentation for this class was generated from the following file:
Generated on Tue Jan 13 21:12:08 2004 for Graphics and Media Lab CSL by doxygen 1.3.4