Allolib
1.0
C++ Components For Interactive Multimedia
|
Window with OpenGL context. More...
#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/io/al_Window.hpp>
Classes | |
struct | Dim |
Window pixel dimensions. More... | |
Public Types | |
enum | DisplayMode : unsigned int { SINGLE_BUF = 1 << 0 , DOUBLE_BUF = 1 << 1 , STEREO_BUF = 1 << 2 , ACCUM_BUF = 1 << 3 , ALPHA_BUF = 1 << 4 , DEPTH_BUF = 1 << 5 , STENCIL_BUF = 1 << 6 , MULTISAMPLE = 1 << 7 , DEFAULT_BUF } |
Window display mode bit flags. More... | |
enum | Cursor { NONE = 0 , POINTER = 1 , CROSSHAIR } |
Cursor icon types. | |
typedef std::vector< WindowEventHandler * > | WindowEventHandlers |
Public Member Functions | |
bool | create (bool is_verbose=false) |
void | makeCurrent () |
void | refresh () |
void | close () |
bool | shouldClose () |
void | destroy () |
Destroy current window and its associated graphics context. | |
const Keyboard & | keyboard () const |
Get current keyboard state. | |
const Mouse & | mouse () const |
Get current mouse state. | |
double | aspect () const |
Get aspect ratio (width divided by height) | |
bool | created () const |
Cursor | cursor () const |
Get current cursor type. | |
bool | cursorHide () const |
Whether the cursor is hidden. | |
Dim | dimensions () const |
Get current dimensions of window. | |
DisplayMode | displayMode () const |
Get current display mode. | |
bool | enabled (DisplayMode v) const |
Get whether display mode flag is set. | |
bool | fullScreen () const |
Get whether window is in fullscreen. | |
const std::string & | title () const |
Get title of window. | |
bool | visible () const |
Get whether window is visible. | |
bool | vsync () const |
Get whether v-sync is enabled. | |
int | height () const |
Get window height, in pixels. | |
int | width () const |
Get window width, in pixels. | |
int | fbHeight () const |
int | fbWidth () const |
float | highres_factor () |
bool | decorated () const |
void | cursor (Cursor v) |
Set cursor type. | |
void | cursorHide (bool v) |
Set cursor hiding. | |
void | cursorHideToggle () |
Toggle cursor hiding. | |
void | dimensions (const Dim &v) |
Set dimensions. | |
void | dimensions (int w, int h) |
Set dimensions. | |
void | dimensions (int x, int y, int w, int h) |
Set dimensions. | |
void | displayMode (DisplayMode v) |
void | fullScreen (bool on, int monitorIndex=0) |
void | fullScreenToggle () |
Toggle fullscreen. | |
void | hide () |
Hide window (if showing) | |
void | iconify () |
Iconify window. | |
void | title (const std::string &v) |
Set title. | |
void | vsync (bool v) |
void | decorated (bool b) |
WindowEventHandlers & | windowEventHandlers () |
Window & | append (WindowEventHandler &v) |
Window & | prepend (WindowEventHandler &v) |
Window & | remove (WindowEventHandler &v) |
Remove all window event handlers matching argument. | |
Static Public Member Functions | |
static void | destroyAll () |
Destroy all created windows. | |
Public Attributes | |
std::function< bool(Keyboard const &)> | onKeyDown |
std::function< bool(Keyboard const &)> | onKeyUp |
std::function< bool(Mouse const &)> | onMouseDown |
std::function< bool(Mouse const &)> | onMouseUp |
std::function< bool(Mouse const &)> | onMouseDrag |
std::function< bool(Mouse const &)> | onMouseMove |
std::function< bool(Mouse const &)> | onMouseScroll |
std::function< void(int, int)> | onResize = [](int, int) {} |
Keyboard | mKeyboard |
Mouse | mMouse |
WindowEventHandlers | mWindowEventHandlers |
Dim | mDim {50, 50, 640, 480} |
Dim | mFullScreenDim {0} |
DisplayMode | mDisplayMode = DEFAULT_BUF |
std::string | mTitle = "allolib" |
Cursor | mCursor = POINTER |
bool | mCursorHide = false |
bool | mFullScreen = false |
bool | mVisible = false |
bool | mVSync = true |
bool | mDecorated = true |
float | mHighresFactor = 0 |
int | mFramebufferWidth = 0 |
int | mFramebufferHeight = 0 |
Protected Member Functions | |
bool | implCreate (bool is_verbose=false) |
bool | implCreated () const |
void | implMakeCurrent () |
void | implRefresh () |
void | implDestroy () |
void | implSetCursor () |
void | implSetCursorHide () |
void | implSetDimensions () |
void | implSetFullScreen (int monitorIndex=0) |
void | implSetTitle () |
void | implSetVSync () |
void | implHide () |
void | implIconify () |
void | implSetDecorated (bool decorated) |
bool | implShouldClose () |
void | implClose () |
Window & | insert (WindowEventHandler &v, int i) |
void | callHandlersMouseDown () |
void | callHandlersMouseDrag () |
void | callHandlersMouseMove () |
void | callHandlersMouseUp () |
void | callHandlersMouseScroll () |
void | callHandlersKeyDown () |
void | callHandlersKeyUp () |
void | callHandlersResize (int w, int h) |
void | callHandlersVisibility (bool v) |
Protected Attributes | |
std::unique_ptr< class WindowImpl > | mImpl |
Friends | |
class | WindowImpl |
Window with OpenGL context.
Upon construction, the Window will add itself to its list of input event handlers and its list of window event handlers.
Definition at line 251 of file al_Window.hpp.
enum al::Window::DisplayMode : unsigned int |
Window display mode bit flags.
Definition at line 256 of file al_Window.hpp.
Window& al::Window::append | ( | WindowEventHandler & | v | ) |
Append handler to window event handler list The order of handlers in the list matches their calling order.
bool al::Window::create | ( | bool | is_verbose = false | ) |
Create window and its associated graphics context using current settings This will create a new window only if the the window has not already been created.
bool al::Window::created | ( | ) | const |
Whether window has been created providing a valid graphics context
void al::Window::displayMode | ( | DisplayMode | v | ) |
Set display mode; will recreate window if different from current
void al::Window::fullScreen | ( | bool | on, |
int | monitorIndex = 0 |
||
) |
This will make the window go fullscreen without borders and, if posssible, without changing the display resolution.
Window& al::Window::prepend | ( | WindowEventHandler & | v | ) |
Prepend handler to input event handler list The order of handlers in the list matches their calling order.
void al::Window::vsync | ( | bool | v | ) |
Set whether to sync the frame rate to the monitor's refresh rate
std::function<bool(Keyboard const &)> al::Window::onKeyDown |
Definition at line 368 of file al_Window.hpp.
std::function<bool(Keyboard const &)> al::Window::onKeyUp |
Definition at line 371 of file al_Window.hpp.
std::function<bool(Mouse const &)> al::Window::onMouseDown |
Definition at line 374 of file al_Window.hpp.
std::function<bool(Mouse const &)> al::Window::onMouseDrag |
Definition at line 380 of file al_Window.hpp.
std::function<bool(Mouse const &)> al::Window::onMouseMove |
Definition at line 383 of file al_Window.hpp.
std::function<bool(Mouse const &)> al::Window::onMouseScroll |
Definition at line 386 of file al_Window.hpp.
std::function<bool(Mouse const &)> al::Window::onMouseUp |
Definition at line 377 of file al_Window.hpp.