polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

rogue.h (823B)


      1 #pragma once
      2 
      3 #include "geometry.h"
      4 #include "orbit.h"
      5 #include "entity.h"
      6 #include "node.h"
      7 #include "engine.h"
      8 
      9 struct common_vars {
     10 // int diffuse_on;
     11 	float depth_mvp[MAT4_ELEMS];
     12 	// mat4 *depth_vp;
     13 	float model_view[MAT4_ELEMS];
     14 	float mvp[MAT4_ELEMS];
     15 	float normal_matrix[MAT4_ELEMS];
     16 	// float time;
     17 	// float ambient_str;
     18 	float *camera_position;
     19 };
     20 
     21 enum shader_programs {
     22 	GRID_PROGRAM,
     23 	NUM_ROGUE_PROGRAMS,
     24 };
     25 
     26 struct grid
     27 {
     28 	struct geometry geom;
     29 	int items_tilemap;
     30 };
     31 
     32 struct rogue_game
     33 {
     34 	struct grid grid;
     35 	struct entity_id player;
     36 	struct common_vars common_vars;
     37 
     38 	struct orbit orbit_camera;
     39 	float time;
     40 	struct node_id camera_node_id;
     41 
     42 	float ortho[MAT4_ELEMS];
     43 };
     44 
     45 int init_rogue_game(struct engine *engine, struct rogue_game *game);
     46 void rogue_frame(struct engine *engine, struct rogue_game *game);