SCV
4.2.1
Simple Components for Visual
|
The main event loop handler. More...
#include <Kernel.h>
Public Types | |
enum | TextureFilter { LINEAR, NEAREST } |
typedef std::list< Component * > | ComponentsList |
Public Member Functions | |
virtual void | onDisplay (void) |
void | run (void) |
Start the SCV event loop. Call this after setting up your form layout to run the GUI. | |
void | showCopyrights (void) |
void | setFramesPerSecond (float fps) |
Sets the FPS the main loop runs at. Increase if you need smoother animation or higher responsiveness. | |
float | getFramesPerSecond (void) const |
Returns the current FPS the interface is running at. | |
void | setWindowSize (unsigned int width, unsigned int height) |
Resizes the window. | |
void | setWindowTitle (const std::string &title) |
Changes the window title. | |
int | getWidth (void) const |
Returns the current window width. | |
int | getHeight (void) const |
Returns the current window height. | |
void | setFullScreen (bool full) |
Enters or exits fullscreen mode. | |
void | lockWindowSize (bool lock) |
Locks or unlocks the window size, so that the user can not resize it by dragging. | |
TextureFilter | getFilterType (void) |
void | setFilterType (TextureFilter tex) |
bool | lockMouseUse (Component *component) |
bool | unlockMouseUse (Component *component) |
bool | requestMouseUse (Component *component) |
bool | requestComponentFocus (Component *component) |
Component * | getFocusedComponent (void) const |
bool | willAppearOnScreen (Component *component) |
void | applyDefaultTransformMatrix (void) |
std::string | getClipBoardString (void) const |
Returns the current contents of the clipboard. | |
void | setClipBoardString (const std::string str) |
Replaces the clipboard's contents with the string strData . | |
void | addWindow (InternalFrame *window) |
void | addComponent (Component *object) |
Adds component object to the window. If object already belongs to a panel, does nothing. | |
void | removeComponent (Component *object) |
Removes object from any container it is in. | |
void | setWidgetTexture (scv::Component::Type widget, ComponentTexture *texture) |
ComponentTexture * | getWidgetTexture (scv::Component::Type widget) |
![]() | |
virtual | ~SCVCallbacks () |
virtual void | onMouseClick (const scv::MouseEvent &evt) |
virtual void | onMouseHold (const scv::MouseEvent &evt) |
virtual void | onMouseOver (const scv::MouseEvent &evt) |
virtual void | onMouseUp (const scv::MouseEvent &evt) |
virtual void | onMouseWheel (const scv::MouseEvent &evt) |
virtual void | onKeyPressed (const scv::KeyEvent &evt) |
virtual void | onKeyUp (const scv::KeyEvent &evt) |
virtual void | onSizeChange (void) |
virtual void | onPositionChange (void) |
Public Attributes | |
ComponentsList | _objects |
bool | isFullScreen |
int | currSize [2] |
int | userSize [2] |
int | count |
int | currTime |
int | prevTime |
int | baseTime |
float | fps |
float | currFps |
int | doubleClickTime |
Point | lastClickPosition |
Timer | lastTimeClicked |
MouseEvent::Button | lastButton |
bool | clicked |
bool | locked |
Component * | componentRequestUse |
Protected Member Functions | |
Kernel (void) | |
virtual | ~Kernel (void) |
void | initOpenGL (int argc, char *argv[]) |
void | updateFramesPerSecond (void) |
![]() | |
Singleton (void) | |
virtual | ~Singleton (void) |
Singleton (const Singleton &source) | |
Static Protected Member Functions | |
static void | cbMouseMotion (int x, int y) |
static void | cbMouseClick (int button, int state, int x, int y) |
static void | cbMouseWheel (int button, int dir, int x, int y) |
static void | cbKeySpecial (int key, int x, int y) |
static void | cbKeySpecialUp (int key, int x, int y) |
static void | cbKey (unsigned char key, int x, int y) |
static void | cbKeyUp (unsigned char key, int x, int y) |
static void | cbDisplay (void) |
Protected Attributes | |
struct { | |
bool isFullScreen | |
int currSize [2] | |
int userSize [2] | |
} | Display |
struct { | |
int count | |
int currTime | |
int prevTime | |
int baseTime | |
float fps | |
float currFps | |
} | FrameRate |
struct { | |
int doubleClickTime | |
Point lastClickPosition | |
Timer lastTimeClicked | |
MouseEvent::Button lastButton | |
bool clicked | |
bool locked | |
Component * componentRequestUse | |
} | Mouse |
ComponentTexture * | _loadedWidgets [Component::NOFWIDGETS] |
std::string | _windowTitle |
TextureFilter | _filterType |
Component * | _focusedComponent |
bool | _allowResizing |
bool | _reshapeOnNextFrame |
bool | _componentRequestFocus |
ContextMenu * | _contextMenu |
Static Protected Attributes | |
static const std::string | s_defaultTitle = "SCV - Simple Components for Visual - http://www-usr.inf.ufsm.br/~pozzer/scv/" |
static const unsigned int | s_defaultWidth = 1280 |
static const unsigned int | s_defaultHeight = 720 |
static const unsigned int | s_defaultFramesPerSecond = 30 |
![]() | |
static T * | _instance = 0 |
Friends | |
class | Singleton< Kernel > |
Additional Inherited Members | |
![]() | |
static void | setInstance (T *instance) |
static T * | getInstance () |
static void | destroyInstance () |
The main event loop handler.
This class controls all components, interactions and OpenGL interfacing.
typedef std::list<Component*> scv::Kernel::ComponentsList |
|
protected |
|
inlineprotectedvirtual |
void scv::Kernel::addComponent | ( | Component * | object | ) |
Adds component object
to the window. If object
already belongs to a panel, does nothing.
void scv::Kernel::addWindow | ( | InternalFrame * | window | ) |
void scv::Kernel::applyDefaultTransformMatrix | ( | void | ) |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
std::string scv::Kernel::getClipBoardString | ( | void | ) | const |
Returns the current contents of the clipboard.
|
inline |
|
inline |
|
inline |
Returns the current FPS the interface is running at.
|
inline |
Returns the current window height.
|
inline |
|
inline |
Returns the current window width.
|
protected |
bool scv::Kernel::lockMouseUse | ( | Component * | component | ) |
void scv::Kernel::lockWindowSize | ( | bool | lock | ) |
Locks or unlocks the window size, so that the user can not resize it by dragging.
|
inlinevirtual |
void scv::Kernel::removeComponent | ( | Component * | object | ) |
Removes object
from any container it is in.
bool scv::Kernel::requestComponentFocus | ( | Component * | component | ) |
bool scv::Kernel::requestMouseUse | ( | Component * | component | ) |
void scv::Kernel::run | ( | void | ) |
Start the SCV event loop. Call this after setting up your form layout to run the GUI.
void scv::Kernel::setClipBoardString | ( | const std::string | str | ) |
Replaces the clipboard's contents with the string strData
.
|
inline |
|
inline |
Sets the FPS the main loop runs at. Increase if you need smoother animation or higher responsiveness.
void scv::Kernel::setFullScreen | ( | bool | full | ) |
Enters or exits fullscreen mode.
|
inline |
void scv::Kernel::setWindowSize | ( | unsigned int | width, |
unsigned int | height | ||
) |
Resizes the window.
void scv::Kernel::setWindowTitle | ( | const std::string & | title | ) |
Changes the window title.
void scv::Kernel::showCopyrights | ( | void | ) |
bool scv::Kernel::unlockMouseUse | ( | Component * | component | ) |
|
protected |
bool scv::Kernel::willAppearOnScreen | ( | Component * | component | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
ComponentsList scv::Kernel::_objects |
|
protected |
|
protected |
int scv::Kernel::baseTime |
bool scv::Kernel::clicked |
Component* scv::Kernel::componentRequestUse |
int scv::Kernel::count |
float scv::Kernel::currFps |
int scv::Kernel::currSize[2] |
int scv::Kernel::currTime |
struct { ... } scv::Kernel::Display |
int scv::Kernel::doubleClickTime |
float scv::Kernel::fps |
struct { ... } scv::Kernel::FrameRate |
bool scv::Kernel::isFullScreen |
MouseEvent::Button scv::Kernel::lastButton |
Point scv::Kernel::lastClickPosition |
Timer scv::Kernel::lastTimeClicked |
bool scv::Kernel::locked |
struct { ... } scv::Kernel::Mouse |
int scv::Kernel::prevTime |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
int scv::Kernel::userSize[2] |