Simple Graphics Library  0.9.5
SGL API
Public Member Functions | List of all members
sgl::OGLWindow Class Reference

#include <sgl.h>

Inheritance diagram for sgl::OGLWindow:
Inheritance graph
[legend]
Collaboration diagram for sgl::OGLWindow:
Collaboration graph
[legend]

Public Member Functions

 OGLWindow (const std::string &title, int left, int top, int width, int height)
 
 OGLWindow (const std::string &title)
 
 ~OGLWindow ()
 
void prepaint () override
 
void postpaint () override
 
- Public Member Functions inherited from sgl::Window
 Window (const std::string &title, int left, int top, int width, int height, double min_x, double max_x, double min_y, double max_y)
 
 Window (const std::string &title, int width, int height)
 
 Window (const std::string &title, double min_x, double max_x, double min_y, double max_y)
 
 Window ()
 
virtual ~Window ()
 
virtual void clear ()
 
virtual void set_title (const std::string &str)
 
virtual void set_background_color (const Color &color)
 
virtual void set_position (int x, int y)
 
virtual void set_size (int width, int height)
 
virtual void set_viewport (double left, double right, double bottom, double top)
 
virtual void set_visible (bool visible)
 
virtual CursorShape set_cursor (CursorShape cursor)
 
virtual CursorShape get_cursor ()
 
virtual void run ()
 
virtual void repaint ()
 
virtual void paint ()=0
 
virtual void paint_all ()
 
virtual int get_x () const
 
virtual int get_y () const
 
virtual int get_width () const
 
virtual int get_height () const
 
virtual void set_window_size (int w, int h)
 
virtual void resized (int w, int h)
 
virtual double get_min_x () const
 
virtual double get_max_x () const
 
virtual double get_min_y () const
 
virtual double get_max_y () const
 
virtual void draw_axes (double x_inc, double y_inc) const
 
virtual void mouse_pressed (double x, double y, MouseButton button)
 
virtual void mouse_released (double x, double y, MouseButton button)
 
virtual void mouse_moved (double x, double y)
 
virtual void mouse_dragged (double x, double y)
 
virtual void mouse_entered ()
 
virtual void mouse_exited ()
 
virtual void key_pressed (int k, double x, double y)
 
KeyModifier get_key_modifiers () const
 
void set_key_modifiers (KeyModifier mod)
 
virtual void start_timer (int msec)
 
virtual void timer_expired ()
 

Additional Inherited Members

- Protected Member Functions inherited from sgl::Window
void initialize (const std::string &title, int left, int top, int width, int height, double min_x, double max_x, double min_y, double max_y)
 
- Protected Attributes inherited from sgl::Window
double min_x
 
double max_x
 
double min_y
 
double max_y
 
CursorShape normal_cursor
 
KeyModifier key_mods
 

Detailed Description

The class representing window objects that bypass SGL and use OpenGL and GLUT routines directly.

Constructor & Destructor Documentation

◆ OGLWindow() [1/2]

sgl::OGLWindow::OGLWindow ( const std::string &  title,
int  left,
int  top,
int  width,
int  height 
)

Constructor that provides the most control to the client. Creates a window with detailed information.

Parameters
titlethe text to appear within the window's titlebar
leftthe x coordinate in screen coordinates of the window's left-top corner
topthe y coordinate in screen coordinates of the window's left-top corner
widththe width in screen coordinates of the window
heightthe height in screen coordinates of the window

◆ OGLWindow() [2/2]

sgl::OGLWindow::OGLWindow ( const std::string &  title)

Creates a window with a default position and size.

Parameters
titlethe text to appear within the window's titlebar

◆ ~OGLWindow()

sgl::OGLWindow::~OGLWindow ( )

Destroys a graphical window object.

Member Function Documentation

◆ postpaint()

void sgl::OGLWindow::postpaint ( )
overridevirtual

Code executed after the call to paint

Returns
nothing

Reimplemented from sgl::Window.

◆ prepaint()

void sgl::OGLWindow::prepaint ( )
overridevirtual

Code executed before the call to paint

Returns
nothing

Reimplemented from sgl::Window.


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