Restored some of the rendering

This commit is contained in:
2021-05-22 14:18:23 -07:00
parent 58e86d160e
commit d84e760c34
36 changed files with 813 additions and 331 deletions

View File

@ -10,72 +10,28 @@
bool gameInit(game_t *game) {
// Init the game
game->name = GAME_NAME;
// Init the engine and the rendering pipeline
engineInit(&game->engine, game);
// assetShaderLoad(&game->shader,"shaders/textured.vert","shaders/textured.frag");
// assetTextureLoad(&game->texture, "cards_normal.png");
// cubeInit(&game->primitive, 1, 1, 1);
// Hand off to the poker logic.
pokerInit(&game->poker);
// // Load the world shader.
// GAME_STATE.shaderWorld = assetShaderLoad(
// "shaders/textured.vert", "shaders/textured.frag"
// );
// // Font
// GAME_STATE.fontTexture = assetTextureLoad("font.png");
// GAME_STATE.fontTileset = tilesetCreate(20, 20,
// GAME_STATE.fontTexture->width,
// GAME_STATE.fontTexture->height,
// 1, 1, 1, 1
// );
// GAME_STATE.fontBatch = spriteBatchCreate(1024);
// // Prepare the renderer.
// pokerInit(&GAME_STATE.poker);
// holdemRenderFrameInit();
// holdemRenderWorldInit();
// holdemRenderPlayerInit();
// holdemRenderCardInit();
// holdemRenderChipInit();
// Init the input manger.
return true;
}
bool gameUpdate(game_t *game, float platformDelta) {
// Let the engine do its thing.
engineUpdateStart(&game->engine, game, platformDelta);
cameraPerspective(&game->camera, 75,
((float)game->engine.render.width)/((float)game->engine.render.height),
0.01, 1000
);
cameraLookAt(&game->camera, 3, 3, 3, 0, 0, 0);
shaderUse(&game->shader);
shaderUseTexture(&game->shader, &game->texture);
shaderUseCamera(&game->shader, &game->camera);
shaderUsePosition(&game->shader, 0, 0, 0, 0, game->engine.time.current, 0);
primitiveDraw(&game->primitive, 0, -1);
// Hand off to the poker logic
pokerUpdate(&game->poker, &game->engine.render);
// shaderUse(GAME_STATE.shaderWorld);// TODO: remove
// // Update the frame buffers and action queue
// holdemRenderFrameUpdate();
// pokerActionUpdate();
// // Render things on each frame, then render those frames.
// holdemRenderFrameUseLeft();
// holdemRenderWorld();
// holdemRenderFrameUseRight();
// holdemRenderWorld();
// holdemRenderFrameBack();
// Hand back to the engine.
return engineUpdateEnd(&game->engine, game);
}
void gameDispose(game_t *game) {
pokerDispose(&game->poker);
engineDispose(&game->engine, game);
// pokerActionDispose();
// shaderDispose(GAME_STATE.shaderWorld);
}

View File

@ -6,14 +6,7 @@
#pragma once
#include <dawn/dawn.h>
#include "../engine/engine.h"
#include "../file/asset.h"
#include "../display/render.h"
#include "../display/primitive.h"
#include "../display/primitives/cube.h"
#include "../display/texture.h"
#include "../display/shader.h"
#include "../display/camera.h"
#include "../poker/poker.h"
/**
* Initialize the game context.