53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
/**
|
|
* Copyright (c) 2021 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
#include "holdemgame.h"
|
|
|
|
holdemgame_t HOLDEM_GAME_STATE;
|
|
|
|
void holdemGameInit() {
|
|
// Font
|
|
HOLDEM_GAME_STATE.fontTexture = assetTextureLoad("font.png");
|
|
HOLDEM_GAME_STATE.fontTileset = tilesetCreate(20, 20,
|
|
HOLDEM_GAME_STATE.fontTexture->width,
|
|
HOLDEM_GAME_STATE.fontTexture->height,
|
|
1, 1, 1, 1
|
|
);
|
|
HOLDEM_GAME_STATE.fontBatch = spriteBatchCreate(1024);
|
|
|
|
// Prepare the renderer.
|
|
holdemRenderFrameInit();
|
|
holdemRenderSceneInit();
|
|
holdemRenderPlayerInit();
|
|
holdemRenderCardInit();
|
|
|
|
// Prepare the action manager
|
|
holdemActionInit();
|
|
|
|
// Start the first action
|
|
holdemActionAdd(actionStart());
|
|
}
|
|
|
|
void holdemGameUpdate() {
|
|
// Update the frame buffers and action queue
|
|
holdemRenderFrameUpdate();
|
|
holdemActionUpdate();
|
|
|
|
// Render things on the left frame buffer
|
|
holdemRenderFrameUseLeft();
|
|
holdemRenderWorld();
|
|
|
|
// Render things on the right frame buffer
|
|
holdemRenderFrameUseRight();
|
|
holdemRenderWorld();
|
|
|
|
// Finally, render the frame buffers to the back buffer.
|
|
holdemRenderFrameBack();
|
|
}
|
|
|
|
void holdemGameDispose() {
|
|
holdemActionDispose();
|
|
} |