|
Tramway SDK v0.1.1
|
User interface system. More...
Classes | |
| struct | KeyBinding |
Typedefs | |
| typedef uint16_t | keyboardaction_t |
Functions | |
| void | BindKeyboardKey (KeyboardKey key, keyboardaction_t action) |
| void | BindKeyboardKey (KeyboardKey key, void(*action)()) |
| void | BindKeyboardKey (KeyboardKey key, void(*action)(KeyboardKey)) |
| void | Init () |
| Initializes the UI system. More... | |
| void | Uninit () |
| Uninitializes the UI system. More... | |
| void | Update () |
| Updates the UI system. More... | |
| void | EndFrame () |
| Ends the frame and updates the window. More... | |
| void | SetWebMainLoop (void(*loop_function)(void)) |
| float | GetScreenWidth () |
| float | GetScreenHeight () |
| void | SetWindowTitle (const char *title) |
| void | SetWindowSize (int w, int h) |
| Sets the window size. More... | |
| void | SetCursor (CursorType cursor) |
| void | SetInputState (InputState state) |
| InputState | GetInputState () |
| bool | PollKeyboardKey (KeyboardKey key) |
| Checks the state of a key for the current frame. More... | |
| float | PollKeyboardAxis (KeyboardAxis key) |
| Checks the state of an axis for the current frame. More... | |
| float | PollKeyboardAxisDelta (KeyboardAxis key) |
| Checks the change of an axis for since the last frame. More... | |
| float | GetAxisSensitivity (KeyboardAxis key) |
| void | SetAxisSensitivity (KeyboardAxis key, float value) |
| void | KeyPress (KeyboardKey key) |
| void | KeyRelease (KeyboardKey key) |
| void | KeyCode (uint16_t code) |
| void | KeyMouse (float xpos, float ypos) |
| void | KeyScroll (float value) |
| void | ScreenResize (int width, int height) |
| void | ScreenClose () |
| bool | ShouldExit () |
| keyboardaction_t | RegisterKeyboardAction (const char *name) |
| keyboardaction_t | GetKeyboardAction (name_t name) |
| name_t | GetKeyboardActionName (keyboardaction_t type) |
| std::vector< std::pair< keyboardaction_t, std::vector< KeyboardKey > > > | GetAllKeyboardKeyBindings () |
| const char * | GetKeyboardKeyName (KeyboardKey key) |
Variables | |
| const float | CAMERA_SENSITIVITY = 6.0f |
| const float | CAMERA_SPEED = 6.0f |
User interface system.
Handles opening the window, taking in keyboard and mouse inputs.
| typedef uint16_t tram::UI::keyboardaction_t |
| enum tram::UI::CursorType |
| enum tram::UI::InputState |
| enum tram::UI::KeyboardAxis : uint16_t |
| enum tram::UI::KeyboardKey : uint16_t |
| void tram::UI::BindKeyboardKey | ( | KeyboardKey | key, |
| keyboardaction_t | action | ||
| ) |
| void tram::UI::BindKeyboardKey | ( | KeyboardKey | key, |
| void(*)() | action | ||
| ) |
| void tram::UI::BindKeyboardKey | ( | KeyboardKey | key, |
| void(*)(KeyboardKey) | action | ||
| ) |
| void tram::UI::EndFrame | ( | ) |
Ends the frame and updates the window.
| std::vector< std::pair< keyboardaction_t, std::vector< KeyboardKey > > > tram::UI::GetAllKeyboardKeyBindings | ( | ) |
| float tram::UI::GetAxisSensitivity | ( | KeyboardAxis | key | ) |
| InputState tram::UI::GetInputState | ( | ) |
| keyboardaction_t tram::UI::GetKeyboardAction | ( | name_t | name | ) |
| name_t tram::UI::GetKeyboardActionName | ( | keyboardaction_t | type | ) |
| const char * tram::UI::GetKeyboardKeyName | ( | KeyboardKey | key | ) |
| float tram::UI::GetScreenHeight | ( | ) |
| float tram::UI::GetScreenWidth | ( | ) |
| void tram::Platform::Input::Init | ( | ) |
Initializes the UI system.
This will open the window.
| void tram::UI::KeyCode | ( | uint16_t | code | ) |
| void tram::UI::KeyMouse | ( | float | xpos, |
| float | ypos | ||
| ) |
| void tram::UI::KeyPress | ( | KeyboardKey | key | ) |
| void tram::UI::KeyRelease | ( | KeyboardKey | key | ) |
| void tram::UI::KeyScroll | ( | float | value | ) |
| float tram::UI::PollKeyboardAxis | ( | KeyboardAxis | key | ) |
Checks the state of an axis for the current frame.
| float tram::UI::PollKeyboardAxisDelta | ( | KeyboardAxis | key | ) |
Checks the change of an axis for since the last frame.
| bool tram::UI::PollKeyboardKey | ( | KeyboardKey | key | ) |
Checks the state of a key for the current frame.
| keyboardaction_t tram::UI::RegisterKeyboardAction | ( | const char * | name | ) |
| void tram::UI::ScreenClose | ( | ) |
| void tram::UI::ScreenResize | ( | int | width, |
| int | height | ||
| ) |
| void tram::UI::SetAxisSensitivity | ( | KeyboardAxis | key, |
| float | value | ||
| ) |
| void tram::UI::SetCursor | ( | CursorType | cursor | ) |
| void tram::UI::SetInputState | ( | InputState | state | ) |
| void tram::UI::SetWebMainLoop | ( | void(*)(void) | loop_function | ) |
| void tram::UI::SetWindowSize | ( | int | w, |
| int | h | ||
| ) |
Sets the window size.
The width and height are the pixel value of the window.
| void tram::UI::SetWindowTitle | ( | const char * | title | ) |
| bool tram::UI::ShouldExit | ( | ) |
| void tram::Platform::Input::Uninit | ( | ) |
Uninitializes the UI system.
Closes the window.
| void tram::Platform::Input::Update | ( | ) |
| const float tram::UI::CAMERA_SENSITIVITY = 6.0f |
| const float tram::UI::CAMERA_SPEED = 6.0f |