redhand namespace
The Redhand library.
Classes
- class Actor
- The Actor is the simple class used to diplay most things in redhand.
- class complex_world
- This is the underlying type for worlds with lots of low level functions for managing objects.
- class drawing_event
- raise a new drawing event that is raised once every draw tick.
- class engine
- This class basically handles all the setup need for games to work.
- class engine_config
- This struct specifies all the properties of the game engine.
-
template<class T>class event
- A general class for raising events, specific events types should be a subclass of this general event.
- class game_loop_event
- A game loop event is raised once every game loop tick.
- class game_object
- The game_
object is a complex object which can be displayed in a world. - class game_object_properties
- This struct specifies all the properties of a game_
object. - class helper
- A singlton with a lot of helper functions available to all parts of redhand.
- class image_properties
- This struct stores all the information needed to create a 2 dimensional image from a file.
- class input_system
- The input_
system is used to handle user inputs for all kinds of devices. - class shader
- This class provides a simple abstraction for opengl shaders.
- class texture2D
- This class is a simple 2 Dimensional texture.
- class world_switching_event
- This event is called after the game loop when the old world will be switched to a new world and after the new world was initilized.
Enums
- enum key_actions { PRESS = GLFW_PRESS, REPEAT = GLFW_REPEAT, RELEASE = GLFW_RELEASE, UNKNOWN = GLFW_KEY_UNKNOWN }
- This type specifies the actions a key can trigger.
- enum keyboard_keys { KEY_UNKNOWN = GLFW_KEY_UNKNOWN, KEY_SPACE = GLFW_KEY_SPACE, KEY_APOSTROPHE = GLFW_KEY_APOSTROPHE, KEY_COMMA = GLFW_KEY_COMMA, KEY_MINUS = GLFW_KEY_MINUS, KEY_PERIOD = GLFW_KEY_PERIOD, KEY_SLASH = GLFW_KEY_SLASH, KEY_0 = GLFW_KEY_0, KEY_1 = GLFW_KEY_1, KEY_2 = GLFW_KEY_2, KEY_3 = GLFW_KEY_3, KEY_4 = GLFW_KEY_4, KEY_5 = GLFW_KEY_5, KEY_6 = GLFW_KEY_6, KEY_7 = GLFW_KEY_7, KEY_8 = GLFW_KEY_8, KEY_9 = GLFW_KEY_9, KEY_SEMICOLON = GLFW_KEY_SEMICOLON, KEY_EQUAL = GLFW_KEY_EQUAL, KEY_A = GLFW_KEY_A, KEY_B = GLFW_KEY_B, KEY_C = GLFW_KEY_C, KEY_D = GLFW_KEY_D, KEY_E = GLFW_KEY_E, KEY_F = GLFW_KEY_F, KEY_G = GLFW_KEY_G, KEY_H = GLFW_KEY_H, KEY_I = GLFW_KEY_I, KEY_J = GLFW_KEY_J, KEY_K = GLFW_KEY_K, KEY_L = GLFW_KEY_L, KEY_M = GLFW_KEY_M, KEY_N = GLFW_KEY_N, KEY_O = GLFW_KEY_O, KEY_P = GLFW_KEY_P, KEY_Q = GLFW_KEY_Q, KEY_R = GLFW_KEY_R, KEY_S = GLFW_KEY_S, KEY_T = GLFW_KEY_T, KEY_U = GLFW_KEY_U, KEY_V = GLFW_KEY_V, KEY_W = GLFW_KEY_W, KEY_X = GLFW_KEY_X, KEY_Y = GLFW_KEY_Y, KEY_Z = GLFW_KEY_Z, KEY_LEFT_BRACKET = GLFW_KEY_LEFT_BRACKET, KEY_BACKSLASH = GLFW_KEY_BACKSLASH, KEY_RIGHT_BRACKET = GLFW_KEY_RIGHT_BRACKET, KEY_GRAVE_ACCENT = GLFW_KEY_GRAVE_ACCENT, KEY_WORLD_1 = GLFW_KEY_WORLD_1, KEY_WORLD_2 = GLFW_KEY_WORLD_2, KEY_ESCAPE = GLFW_KEY_ESCAPE, KEY_ENTER = GLFW_KEY_ENTER, KEY_TAB = GLFW_KEY_TAB, KEY_BACKSPACE = GLFW_KEY_BACKSPACE, KEY_INSERT = GLFW_KEY_INSERT, KEY_DELETE = GLFW_KEY_DELETE, KEY_RIGHT = GLFW_KEY_RIGHT, KEY_LEFT = GLFW_KEY_LEFT, KEY_DOWN = GLFW_KEY_DOWN, KEY_UP = GLFW_KEY_UP, KEY_PAGE_UP = GLFW_KEY_PAGE_UP, KEY_PAGE_DOWN = GLFW_KEY_PAGE_DOWN, KEY_HOME = GLFW_KEY_HOME, KEY_END = GLFW_KEY_END, KEY_CAPS_LOCK = GLFW_KEY_CAPS_LOCK, KEY_SCROLL_LOCK = GLFW_KEY_SCROLL_LOCK, KEY_NUM_LOCK = GLFW_KEY_NUM_LOCK, KEY_PRINT_SCREEN = GLFW_KEY_PRINT_SCREEN, KEY_PAUSE = GLFW_KEY_PAUSE, KEY_F1 = GLFW_KEY_F1, KEY_F2 = GLFW_KEY_F2, KEY_F3 = GLFW_KEY_F3, KEY_F4 = GLFW_KEY_F4, KEY_F5 = GLFW_KEY_F5, KEY_F6 = GLFW_KEY_F6, KEY_F7 = GLFW_KEY_F7, KEY_F8 = GLFW_KEY_F8, KEY_F9 = GLFW_KEY_F9, KEY_F10 = GLFW_KEY_F10, KEY_F11 = GLFW_KEY_F11, KEY_F12 = GLFW_KEY_F12, KEY_F13 = GLFW_KEY_F13, KEY_F14 = GLFW_KEY_F14, KEY_F15 = GLFW_KEY_F15, KEY_F16 = GLFW_KEY_F16, KEY_F17 = GLFW_KEY_F17, KEY_F18 = GLFW_KEY_F18, KEY_F19 = GLFW_KEY_F19, KEY_F20 = GLFW_KEY_F20, KEY_F21 = GLFW_KEY_F21, KEY_F22 = GLFW_KEY_F22, KEY_F23 = GLFW_KEY_F23, KEY_F24 = GLFW_KEY_F24, KEY_F25 = GLFW_KEY_F25, KEY_KP_0 = GLFW_KEY_KP_0, KEY_KP_1 = GLFW_KEY_KP_1, KEY_KP_2 = GLFW_KEY_KP_2, KEY_KP_3 = GLFW_KEY_KP_3, KEY_KP_4 = GLFW_KEY_KP_4, KEY_KP_5 = GLFW_KEY_KP_5, KEY_KP_6 = GLFW_KEY_KP_6, KEY_KP_7 = GLFW_KEY_KP_7, KEY_KP_8 = GLFW_KEY_KP_8, KEY_KP_9 = GLFW_KEY_KP_9, KEY_KP_DECIMAL = GLFW_KEY_KP_DECIMAL, KEY_KP_DIVIDE = GLFW_KEY_KP_DIVIDE, KEY_KP_MULTIPLY = GLFW_KEY_KP_MULTIPLY, KEY_KP_SUBTRACT = GLFW_KEY_KP_SUBTRACT, KEY_KP_ADD = GLFW_KEY_KP_ADD, KEY_KP_ENTER = GLFW_KEY_KP_ENTER, KEY_KP_EQUAL = GLFW_KEY_KP_EQUAL, KEY_LEFT_SHIFT = GLFW_KEY_LEFT_SHIFT, KEY_LEFT_CONTROL = GLFW_KEY_LEFT_CONTROL, KEY_LEFT_ALT = GLFW_KEY_LEFT_ALT, KEY_LEFT_SUPER = GLFW_KEY_LEFT_SUPER, KEY_RIGHT_SHIFT = GLFW_KEY_RIGHT_SHIFT, KEY_RIGHT_CONTROL = GLFW_KEY_RIGHT_CONTROL, KEY_RIGHT_ALT = GLFW_KEY_RIGHT_ALT, KEY_RIGHT_SUPER = GLFW_KEY_RIGHT_SUPER, KEY_MENU = GLFW_KEY_MENU, KEY_LAST = GLFW_KEY_LAST }
- This type contains all keys on the keyboard.
- enum drawing_modes { STATIC_DRAW = 0x88E4, DYNAMIC_DRAW = 0x88E8 }
- These are the available opengl drawing modes.
Functions
- void framebuffer_size_callback(GLFWwindow*, int width, int height)
- This function will be called every time the window size is changed.
-
auto createCircle(glm::vec2 midpoint,
float radius,
unsigned int edges,
glm::vec3 innerColor,
glm::vec3 outerColor,
std::shared_ptr<redhand::
shader> shade, std::shared_ptr<redhand:: texture2D> tex, std::string name, float texture_scale = 1.0f) -> std::unique_ptr<redhand:: game_object> - Create a Circle object.
-
auto createRectangle(glm::vec2 bottomleft,
float width,
float height,
glm::vec3 color,
std::shared_ptr<redhand::
shader> shade, std::shared_ptr<redhand:: texture2D> tex, redhand:: drawing_modes DrawingMode, std::string name, float textureScale = 1.0f) -> std::unique_ptr<redhand:: game_object> - Create a rectangular object.
Enum documentation
enum redhand:: key_actions
#include <include/redhand/types.hpp>
This type specifies the actions a key can trigger.
enum redhand:: keyboard_keys
#include <include/redhand/types.hpp>
This type contains all keys on the keyboard.
enum redhand:: drawing_modes
#include <include/redhand/types.hpp>
These are the available opengl drawing modes.
Function documentation
void redhand:: framebuffer_size_callback(GLFWwindow*,
int width,
int height)
#include <include/redhand/engine.hpp>
This function will be called every time the window size is changed.
std::unique_ptr<redhand:: game_object> redhand:: createCircle(glm::vec2 midpoint,
float radius,
unsigned int edges,
glm::vec3 innerColor,
glm::vec3 outerColor,
std::shared_ptr<redhand:: shader> shade,
std::shared_ptr<redhand:: texture2D> tex,
std::string name,
float texture_scale = 1.0f)
#include <include/redhand/game_object.hpp>
Create a Circle object.
Parameters | |
---|---|
midpoint | The midpoint of the circle in world coordinates |
radius | The radius of the circle in world scale |
edges | The number of edges the circle should have (more make it look more round but take more performance) |
innerColor | The inner color of the circle (rgb) |
outerColor | The outer color of the circle (rgb) |
shade | A pointer to the shader that should be used |
tex | A pointer to the texture that should be used (nullptr if none) |
name | |
texture_scale | The factor by which the texture shoulb be scaled (1.0f if nothig is specified) |
Returns | game_object* |
std::unique_ptr<redhand:: game_object> redhand:: createRectangle(glm::vec2 bottomleft,
float width,
float height,
glm::vec3 color,
std::shared_ptr<redhand:: shader> shade,
std::shared_ptr<redhand:: texture2D> tex,
redhand:: drawing_modes DrawingMode,
std::string name,
float textureScale = 1.0f)
#include <include/redhand/game_object.hpp>
Create a rectangular object.
Parameters | |
---|---|
bottomleft | The position of the bottom left Corner in World Coordinates |
width | The width of the rectangle in World Coordinates |
height | The width of the rectangle in World Coordinates |
color | The color of the rectangle (rgb) |
shade | A pointer to the shader that should be used |
tex | A pointer to the texture that should be used (nullptr if none) |
DrawingMode | The GL_DRAWING_MODE that should be used (eg. GL_DYNAMIC_DRAW) |
name | |
textureScale | The factor by which the texture shoulb be scaled (1.0f if nothig is specified) |
Returns | game_object* |