CVD::GLWindow Class Reference

#include <glwindow.h>

List of all members.


Detailed Description

An object that creates a window and a GL context attached to that window, and manages its events.

Definition at line 39 of file glwindow.h.


Public Types

enum  MouseButton {
  BUTTON_LEFT = 1, BUTTON_MIDDLE = 2, BUTTON_RIGHT = 4, BUTTON_MOD_CTRL = 8,
  BUTTON_MOD_SHIFT = 0x10, BUTTON_WHEEL_UP = 0x20, BUTTON_WHEEL_DOWN = 0x40
}
enum  EventType { EVENT_CLOSE, EVENT_EXPOSE }

Public Member Functions

 GLWindow (const ImageRef &size, int bpp=24, const std::string &title="GLWindow")
 GLWindow (const ImageRef &size, const std::string &title, int bpp=24)
ImageRef size () const
void set_size (const ImageRef &)
ImageRef position () const
void set_position (const ImageRef &)
void set_cursor_position (const ImageRef &where)
ImageRef cursor_position () const
void show_cursor (bool show=true)
void hide_cursor ()
std::string title () const
void set_title (const std::string &title)
void swap_buffers ()
void handle_events (EventHandler &handler)
void get_events (std::vector< Event > &events)
void get_events (EventSummary &summary)
bool has_events () const
void activate ()
void make_current ()

Classes

struct  Event
class  EventHandler
 Abstract base class for event handlers. Subclass this and override to implement a handler. More...
struct  EventSummary
 A summary of multiple events. More...

Member Enumeration Documentation

enum CVD::GLWindow::MouseButton

Symbols for mouse buttons and modifiers.

Enumerator:
BUTTON_LEFT 
BUTTON_MIDDLE 
BUTTON_RIGHT 
BUTTON_MOD_CTRL 
BUTTON_MOD_SHIFT 
BUTTON_WHEEL_UP 
BUTTON_WHEEL_DOWN 

Definition at line 42 of file glwindow.h.

enum CVD::GLWindow::EventType

Symbols for window events.

Enumerator:
EVENT_CLOSE 
EVENT_EXPOSE 

Definition at line 44 of file glwindow.h.


Constructor & Destructor Documentation

CVD::GLWindow::GLWindow ( const ImageRef size,
int  bpp = 24,
const std::string &  title = "GLWindow" 
) [inline]

Construct a GLWindow of the given size and colour depth, with the given title.

A double-buffered GL context is associated with the window.

Definition at line 96 of file glwindow.h.

References title().


Member Function Documentation

ImageRef CVD::GLWindow::size (  )  const

Get the size.

void CVD::GLWindow::set_size ( const ImageRef  ) 

Set the size.

ImageRef CVD::GLWindow::position (  )  const

Get the position.

void CVD::GLWindow::set_position ( const ImageRef  ) 

Set the position.

void CVD::GLWindow::set_cursor_position ( const ImageRef where  ) 

Set the mouse cursor position.

ImageRef CVD::GLWindow::cursor_position (  )  const

Get the mouse cursor position.

void CVD::GLWindow::show_cursor ( bool  show = true  ) 

Show (or hide) the cursor.

Referenced by hide_cursor().

void CVD::GLWindow::hide_cursor (  )  [inline]

Hide the cursor.

Definition at line 119 of file glwindow.h.

References show_cursor().

std::string CVD::GLWindow::title (  )  const

Get the title.

Referenced by GLWindow().

void CVD::GLWindow::set_title ( const std::string &  title  ) 

Set the title.

void CVD::GLWindow::swap_buffers (  ) 

Swap the front and back buffers.

void CVD::GLWindow::handle_events ( EventHandler handler  ) 

Handle events in the event queue by calling back to the specified handler.

void CVD::GLWindow::get_events ( std::vector< Event > &  events  ) 

Store all events in the event queue into Event objects.

void CVD::GLWindow::get_events ( EventSummary summary  ) 

Make a summary of the events in the queue.

bool CVD::GLWindow::has_events (  )  const

Returns:
true if events are pending

void CVD::GLWindow::activate (  ) 

Make this GL context active.

Referenced by make_current().

void CVD::GLWindow::make_current (  )  [inline]

Make this GL context active.

Definition at line 137 of file glwindow.h.

References activate().


The documentation for this class was generated from the following file:
Generated on Wed Feb 18 10:23:06 2009 for CVD by  doxygen 1.5.3