2021-11-30 21:29:18 -06:00
|
|
|
#ifndef OPENGL_RENDER_H
|
|
|
|
#define OPENGL_RENDER_H
|
|
|
|
|
2023-05-12 13:22:05 -05:00
|
|
|
#include "sokol/sokol_gfx.h"
|
|
|
|
#include "HandmadeMath.h"
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
struct mCamera;
|
2022-11-03 16:58:03 -05:00
|
|
|
struct window;
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2022-11-19 17:13:57 -06:00
|
|
|
extern struct shader *spriteShader;
|
|
|
|
extern struct shader *animSpriteShader;
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2023-05-12 13:22:05 -05:00
|
|
|
extern sg_image ddimg;
|
|
|
|
|
2022-11-17 16:48:20 -06:00
|
|
|
extern struct sprite *tsprite;
|
2021-11-30 21:29:18 -06:00
|
|
|
|
|
|
|
extern int renderMode;
|
|
|
|
|
2023-05-12 13:22:05 -05:00
|
|
|
extern HMM_Vec3 dirl_pos;
|
|
|
|
|
2023-05-04 17:07:00 -05:00
|
|
|
extern float projection[16];
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
extern float gridScale;
|
|
|
|
extern float smallGridUnit;
|
|
|
|
extern float bigGridUnit;
|
|
|
|
extern float gridSmallThickness;
|
|
|
|
extern float gridBigThickness;
|
|
|
|
extern float gridBigColor[];
|
|
|
|
extern float gridSmallColor[];
|
|
|
|
extern float gridOpacity;
|
|
|
|
extern float editorFOV;
|
|
|
|
extern float shadowLookahead;
|
|
|
|
extern char objectName[];
|
2023-05-04 17:07:00 -05:00
|
|
|
extern int debugColorPickBO;
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2022-11-19 17:13:57 -06:00
|
|
|
extern struct gameobject *selectedobject;
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2022-12-22 16:58:06 -06:00
|
|
|
#include <chipmunk/chipmunk.h>
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
enum RenderMode {
|
|
|
|
LIT,
|
|
|
|
UNLIT,
|
|
|
|
WIREFRAME,
|
|
|
|
DIRSHADOWMAP,
|
|
|
|
OBJECTPICKER
|
|
|
|
};
|
|
|
|
|
2022-02-01 14:50:25 -06:00
|
|
|
void openglInit();
|
2022-11-03 16:58:03 -05:00
|
|
|
void openglRender(struct window *window);
|
2023-02-16 16:13:07 -06:00
|
|
|
void opengl_rendermode(enum RenderMode r);
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2022-11-03 16:58:03 -05:00
|
|
|
void openglInit3d(struct window *window);
|
|
|
|
void openglRender3d(struct window *window, struct mCamera *camera);
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2022-12-21 19:24:59 -06:00
|
|
|
void debug_draw_phys(int draw);
|
|
|
|
|
2022-12-22 16:58:06 -06:00
|
|
|
void set_cam_body(cpBody *body);
|
|
|
|
cpVect cam_pos();
|
2023-02-20 16:28:07 -06:00
|
|
|
float cam_zoom();
|
2022-12-22 16:58:06 -06:00
|
|
|
void add_zoom(float val);
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
#endif
|