Files
NepuShiro d3ea4e5e99
Build libsm64 / Build libsm64 for linux (push) Successful in 30s
Build libsm64 / Build libsm64 for web (push) Successful in 30s
Build libsm64 / Build libsm64 for windows (push) Successful in 23s
Reformat to something more readable for me :3
2026-05-24 12:13:35 -05:00

68 lines
1.1 KiB
C

#ifndef RENDERER_H
#define RENDERER_H
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "../src/libsm64.h"
#ifdef __cplusplus
}
#endif
#include "context.h"
#include "cglm.h"
typedef struct CollisionMesh
{
size_t num_vertices;
float *position;
float *normal;
float *color;
uint16_t *index;
GLuint vao;
GLuint position_buffer;
GLuint normal_buffer;
}
CollisionMesh;
typedef struct MarioMesh
{
size_t num_vertices;
uint16_t *index;
GLuint vao;
GLuint position_buffer;
GLuint normal_buffer;
GLuint color_buffer;
GLuint uv_buffer;
}
MarioMesh;
typedef struct RenderState
{
CollisionMesh collision;
MarioMesh mario;
GLuint world_shader;
GLuint mario_shader;
GLuint mario_texture;
}
RenderState;
struct Renderer
{
void (*init)(RenderState *renderState, uint8_t *marioTexture);
void (*draw)(RenderState *renderState, const vec3 camPos, const struct SM64MarioState *marioState, struct SM64MarioGeometryBuffers *marioGeo);
};
#endif