From b1389bad67cccd3da6815c2d5a436c177f09594b Mon Sep 17 00:00:00 2001 From: pryazha Date: Wed, 19 Mar 2025 08:46:04 +0500 Subject: window, texture, model, camera and gui (silly button) --- prge_types.h | 128 +++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 98 insertions(+), 30 deletions(-) (limited to 'prge_types.h') diff --git a/prge_types.h b/prge_types.h index ff5b860..1799870 100644 --- a/prge_types.h +++ b/prge_types.h @@ -1,50 +1,118 @@ #ifndef PRGE_TYPES_H #define PRGE_TYPES_H -enum KeyState_Enum { - KeyState_RELEASE = 0, - KeyState_PRESS = 1 -}; +#define MAX_TEXTURE 5 typedef struct { - enum KeyState_Enum last; - enum KeyState_Enum state; + S32 width; + S32 height; + Str8 name; +} Window; + +typedef enum { + KeyState_RELEASE = 0, + KeyState_PRESS = 1 +} KeyStateEnum; + +typedef struct { + KeyStateEnum last; + KeyStateEnum state; } Key; typedef struct { - V2 mouse_pos; - V2 last_mouse_pos; - V2 mouse_offset; - B32 first_mouse; + V2 mouse_pos; + V2 last_mouse_pos; + V2 mouse_offset; + B32 first_mouse; + B32 capture_mouse; + Key mouse_left; + Key mouse_right; - B32 is_running; + B32 is_running; - F32 dt; + F32 dt; - Key move_right; - Key move_forward; - Key move_left; - Key move_backward; - Key move_up; - Key move_down; - Key jump; - Key action_right; - Key action_up; - Key action_left; - Key action_down; - Key exit; + Key move_right; + Key move_forward; + Key move_left; + Key move_backward; + Key move_up; + Key move_down; + Key jump; + Key action_right; + Key action_up; + Key action_left; + Key action_down; + Key exit; } Input; +typedef enum { + TextureType_R = 1, + TextureType_RGB = 3, + TextureType_RGBA = 4 +} TextureTypeEnum; + typedef struct { - V3 pos; + U32 id; + Str8 name; + + TextureTypeEnum type; + + S32 width; + S32 height; + + void *data; +} Texture; + +typedef struct { + V3 pos; + V2 texc; } Vertex; typedef struct { - Vertex *verts; - U32 nverts; - U32 *indices; - U32 nindices; - U32 vao, vbo, ebo; + V3 origin; + V3 rotate; + + U32 nverts; + Vertex *verts; + + U32 nindices; + U32 *indices; + + U32 ntextures; + Texture textures[MAX_TEXTURE]; + + U32 vao, vbo, ebo; } Mesh; +typedef struct { + V3 origin; + V3 rotate; + + U32 nmeshes; + Mesh *meshes; +} Model; + +typedef struct { + V3 pos; + + F32 fov; + + F32 near; + F32 far; + + F32 yaw; + F32 pitch; + F32 roll; +} Camera; + +typedef struct { + U32 nmodels; + Model *models; + + Camera camera; + + Str8 bindir; +} PRGEState; + #endif /* PRGE_TYPES_H */ -- cgit v1.2.3-70-g09d2