Enable effects back

This commit is contained in:
Shinovon 2026-05-03 07:05:34 +05:00
parent 0ad6fe45d1
commit 2b8a26d4d7
3 changed files with 19 additions and 23 deletions

View file

@ -25,14 +25,6 @@ Shader *im2dOverrideShader;
static int32 u_xform;
static Shader *im2dShader;
static AttribDesc im2dattribDesc[3] = {
{ ATTRIB_POS, GL_FLOAT, GL_FALSE, 4,
sizeof(Im2DVertex), 0 },
{ ATTRIB_COLOR, GL_UNSIGNED_BYTE, GL_TRUE, 4,
sizeof(Im2DVertex), offsetof(Im2DVertex, r) },
{ ATTRIB_TEXCOORDS0, GL_FLOAT, GL_FALSE, 2,
sizeof(Im2DVertex), offsetof(Im2DVertex, u) },
};
static int primTypeMap[] = {
GL_POINTS, // invalid
@ -100,9 +92,13 @@ im2DSetXform(void)
// glUniform4fv(currentShader->uniformLocations[u_xform], 1, xform);
}
extern "C" int im2d;
extern "C" int im3d;
void
im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices)
{
im2d++;
if(im2dOverrideShader)
im2dOverrideShader->use();
else
@ -134,6 +130,7 @@ im2DRenderIndexedPrimitive(PrimitiveType primType,
void *vertices, int32 numVertices,
void *indices, int32 numIndices)
{
im2d++;
if(im2dOverrideShader)
im2dOverrideShader->use();
else
@ -166,16 +163,7 @@ im2DRenderIndexedPrimitive(PrimitiveType primType,
static Shader *im3dShader;
static AttribDesc im3dattribDesc[3] = {
{ ATTRIB_POS, GL_FLOAT, GL_FALSE, 3,
sizeof(Im3DVertex), 0 },
{ ATTRIB_COLOR, GL_UNSIGNED_BYTE, GL_TRUE, 4,
sizeof(Im3DVertex), offsetof(Im3DVertex, r) },
{ ATTRIB_TEXCOORDS0, GL_FLOAT, GL_FALSE, 2,
sizeof(Im3DVertex), offsetof(Im3DVertex, u) },
};
static uint32 im3DVbo, im3DIbo;
static int32 num3DVertices; // not actually needed here
static int32 num3DVertices;
static void* currentIm3dVertices;
void
@ -219,6 +207,7 @@ im3DTransform(void *vertices, int32 numVertices, Matrix *world, uint32 flags)
void
im3DRenderPrimitive(PrimitiveType primType)
{
im3d++;
flushCache();
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
@ -242,6 +231,7 @@ im3DRenderPrimitive(PrimitiveType primType)
void
im3DRenderIndexedPrimitive(PrimitiveType primType, void *indices, int32 numIndices)
{
im3d++;
flushCache();
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);