Vulkan2D
2D renderer written in C using Vulkan and SDL2
|
User-level camera things. More...
#include "VK2D/Structs.h"
Go to the source code of this file.
Functions | |
VK2DCameraIndex | vk2dCameraCreate (VK2DCameraSpec spec) |
Creates a new camera and returns the index, or returns VK2D_INVALID_CAMERA if no more cameras can be created. More... | |
void | vk2dCameraUpdate (VK2DCameraIndex index, VK2DCameraSpec spec) |
Updates a camera with new positional data. More... | |
VK2DCameraSpec | vk2dCameraGetSpec (VK2DCameraIndex index) |
Returns the spec of a specified camera. More... | |
void | vk2dCameraSetState (VK2DCameraIndex index, VK2DCameraState state) |
Sets the state of a camera. More... | |
VK2DCameraState | vk2dCameraGetState (VK2DCameraIndex index) |
Gets the state of a camera. More... | |
User-level camera things.
VK2DCameraIndex vk2dCameraCreate | ( | VK2DCameraSpec | spec | ) |
Creates a new camera and returns the index, or returns VK2D_INVALID_CAMERA if no more cameras can be created.
spec | Initial state for the camera |
Cameras are created in the state cs_Normal
.
VK2DCameraSpec vk2dCameraGetSpec | ( | VK2DCameraIndex | index | ) |
Returns the spec of a specified camera.
index | Index of the camera to return |
VK2DCameraState vk2dCameraGetState | ( | VK2DCameraIndex | index | ) |
Gets the state of a camera.
index | Index of the camera to get the state of |
void vk2dCameraSetState | ( | VK2DCameraIndex | index, |
VK2DCameraState | state | ||
) |
Sets the state of a camera.
index | Index of the camera to update |
state | The new state of the camera, if its cs_Deleted the camera is completely invalidated |
Cameras are automatically deleted with the renderer, there is no need to free each one yourself
void vk2dCameraUpdate | ( | VK2DCameraIndex | index, |
VK2DCameraSpec | spec | ||
) |
Updates a camera with new positional data.
index | Index of the camera to update (camera must not be in the state cs_Deleted ) |
spec | New camera spec to apply |
This can be called at any time, but the actual camera is only updated whenever vk2dRendererStartFrame
is called. Any calls to this function will only be visible the next time vk2dRendererStartFrame
is called. If wOnScreen
or hOnScreen
is 0, it will be replaced with the window width/height.