Added some basic font rendering and texas holdem
This commit is contained in:
@ -9,6 +9,12 @@
|
||||
|
||||
game_t GAME_STATE;
|
||||
|
||||
holdemgame_t holdem;
|
||||
holdemrender_t render;
|
||||
|
||||
texture_t *fontTexture;
|
||||
spritebatch_t *fontBatch;
|
||||
|
||||
bool gameInit() {
|
||||
// Init the game
|
||||
GAME_STATE.name = GAME_NAME;
|
||||
@ -19,13 +25,31 @@ bool gameInit() {
|
||||
inputInit();
|
||||
worldInit();
|
||||
|
||||
holdemGameInit(&holdem);
|
||||
holdemRenderInit(&render);
|
||||
|
||||
holdemRoundInit(&holdem);
|
||||
cardShuffle(holdem.deck, holdem.deckSize);
|
||||
|
||||
// Deal Card
|
||||
holdemDealAll(&holdem, 2);
|
||||
holdemFlop(&holdem);
|
||||
|
||||
fontTexture = assetTextureLoad("font.png");
|
||||
fontBatch = spriteBatchCreate(100);
|
||||
tileset_t *tileset = tilesetCreate(20, 20,
|
||||
fontTexture->width, fontTexture->height,
|
||||
1, 1, 1, 1
|
||||
);
|
||||
|
||||
char *buffer = "!\"#$%";
|
||||
fontSpriteBatchBuffer(fontBatch, tileset, buffer, 0, 0, 0, 1.1, 1.5);
|
||||
|
||||
// Load the world shader.
|
||||
GAME_STATE.shaderWorld = assetShaderLoad(
|
||||
"shaders/test.vert", "shaders/test.frag"
|
||||
);
|
||||
|
||||
entityInit(0x00, 0x01);
|
||||
|
||||
// Init the input manger.
|
||||
return true;
|
||||
}
|
||||
@ -39,16 +63,21 @@ bool gameUpdate(float platformDelta) {
|
||||
shaderUse(GAME_STATE.shaderWorld);
|
||||
|
||||
// Set up the camera.
|
||||
int32_t d = 10;
|
||||
cameraLookAt(&GAME_STATE.cameraWorld, d, d, d, 0, 0, 0);
|
||||
int x = 10;
|
||||
cameraLookAt(&GAME_STATE.cameraWorld, x, 2.5f, 50, x, 2, 0);
|
||||
cameraPerspective(&GAME_STATE.cameraWorld, 45.0f,
|
||||
((float)RENDER_STATE.width) / ((float)RENDER_STATE.height),
|
||||
0.5f, 500.0f
|
||||
);
|
||||
shaderUseCamera(GAME_STATE.shaderWorld, &GAME_STATE.cameraWorld);
|
||||
|
||||
|
||||
|
||||
shaderUseTexture(GAME_STATE.shaderWorld, fontTexture);
|
||||
spriteBatchDraw(fontBatch, 0, -1);
|
||||
|
||||
// holdemRender(&render, &holdem);
|
||||
// Render the game scene.
|
||||
worldRender();
|
||||
// worldRender();
|
||||
|
||||
if(inputIsPressed(INPUT_NULL)) return false;
|
||||
return true;
|
||||
|
@ -14,6 +14,11 @@
|
||||
#include "../world/world.h"
|
||||
#include "../world/entity/entity.h"
|
||||
|
||||
#include "../card/poker/holdem.h"
|
||||
#include "../display/gui/font.h"
|
||||
#include "../display/spritebatch.h"
|
||||
#include "../display/tileset.h"
|
||||
|
||||
/**
|
||||
* Initialize the game context.
|
||||
*
|
||||
|
@ -24,4 +24,5 @@ void gameTimeUpdate(float platformDelta) {
|
||||
TIME_STATE.last = TIME_STATE.current;
|
||||
TIME_STATE.current = TIME_STATE.current + platformDelta;
|
||||
TIME_STATE.delta = TIME_STATE.current - TIME_STATE.last;
|
||||
TIME_STATE.fixedDelta = GAMETIME_FIXED_STEP;
|
||||
}
|
Reference in New Issue
Block a user