GLVis  v4.2
Accurate and flexible finite element visualization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
SdlWindow Class Reference

#include <sdl.hpp>

Public Member Functions

 SdlWindow ()
 
 ~SdlWindow ()
 
bool createWindow (const char *title, int x, int y, int w, int h, bool legacyGlOnly)
 
void mainLoop ()
 Runs the window loop. More...
 
void mainIter ()
 
void signalLoop ()
 
void setOnIdle (IdleDelegate func)
 
void setOnExpose (Delegate func)
 
void setOnReshape (WindowDelegate func)
 
void setOnKeyDown (int key, Delegate func)
 
void setOnKeyDown (int key, KeyDelegate func)
 
void setOnMouseDown (int btn, MouseDelegate func)
 
void setOnMouseUp (int btn, MouseDelegate func)
 
void setOnMouseMove (int btn, MouseDelegate func)
 
void setTouchPinchCallback (TouchDelegate cb)
 
void setTouchRotateCallback (TouchDelegate cb)
 
void clearEvents ()
 
void callKeyDown (SDL_Keycode k, Uint16 mod=0)
 
void getWindowSize (int &w, int &h)
 
void getGLDrawSize (int &w, int &h)
 
void getDpi (int &wdpi, int &hdpi)
 
bool isHighDpi () const
 This property is set by createWindow(). More...
 
gl3::MeshRenderergetRenderer ()
 
void setWindowTitle (std::string &title)
 
void setWindowTitle (const char *title)
 
void setWindowSize (int w, int h)
 
void setWindowPos (int x, int y)
 
void signalKeyDown (SDL_Keycode k, SDL_Keymod m=KMOD_NONE)
 
void signalExpose ()
 
void signalSwap ()
 
void signalQuit ()
 
std::string getSavedKeys () const
 Returns the keyboard events that have been logged by the window. More...
 
void screenshot (std::string filename, bool convert=false)
 Queues a screenshot to be taken. More...
 
void swapBuffer ()
 
 operator bool ()
 
bool isWindowInitialized ()
 
bool isGlInitialized ()
 Returns true if the OpenGL context was successfully initialized. More...
 
bool isSwapPending ()
 
bool isExposePending ()
 
std::string getCanvasId () const
 
void setCanvasId (std::string canvas_id)
 

Static Public Member Functions

static void StartSDL (bool server_mode)
 

Friends

class SdlMainThread
 

Detailed Description

Definition at line 41 of file sdl.hpp.

Constructor & Destructor Documentation

SdlWindow::SdlWindow ( )

Definition at line 81 of file sdl.cpp.

SdlWindow::~SdlWindow ( )

Definition at line 185 of file sdl.cpp.

Member Function Documentation

void SdlWindow::callKeyDown ( SDL_Keycode  k,
Uint16  mod = 0 
)
inline

Definition at line 212 of file sdl.hpp.

void SdlWindow::clearEvents ( )
inline

Definition at line 201 of file sdl.hpp.

bool SdlWindow::createWindow ( const char *  title,
int  x,
int  y,
int  w,
int  h,
bool  legacyGlOnly 
)

Creates a new OpenGL window. Returns false if SDL or OpenGL initialization fails.

Definition at line 90 of file sdl.cpp.

std::string SdlWindow::getCanvasId ( ) const
inline

Definition at line 262 of file sdl.hpp.

void SdlWindow::getDpi ( int &  wdpi,
int &  hdpi 
)

Definition at line 568 of file sdl.cpp.

void SdlWindow::getGLDrawSize ( int &  w,
int &  h 
)

Definition at line 563 of file sdl.cpp.

gl3::MeshRenderer& SdlWindow::getRenderer ( )
inline

Definition at line 226 of file sdl.hpp.

std::string SdlWindow::getSavedKeys ( ) const
inline

Returns the keyboard events that have been logged by the window.

Definition at line 238 of file sdl.hpp.

void SdlWindow::getWindowSize ( int &  w,
int &  h 
)

