Refactoring some of the poker game logic again.

This commit is contained in:
2021-07-27 09:49:54 -07:00
parent a63c9d898b
commit 54559e761c
36 changed files with 99 additions and 304 deletions

45
temp/frame.c Normal file
View File

@ -0,0 +1,45 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "frame.h"
void pokerFrameInit(poker_t *poker, render_t *render) {
frameBufferInit(&poker->frameWorld, render->width, render->height);
frameBufferInit(&poker->frameGui, render->width, render->height);
}
void pokerFrameWorld(poker_t *poker, render_t *render) {
// Update the frame buffer
frameBufferResize(&poker->frameWorld, render->width, render->height);
// Correct the aspect on the perspective camera for the world
cameraPerspective(&poker->cameraWorld, 20,
render->width / render->height,
0.001, 1000
);
shaderUseCamera(&poker->shader, &poker->cameraWorld);
}
void pokerFrameGui(poker_t *poker, render_t *render) {
// Update FB
frameBufferResize(&poker->frameGui, render->width, render->height);
poker->guiWidth = ((float)POKER_GUI_HEIGHT/render->height) * render->width;
// frameBufferUse(&poker->frameGui, true);
// Correct aspect on the ortho camera
cameraOrtho(&poker->cameraGui,
0, poker->guiWidth,
POKER_GUI_HEIGHT, 0,
0.01, 100
);
cameraLookAt(&poker->cameraGui, 0, 0, 5, 0, 0, 0);
shaderUseCamera(&poker->shader, &poker->cameraGui);
}
void pokerFrameRender(poker_t *poker, render_t *render) {
}