Vulkan2D
2D renderer written in C using Vulkan and SDL2
ShadowEnvironment.h
Go to the documentation of this file.
1 #pragma once
5 #include "VK2D/Structs.h"
6 #include <SDL2/SDL.h>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
14 VK2DShadowEnvironment vk2DShadowEnvironmentCreate();
15 
18 void vk2DShadowEnvironmentFree(VK2DShadowEnvironment shadowEnvironment);
19 
23 VK2DShadowObject vk2dShadowEnvironmentAddObject(VK2DShadowEnvironment shadowEnvironment);
24 
30 void vk2dShadowEnvironmentObjectSetPos(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object, float x, float y);
31 
42 void vk2dShadowEnvironmentObjectUpdate(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object, float x, float y, float scaleX, float scaleY, float rotation, float originX, float originY);
43 
48 void vk2dShadowEnvironmentObjectSetStatus(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object, bool enabled);
49 
54 bool vk2dShadowEnvironmentObjectGetStatus(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object);
55 
66 void vk2DShadowEnvironmentAddEdge(VK2DShadowEnvironment shadowEnvironment, float x1, float y1, float x2, float y2);
67 
71 void vk2dShadowEnvironmentResetEdges(VK2DShadowEnvironment shadowEnvironment);
72 
76 void vk2DShadowEnvironmentFlushVBO(VK2DShadowEnvironment shadowEnvironment);
77 
78 #ifdef __cplusplus
79 }
80 #endif
VK2DShadowObject vk2dShadowEnvironmentAddObject(VK2DShadowEnvironment shadowEnvironment)
Adds a new object to a shadow environment.
void vk2dShadowEnvironmentObjectSetPos(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object, float x, float y)
Translates a shadow object.
void vk2dShadowEnvironmentObjectUpdate(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object, float x, float y, float scaleX, float scaleY, float rotation, float originX, float originY)
Updates a shadow object.
VK2DShadowEnvironment vk2DShadowEnvironmentCreate()
Creates a new shadow environment.
void vk2DShadowEnvironmentAddEdge(VK2DShadowEnvironment shadowEnvironment, float x1, float y1, float x2, float y2)
Adds an edge to a shadow environment's current object, use this on wall edges.
void vk2dShadowEnvironmentObjectSetStatus(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object, bool enabled)
Updates a shadow object's status.
void vk2DShadowEnvironmentFree(VK2DShadowEnvironment shadowEnvironment)
Frees a shadow environment.
void vk2DShadowEnvironmentFlushVBO(VK2DShadowEnvironment shadowEnvironment)
Flushes the edges present in the environment to a VBO that can be drawn to screen.
bool vk2dShadowEnvironmentObjectGetStatus(VK2DShadowEnvironment shadowEnvironment, VK2DShadowObject object)
Returns a shadow object's status.
void vk2dShadowEnvironmentResetEdges(VK2DShadowEnvironment shadowEnvironment)
Removes all edges from the shadow environment's cache in case you want to change the edges.
Forward declares struct typedefs.
int32_t VK2DShadowObject
Type used for referencing shadow objects.
Definition: Structs.h:182