-
-
Notifications
You must be signed in to change notification settings - Fork 8
[U] Windows, Renderer and Input
The window interface gives the programmer access to all functions related to updating the state of the window. Functions are accessed through the UVK::Window
class.
Returns the window size as an FVector2
using the default size formatting
Sets the title to some text
Returns a boolean you can check if the window is at full screen
Returns the name of the window
Returns the location of the window icon
Controls everything related to the renderer settings and functionality. Renderer settings need to be changed, and the program needs to be restarted for changes to take effect. Functions are accessed by the UVK::Renderer
class.
Used to switch between the 2 renderer APIs the engine uses(Vulkan and OpenGL). WARNING: SOON TO BE REMOVED DUE TO THE OPENGL RENDERER BEING OBSOLETE
Returns a reference to a boolean. The boolean controls weather V-Sync is on or off.
Returns a reference to a boolean. The boolean controls weather we are rendering frames immediately to the screen, or we generally adhere to vertical blanks. If it is on all frames will immediately be rendered to the screen, this however, may cause screen tearing. If it is off, then the renderer will mostly adhere to vertical blanks, which can help with visual stutter on applications with almost constant frame rate.
Same as the function in the UVK::SettingsManager
class
The input interface provides useful functions for interacting with the input system. Functions are accessed by the UVK::Input
class.
The uint8_t getKey(uint16_t key)
function returns a uint8_t
flag, when given a key from the Keys
namespace as an argument. When compared with one of the key events in keys like:
constexpr uint8_t KeyReleased = 0;
constexpr uint8_t KeyPressed = 1;
constexpr uint8_t KeyRepeat = 2;
The return value can be used to check for input events. The getKey
function only responds to actual keys and not to input actions, and additionally these keys are layout independent.
Given a string containing the name of an action the const InputAction& getAction(const std::string& name)
function reference to an input action if one is found, if not then the engine will respond with an error message in the console and will crash the application. If the input was valid, an InputAction
will be returned, which can be used to check for the same input events as the getKey
function. Additionally, input actions can be rebound to any key on the keyboard but are still layout independent
Returns the list of all currently active input actions
The FVector2 getMousePositionChange()
function returns an FVector2
containing the change of the mouse position between the current and previous frame
The FVector2 getCurrentMousePosition()
function returns the current frame's mouse position
The FVector2 getLastMousePosition()
function returns the last frame's mouse position
Returns an FVector2
containing the scroll velocity of the user. Can be either vertical or horizontal scroll, which is why it returns an FVector2
This project is supported by all the people who joined our discord server and became beta testers. If you want to join the discord you can click here
- Home
- Beginner concepts
- Advanced concepts
- Engine developer and contributor resources