CVD 0.8
Classes | Public Types | Public Member Functions
CVD::GLWindow Class Reference

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

#include <glwindow.h>

List of all members.

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...

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", const std::string &display="")
 GLWindow (const ImageRef &size, const std::string &title, int bpp=24, const std::string &display="")
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 ()

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.


Constructor & Destructor Documentation

CVD::GLWindow::GLWindow ( const ImageRef size,
int  bpp = 24,
const std::string &  title = "GLWindow",
const std::string &  display = "" 
) [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.

Parameters:
sizeWindow size
bppColour depth
titleWindow title
displayX11 display string, passed to XOpenDisplay. "" Is used to indicate NULL. This is ignored for non X11 platforms.

Definition at line 100 of file glwindow.h.

References title().

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 104 of file glwindow.h.


Member Function Documentation

bool CVD::GLWindow::has_events ( ) const
Returns:
true if events are pending

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