This commit is contained in:
2021-05-20 07:47:03 -07:00
parent e2274ea8bf
commit 3a867f9ad6
12 changed files with 434 additions and 4 deletions

View File

@ -42,6 +42,9 @@ void actionRoundInit(int32_t index, void *data) {
player->cardCount = 0;
player->currentBet = 0;
player->chips = 1000;
player->currentBet = 1000;
}
// Next action

23
src/poker/render/chip.c Normal file
View File

@ -0,0 +1,23 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "chip.h"
void holdemRenderChipInit() {
GAME_STATE.chipPrimitive = pokerChipCreate();
GAME_STATE.chipTexture = assetTextureLoad("pokerchip.png");
}
void holdemRenderChip() {
shaderUsePositionAndScale(GAME_STATE.shaderWorld,
0, 0.05, -0.6,
0, 0, 0,
0.2, 0.2, 0.2
);
shaderUseTexture(GAME_STATE.shaderWorld, GAME_STATE.chipTexture);
primitiveDraw(GAME_STATE.chipPrimitive, 0, -1);
}

23
src/poker/render/chip.h Normal file
View File

@ -0,0 +1,23 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <dawn/dawn.h>
#include "../../assets/models/pokerchip.h"
#include "../../file/asset.h"
#include "../../display/shader.h"
#include "../../display/texture.h"
/**
* Init the poker chips renderer for each player.
*/
void holdemRenderChipInit();
/**
* Render the poker chips.
*/
void holdemRenderChip();

View File

@ -61,13 +61,24 @@ void holdemRenderFrameUseLeft() {
void holdemRenderFrameUseRight() {
glClearColor(0.3, 0.3, 0, 1);
frameBufferUse(GAME_STATE.frameRight, true);
cameraPerspective(&GAME_STATE.cameraRight, 45,
// cameraPerspective(&GAME_STATE.cameraRight, 45,
// (
// (float)GAME_STATE.frameRight->texture->width /
// (float)GAME_STATE.frameRight->texture->height
// ), 0.2f, 1000.0f
// );
// cameraLookAt(&GAME_STATE.cameraRight, 0, 3, 3, 0, 0, 0);
cameraPerspective(&GAME_STATE.cameraRight, 15,
(
(float)GAME_STATE.frameRight->texture->width /
(float)GAME_STATE.frameRight->texture->height
), 0.2f, 1000.0f
);
cameraLookAt(&GAME_STATE.cameraRight, 0, 3, 3, 0, 0, 0);
cameraLookAt(&GAME_STATE.cameraRight, 0, 1, -8, 0, 0, 0);
shaderUseCamera(GAME_STATE.shaderWorld, &GAME_STATE.cameraRight);
}

View File

@ -48,4 +48,6 @@ void holdemRenderWorld() {
holdemRenderCardForSeat(seat, player->cards[j], HOLDEM_GAME_CARD_SLOT_HAND0+j);
}
}
holdemRenderChip();
}

View File

@ -9,6 +9,7 @@
#include <dawn/dawn.h>
#include "player.h"
#include "card.h"
#include "chip.h"
#include "../../assets/models/pokertable.h"
/**