2023-06-17 17:00:55 +00:00
|
|
|
/* date = May 7th 2023 9:49 am */
|
|
|
|
|
|
|
|
#ifndef OPENGL_RENDER_H
|
|
|
|
#define OPENGL_RENDER_H
|
|
|
|
|
2023-08-22 03:19:51 +00:00
|
|
|
#include "opengl_defines.h"
|
|
|
|
#include "generated/opengl_functions.meta.h"
|
2023-06-17 17:00:55 +00:00
|
|
|
|
|
|
|
struct opengl_texture
|
|
|
|
{
|
|
|
|
u32 ID;
|
|
|
|
render_texture_format Format;
|
2023-06-21 16:59:36 +00:00
|
|
|
v2_s32 Dim;
|
2023-06-17 17:00:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct quad_program
|
|
|
|
{
|
|
|
|
u32 ID;
|
|
|
|
|
|
|
|
u32 PID;
|
|
|
|
u32 SourcePID;
|
|
|
|
u32 TextureIndexID;
|
|
|
|
u32 ColorID;
|
|
|
|
u32 ToCenterID;
|
|
|
|
u32 HalfSizeID;
|
|
|
|
u32 CornerRadiusID;
|
|
|
|
u32 EdgeSoftnessID;
|
|
|
|
u32 BorderThicknessID;
|
|
|
|
|
|
|
|
u32 UniformResolutionLocation;
|
|
|
|
};
|
|
|
|
|
2023-08-22 03:19:51 +00:00
|
|
|
struct instanced_quad_program
|
|
|
|
{
|
|
|
|
u32 ID;
|
|
|
|
|
|
|
|
u32 DestID;
|
|
|
|
u32 SourceID;
|
|
|
|
u32 TextureIndexID;
|
|
|
|
u32 ColorID[4];
|
2024-01-20 11:18:57 +00:00
|
|
|
u32 CornerRadiusID[4];
|
2023-08-22 03:19:51 +00:00
|
|
|
u32 EdgeSoftnessID;
|
|
|
|
u32 BorderThicknessID;
|
|
|
|
|
|
|
|
u32 UniformResolutionLocation;
|
|
|
|
};
|
|
|
|
|
2023-06-17 17:00:55 +00:00
|
|
|
struct opengl_context
|
|
|
|
{
|
2023-08-22 03:19:51 +00:00
|
|
|
#if VN_USE_INSTANCING
|
|
|
|
u32 InstancedQuadBuffer;
|
|
|
|
instanced_quad_program InstancedQuadProgram;
|
|
|
|
#else
|
2023-06-17 17:00:55 +00:00
|
|
|
u32 VertexBuffer;
|
|
|
|
u32 IndexBuffer;
|
|
|
|
quad_program QuadProgram;
|
2023-08-22 03:19:51 +00:00
|
|
|
#endif
|
2023-06-17 17:00:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //OPENGL_RENDER_H
|