This commit is contained in:
2021-04-20 18:44:41 +10:00
parent 23963f2ee8
commit c10754f31b
14 changed files with 278 additions and 290 deletions

View File

@ -30,6 +30,7 @@ game_t * gameInit(platform_t *platform) {
// Load the world
game->world = worldLoad("testworld/");
playerCreate(&game->world->entities, 0);
// Pass to the main game to handle
return game;
@ -45,7 +46,10 @@ uint32_t gameUpdate(game_t *game) {
// Prepare for rendering
shaderUse(game->shader);
shaderUseCamera(game->shader, game->camera);
worldRender(game->world, game->shader, game->camera);
worldRender(game->world,
game->shader, game->camera,
game->engine->input
);
return 0;
}

View File

@ -13,6 +13,8 @@
#include "../display/shader.h"
#include "../world/world.h"
#include "../world/entity/player.h"
/////////////////////////////////// CONSTANTS //////////////////////////////////
/** Name of the Game */
#define GAME_NAME "Dawn Game"
@ -27,13 +29,14 @@
/////////////////////////////// TYPE DEFINITIONS ///////////////////////////////
/** Information about the current game context. */
typedef struct {
typedef struct game_t {
/** The engine context for the game */
engine_t *engine;
/** Rendering items */
camera_t *camera;
shader_t *shader;
world_t *world;
} game_t;