diff --git a/include/dawn/cards/poker/holdem.h b/include/dawn/cards/poker/holdem.h index c5c89ab5..bfc076d9 100644 --- a/include/dawn/cards/poker/holdem.h +++ b/include/dawn/cards/poker/holdem.h @@ -26,9 +26,9 @@ #define HOLDEM_STATE_SHOWING 0x02 #define HOLDEM_GAME_FRAME_HEIGHT RENDER_STATE.height -#define HOLDEM_GAME_FRAME_LEFT_WIDTH RENDER_STATE.width*0.75 +#define HOLDEM_GAME_FRAME_LEFT_WIDTH RENDER_STATE.width*0.65 #define HOLDEM_GAME_FRAME_RIGHT_WIDTH (\ - RENDER_STATE.width - HOLDEM_GAME_FRAME_LEFT_WIDTH\ + RENDER_STATE.width - HOLDEM_GAME_FRAME_LEFT_WIDTH - 1\ ) diff --git a/src/card/poker/holdemgame.c b/src/card/poker/holdemgame.c index 7ebee0a7..b2fa6963 100644 --- a/src/card/poker/holdemgame.c +++ b/src/card/poker/holdemgame.c @@ -44,16 +44,12 @@ void holdemGameUpdate() { // Render things on the left frame buffer frameBufferUse(HOLDEM_GAME_STATE.frameLeft, true); - cameraPerspective(&HOLDEM_GAME_STATE.cameraLeft, 45, + cameraPerspective(&HOLDEM_GAME_STATE.cameraLeft, 75, ((float)lWidth/height), 0.25f, 100.0f ); cameraLookAt(&HOLDEM_GAME_STATE.cameraLeft, 5, 5, 5, 0, 0, 0); shaderUseCamera(GAME_STATE.shaderWorld, &HOLDEM_GAME_STATE.cameraLeft); - - shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.texture); - shaderUsePosition(GAME_STATE.shaderWorld, 0, 0, 0, TIME_STATE.current, TIME_STATE.current, 0); - primitiveDraw(HOLDEM_GAME_STATE.cube, 0, -1); - + holdemRenderWorld(); // Render things on the right frame buffer @@ -61,13 +57,9 @@ void holdemGameUpdate() { cameraPerspective(&HOLDEM_GAME_STATE.cameraRight, 45, ((float)rWidth/height), 0.25f, 100.0f ); - cameraLookAt(&HOLDEM_GAME_STATE.cameraRight, 2, 0, 2, 0, 0, 0); + cameraLookAt(&HOLDEM_GAME_STATE.cameraRight, 0, 5, 5, 0, 0, 0); shaderUseCamera(GAME_STATE.shaderWorld, &HOLDEM_GAME_STATE.cameraRight); - - shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.texture); - shaderUsePosition(GAME_STATE.shaderWorld, 0, 0, 0, TIME_STATE.current, TIME_STATE.current, 0); - primitiveDraw(HOLDEM_GAME_STATE.cube, 0, -1); - + holdemRenderWorld(); // Finally, render the frame buffers to the back buffer. @@ -82,7 +74,9 @@ void holdemGameUpdate() { shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.frameLeft->texture); primitiveDraw(HOLDEM_GAME_STATE.quadLeft, 0, -1); // R - shaderUsePosition(GAME_STATE.shaderWorld, lWidth, 0, 0, 0, 0, 0); + shaderUsePosition(GAME_STATE.shaderWorld, + RENDER_STATE.width-rWidth, 0, 0, 0, 0, 0 + ); shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.frameRight->texture); primitiveDraw(HOLDEM_GAME_STATE.quadRight, 0, -1); } \ No newline at end of file diff --git a/src/card/poker/holdemgame.h b/src/card/poker/holdemgame.h index 6c6d7224..dccf99b1 100644 --- a/src/card/poker/holdemgame.h +++ b/src/card/poker/holdemgame.h @@ -8,6 +8,7 @@ #pragma once #include #include "holdem.h" +#include "render/holdemrender.h" #include "../../display/framebuffer.h" #include "../../display/primitive.h" #include "../../display/shader.h" diff --git a/src/card/poker/render/holdemrender.c b/src/card/poker/render/holdemrender.c new file mode 100644 index 00000000..a454d2b8 --- /dev/null +++ b/src/card/poker/render/holdemrender.c @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2021 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include "holdemrender.h" + +void holdemRenderWorld() { + shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.texture); + shaderUsePosition(GAME_STATE.shaderWorld, 0, 0, 0, 0, 0, 0); + shaderUsePosition(GAME_STATE.shaderWorld, 0, 0, 0, TIME_STATE.current, TIME_STATE.current, 0); + primitiveDraw(HOLDEM_GAME_STATE.cube, 0, -1); +} \ No newline at end of file diff --git a/src/card/poker/render/holdemrender.h b/src/card/poker/render/holdemrender.h new file mode 100644 index 00000000..e377ec54 --- /dev/null +++ b/src/card/poker/render/holdemrender.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2021 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include +#include "../../../display/shader.h" +#include "../../../display/primitive.h" + +void holdemRenderWorld(); \ No newline at end of file