Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Static Public Member Functions | Static Protected Attributes

vlSDL::SDLWindow Class Reference

The SDLWindow class implements an OpenGLContext using the SDL API. More...

#include <SDLWindow.hpp>

Inheritance diagram for vlSDL::SDLWindow:
vl::OpenGLContext vl::Object

List of all members.

Public Member Functions

 SDLWindow ()
 SDLWindow (const vl::String &title, const vl::OpenGLContextFormat &info, int x=0, int y=0, int width=640, int height=480)
bool initSDLWindow (const vl::String &title, const vl::OpenGLContextFormat &info, int x=0, int y=0, int width=640, int height=480)
 ~SDLWindow ()
void setPosition (int x, int y)
 If the OpenGL context is a widget this function sets its position.
virtual void swapBuffers ()
 Swaps the back and front buffers to present the last rendering.
void translateEvent (SDL_Event *ev)
void quitApplication ()
 Quits the event loop.
void setWindowTitle (const vl::String &)
 If the OpenGL context is a top window this function sets its title.
void setMouseVisible (bool visible)
 If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.
void setMousePosition (int x, int y)
 If the OpenGL context is a widget this function sets the mouse position.
void update ()
 If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().
void makeCurrent ()
 Sets the OpenGL context as current for the calling thread.

Static Public Member Functions

static SDL_Surface * sdlSurface ()

Static Protected Attributes

static SDL_Surface * mScreen = NULL

Detailed Description

The SDLWindow class implements an OpenGLContext using the SDL API.

Note:
SDL notifies Unicode codes only on key-press events not on release events.

Definition at line 58 of file SDLWindow.hpp.


Constructor & Destructor Documentation

SDLWindow::SDLWindow (  )

Definition at line 169 of file SDLWindow.cpp.

SDLWindow::SDLWindow ( const vl::String title,
const vl::OpenGLContextFormat info,
int  x = 0,
int  y = 0,
int  width = 640,
int  height = 480 
)

Definition at line 177 of file SDLWindow.cpp.

SDLWindow::~SDLWindow (  )

Definition at line 173 of file SDLWindow.cpp.


Member Function Documentation

bool SDLWindow::initSDLWindow ( const vl::String title,
const vl::OpenGLContextFormat info,
int  x = 0,
int  y = 0,
int  width = 640,
int  height = 480 
)
void SDLWindow::setPosition ( int  ,
int   
) [virtual]

If the OpenGL context is a widget this function sets its position.

Reimplemented from vl::OpenGLContext.

Definition at line 491 of file SDLWindow.cpp.

void SDLWindow::swapBuffers (  ) [virtual]

Swaps the back and front buffers to present the last rendering.

Implements vl::OpenGLContext.

Definition at line 486 of file SDLWindow.cpp.

void SDLWindow::translateEvent ( SDL_Event *  ev )
void SDLWindow::quitApplication (  ) [virtual]

Quits the event loop.

Reimplemented from vl::OpenGLContext.

Definition at line 470 of file SDLWindow.cpp.

References NULL.

void SDLWindow::setWindowTitle ( const vl::String  ) [virtual]

If the OpenGL context is a top window this function sets its title.

Reimplemented from vl::OpenGLContext.

Definition at line 481 of file SDLWindow.cpp.

References vl::String::toStdString().

void vlSDL::SDLWindow::setMouseVisible ( bool   ) [inline, virtual]

If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.

Reimplemented from vl::OpenGLContext.

Definition at line 78 of file SDLWindow.hpp.

void vlSDL::SDLWindow::setMousePosition ( int  ,
int   
) [inline, virtual]

If the OpenGL context is a widget this function sets the mouse position.

Reimplemented from vl::OpenGLContext.

Definition at line 84 of file SDLWindow.hpp.

void SDLWindow::update (  ) [virtual]

If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().

Implements vl::OpenGLContext.

Definition at line 476 of file SDLWindow.cpp.

void vlSDL::SDLWindow::makeCurrent (  ) [inline, virtual]

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

Definition at line 91 of file SDLWindow.hpp.

static SDL_Surface* vlSDL::SDLWindow::sdlSurface (  ) [inline, static]

Definition at line 93 of file SDLWindow.hpp.


Member Data Documentation

SDL_Surface * SDLWindow::mScreen = NULL [static, protected]

Definition at line 96 of file SDLWindow.hpp.


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:12.
Permission is granted to use this page to write and publish articles regarding Visualization Library.