Definition at line 534 of file sdl.cpp.

bool SdlWindow::isExposePending ( )
inline

Definition at line 259 of file sdl.hpp.

bool SdlWindow::isGlInitialized ( )

Returns true if the OpenGL context was successfully initialized.

Definition at line 76 of file sdl.cpp.

bool SdlWindow::isHighDpi ( ) const
inline

This property is set by createWindow().

Definition at line 224 of file sdl.hpp.

bool SdlWindow::isSwapPending ( )
inline

Definition at line 258 of file sdl.hpp.

bool SdlWindow::isWindowInitialized ( )
inline

Definition at line 254 of file sdl.hpp.

void SdlWindow::mainIter ( )

Definition at line 362 of file sdl.cpp.

void SdlWindow::mainLoop ( )

Runs the window loop.

Definition at line 483 of file sdl.cpp.

SdlWindow::operator bool ( )
inline

Definition at line 253 of file sdl.hpp.

void SdlWindow::screenshot ( std::string  filename,
bool  convert = false 
)
inline

Queues a screenshot to be taken.

Definition at line 241 of file sdl.hpp.

void SdlWindow::setCanvasId ( std::string  canvas_id)
inline

Definition at line 263 of file sdl.hpp.

void SdlWindow::setOnExpose ( Delegate  func)
inline

Definition at line 185 of file sdl.hpp.

void SdlWindow::setOnIdle ( IdleDelegate  func)
inline

Definition at line 184 of file sdl.hpp.

void SdlWindow::setOnKeyDown ( int  key,
Delegate  func 
)
inline

Definition at line 188 of file sdl.hpp.

void SdlWindow::setOnKeyDown ( int  key,
KeyDelegate  func 
)
inline

Definition at line 192 of file sdl.hpp.

void SdlWindow::setOnMouseDown ( int  btn,
MouseDelegate  func 
)
inline

Definition at line 194 of file sdl.hpp.

void SdlWindow::setOnMouseMove ( int  btn,
MouseDelegate  func 
)
inline

Definition at line 196 of file sdl.hpp.

void SdlWindow::setOnMouseUp ( int  btn,
MouseDelegate  func 
)
inline

Definition at line 195 of file sdl.hpp.

void SdlWindow::setOnReshape ( WindowDelegate  func)
inline

Definition at line 186 of file sdl.hpp.

void SdlWindow::setTouchPinchCallback ( TouchDelegate  cb)
inline

Definition at line 198 of file sdl.hpp.

void SdlWindow::setTouchRotateCallback ( TouchDelegate  cb)
inline

Definition at line 199 of file sdl.hpp.

void SdlWindow::setWindowPos ( int  x,
int  y 
)

Definition at line 618 of file sdl.cpp.

void SdlWindow::setWindowSize ( int  w,
int  h 
)

Definition at line 611 of file sdl.cpp.

void SdlWindow::setWindowTitle ( std::string &  title)

Definition at line 601 of file sdl.cpp.

void SdlWindow::setWindowTitle ( const char *  title)

Definition at line 606 of file sdl.cpp.

void SdlWindow::signalExpose ( )
inline

Definition at line 233 of file sdl.hpp.

void SdlWindow::signalKeyDown ( SDL_Keycode  k,
SDL_Keymod  m = KMOD_NONE 
)

Definition at line 630 of file sdl.cpp.

void SdlWindow::signalLoop ( )

Definition at line 524 of file sdl.cpp.

void SdlWindow::signalQuit ( )
inline

Definition at line 235 of file sdl.hpp.

void SdlWindow::signalSwap ( )
inline

Definition at line 234 of file sdl.hpp.

void SdlWindow::StartSDL ( bool  server_mode)
static

Definition at line 83 of file sdl.cpp.

void SdlWindow::swapBuffer ( )

Definition at line 649 of file sdl.cpp.

Friends And Related Function Documentation

friend class SdlMainThread
friend

Definition at line 44 of file sdl.hpp.


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