Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvui::GLWinRenderArea Class Reference

OpenGL render area. More...

#include <GLWinRenderArea.h>

Inheritance diagram for nvui::GLWinRenderArea:

Inheritance graph
[legend]
Collaboration diagram for nvui::GLWinRenderArea:

Collaboration graph
[legend]
List of all members.

Public Methods

NVSG_API GLWinRenderArea (void)
 Default constructor. More...

virtual NVSG_API ~GLWinRenderArea (void)
 Default destructor. More...

virtual NVSG_API bool attachWindow (HWND hWnd)
 Attach a window to the render area. More...

virtual NVSG_API bool init (RenderArea *shareArea=NULL)
 Create the render area. More...

virtual NVSG_API void destroy (void)
 Destroy the render area. More...

NVSG_API void makeCurrent (void)
 Make OpenGL context current. More...

virtual NVSG_API void mouseButtonDown (UINT flags, int x, int y)
 Handle mouse button down. More...

virtual NVSG_API void mouseButtonUp (UINT flags, int x, int y)
 Handle mouse button up. More...

virtual NVSG_API void mouseMotion (int x, int y)
 Handle mouse motion. More...

virtual NVSG_API void setViewportSize (size_t x, size_t y)
 Handle the viewport resizing. More...

NVSG_API bool shareLists (GLWinRenderArea *ra)
 Share the OpenGL lists. More...

virtual NVSG_API void renderScene (void)
 Trigger a redraw of the scene. More...

virtual NVSG_API void triggerRedraw (void)

Protected Methods

virtual NVSG_API bool initGL (void)
 Initialize additional OpenGL features. More...

NVSG_API UINT determinePixelFormat (void)
 Get the Pixelformat index. More...


Protected Attributes

HGLRC m_hglrc
 Our OpenGL context. More...

HDC m_hdc
 Our device context. More...


Detailed Description

OpenGL render area.

This class is responsible for MS Windows specific OpenGL functionality. It sets up and destroys the OpenGL context, handles the creation, pixelformat, refresh, mouse input, etc.


Constructor & Destructor Documentation

NVSG_API nvui::GLWinRenderArea::GLWinRenderArea void   
 

Default constructor.

virtual NVSG_API nvui::GLWinRenderArea::~GLWinRenderArea void    [virtual]
 

Default destructor.


Member Function Documentation

virtual NVSG_API bool nvui::GLWinRenderArea::attachWindow HWND    hWnd [virtual]
 

Attach a window to the render area.

You have to create an OpenGL capable window and attach it before calling init(), or you can derive from this class to integrate the functionality.

Parameters:
hWnd  The window handle of an existing window

virtual NVSG_API bool nvui::GLWinRenderArea::init RenderArea   shareArea = NULL [virtual]
 

Create the render area.

This method creates and initializes the render area.

Returns:
true - everything went fine
Note:
Create and attach a valid Window before calling this function.
Parameters:
shareArea  Pointer to a render area with which to share display lists, textures, vertex programs, etc.

Reimplemented from nvui::RenderArea.

virtual NVSG_API void nvui::GLWinRenderArea::destroy void    [virtual]
 

Destroy the render area.

This method destroys and cleans up the render area.

Reimplemented from nvui::RenderArea.

NVSG_API void nvui::GLWinRenderArea::makeCurrent void   
 

Make OpenGL context current.

This is a more clever way to make the context current. This method minimizes wglMakeCurrent calls.

Note:
Use only this method instead of wglMakeCurrent so we save time.

virtual NVSG_API void nvui::GLWinRenderArea::mouseButtonDown UINT    flags,
int    x,
int    y
[virtual]
 

Handle mouse button down.

React on mouse button down events (for example, report it to the current camera manipulator).

Parameters:
flags  Concatenation of pressed buttons (Windows: MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
x  Current x position of the mouse
y  Current y position of the mouse

Reimplemented from nvui::RenderArea.

virtual NVSG_API void nvui::GLWinRenderArea::mouseButtonUp UINT    flags,
int    x,
int    y
[virtual]
 

Handle mouse button up.

React on mouse button up events (for example, report it to the current camera manipulator.

Parameters:
flags  Concatenation of released buttons (Windows: MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
x  Current x position of the mouse
y  Current y position of the mouse

Reimplemented from nvui::RenderArea.

virtual NVSG_API void nvui::GLWinRenderArea::mouseMotion int    x,
int    y
[virtual]
 

Handle mouse motion.

React on mouse motion events (for example, report it to the current camera manipulator.

Parameters:
x  Current x position of the mouse
y  Current y position of the mouse

Reimplemented from nvui::RenderArea.

virtual NVSG_API void nvui::GLWinRenderArea::setViewportSize size_t    x,
size_t    y
[virtual]
 

Handle the viewport resizing.

Resize the viewport. React on parent window size changes. Report to OpenGL, to the render window, or to the camera manipulator.

Parameters:
x  Width of the viewport
y  Height of the viewport

Reimplemented from nvui::RenderArea.

NVSG_API bool nvui::GLWinRenderArea::shareLists GLWinRenderArea *    ra
 

Share the OpenGL lists.

Share display lists, textures, vertex programs, etc. with another rendering context.

Returns:
true - everything went fine

virtual NVSG_API void nvui::GLWinRenderArea::renderScene void    [virtual]
 

Trigger a redraw of the scene.

Do the rendering of the entire scene. (app, cull, draw the whole tree) If you want to trigger this method, use TriggerRedraw() to force a redraw of the scene.

Reimplemented from nvui::RenderArea.

virtual NVSG_API void nvui::GLWinRenderArea::triggerRedraw void    [virtual]
 

Note:
Use this method to trigger a redraw instead of calling the drawing method directly!

Reimplemented from nvui::RenderArea.

virtual NVSG_API bool nvui::GLWinRenderArea::initGL void    [protected, virtual]
 

Initialize additional OpenGL features.

This is a handy method that is called from create. Deriving from this class simplifies the initialization of special features like HW swap locking, etc.

Returns:
true - everything went fine

NVSG_API UINT nvui::GLWinRenderArea::determinePixelFormat void    [protected]
 

Get the Pixelformat index.

Determine the OpenGL pixelformat index with respect to the requested features, such as stereo, multisample, etc..

Returns:
Pixel format index. Error: 0


Member Data Documentation

HGLRC nvui::GLWinRenderArea::m_hglrc [protected]
 

Our OpenGL context.

HDC nvui::GLWinRenderArea::m_hdc [protected]
 

Our device context.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:43 2005 for NVSGSDK by NVIDIA