Slowly renaming things from Holdem to Poker

This commit is contained in:
2021-05-17 06:13:50 -07:00
parent fbd00b1bc2
commit d956305af7
28 changed files with 253 additions and 223 deletions

View File

@ -13,10 +13,10 @@ void holdemRenderFrameInit() {
// Prepare the two frame buffers.
lWidth = HOLDEM_GAME_FRAME_LEFT_WIDTH, rWidth = HOLDEM_GAME_FRAME_RIGHT_WIDTH;
height = HOLDEM_GAME_FRAME_HEIGHT;
HOLDEM_GAME_STATE.frameLeft = frameBufferCreate(lWidth, height);
HOLDEM_GAME_STATE.frameRight = frameBufferCreate(rWidth, height);
HOLDEM_GAME_STATE.quadLeft = quadCreate(0, 0, 0, 0, 0, lWidth, height, 1, 1);
HOLDEM_GAME_STATE.quadRight = quadCreate(0, 0, 0, 0, 0, rWidth, height, 1, 1);
POKER_STATE.frameLeft = frameBufferCreate(lWidth, height);
POKER_STATE.frameRight = frameBufferCreate(rWidth, height);
POKER_STATE.quadLeft = quadCreate(0, 0, 0, 0, 0, lWidth, height, 1, 1);
POKER_STATE.quadRight = quadCreate(0, 0, 0, 0, 0, rWidth, height, 1, 1);
}
void holdemRenderFrameUpdate() {
@ -25,21 +25,21 @@ void holdemRenderFrameUpdate() {
lWidth = HOLDEM_GAME_FRAME_LEFT_WIDTH, rWidth = HOLDEM_GAME_FRAME_RIGHT_WIDTH;
height = HOLDEM_GAME_FRAME_HEIGHT;
if((
HOLDEM_GAME_STATE.frameLeft->texture->width == lWidth &&
HOLDEM_GAME_STATE.frameLeft->texture->height == height
POKER_STATE.frameLeft->texture->width == lWidth &&
POKER_STATE.frameLeft->texture->height == height
)) return;
// Recreate frame buffers.
frameBufferDispose(HOLDEM_GAME_STATE.frameLeft);
frameBufferDispose(HOLDEM_GAME_STATE.frameRight);
HOLDEM_GAME_STATE.frameLeft = frameBufferCreate(lWidth, height);
HOLDEM_GAME_STATE.frameRight = frameBufferCreate(rWidth, height);
quadBuffer(HOLDEM_GAME_STATE.quadLeft, 0,
frameBufferDispose(POKER_STATE.frameLeft);
frameBufferDispose(POKER_STATE.frameRight);
POKER_STATE.frameLeft = frameBufferCreate(lWidth, height);
POKER_STATE.frameRight = frameBufferCreate(rWidth, height);
quadBuffer(POKER_STATE.quadLeft, 0,
0, 0, 0, 1,
lWidth, height, 1, 0,
0, 0
);
quadBuffer(HOLDEM_GAME_STATE.quadRight, 0,
quadBuffer(POKER_STATE.quadRight, 0,
0, 0, 0, 1,
rWidth, height, 1, 0,
0, 0
@ -48,27 +48,27 @@ void holdemRenderFrameUpdate() {
void holdemRenderFrameUseLeft() {
glClearColor(0.3, 0, 0, 1);
frameBufferUse(HOLDEM_GAME_STATE.frameLeft, true);
cameraPerspective(&HOLDEM_GAME_STATE.cameraLeft, 35,
frameBufferUse(POKER_STATE.frameLeft, true);
cameraPerspective(&POKER_STATE.cameraLeft, 35,
(
(float)HOLDEM_GAME_STATE.frameLeft->texture->width /
(float)HOLDEM_GAME_STATE.frameLeft->texture->height
(float)POKER_STATE.frameLeft->texture->width /
(float)POKER_STATE.frameLeft->texture->height
), 0.2f, 1000.0f
);
shaderUseCamera(GAME_STATE.shaderWorld, &HOLDEM_GAME_STATE.cameraLeft);
shaderUseCamera(GAME_STATE.shaderWorld, &POKER_STATE.cameraLeft);
}
void holdemRenderFrameUseRight() {
glClearColor(0.3, 0.3, 0, 1);
frameBufferUse(HOLDEM_GAME_STATE.frameRight, true);
cameraPerspective(&HOLDEM_GAME_STATE.cameraRight, 45,
frameBufferUse(POKER_STATE.frameRight, true);
cameraPerspective(&POKER_STATE.cameraRight, 45,
(
(float)HOLDEM_GAME_STATE.frameRight->texture->width /
(float)HOLDEM_GAME_STATE.frameRight->texture->height
(float)POKER_STATE.frameRight->texture->width /
(float)POKER_STATE.frameRight->texture->height
), 0.2f, 1000.0f
);
cameraLookAt(&HOLDEM_GAME_STATE.cameraRight, 0, 3, 3, 0, 0, 0);
shaderUseCamera(GAME_STATE.shaderWorld, &HOLDEM_GAME_STATE.cameraRight);
cameraLookAt(&POKER_STATE.cameraRight, 0, 3, 3, 0, 0, 0);
shaderUseCamera(GAME_STATE.shaderWorld, &POKER_STATE.cameraRight);
}
void holdemRenderFrameBack() {
@ -82,12 +82,12 @@ void holdemRenderFrameBack() {
shaderUsePosition(GAME_STATE.shaderWorld,
0, 0, 0, 0, 0, 0
);
shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.frameLeft->texture);
primitiveDraw(HOLDEM_GAME_STATE.quadLeft, 0, -1);
shaderUseTexture(GAME_STATE.shaderWorld, POKER_STATE.frameLeft->texture);
primitiveDraw(POKER_STATE.quadLeft, 0, -1);
shaderUsePosition(GAME_STATE.shaderWorld,
RENDER_STATE.width - HOLDEM_GAME_STATE.frameRight->texture->width,
RENDER_STATE.width - POKER_STATE.frameRight->texture->width,
0, 0, 0, 0, 0
);
shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.frameRight->texture);
primitiveDraw(HOLDEM_GAME_STATE.quadRight, 0, -1);
shaderUseTexture(GAME_STATE.shaderWorld, POKER_STATE.frameRight->texture);
primitiveDraw(POKER_STATE.quadRight, 0, -1);
}