I am building a two-player(CPU-User) Poker Application with C++ and OpenGL. Currently the application just renders the graphics, keeps track of which button is pressed, value entered in textbox something like below.
while(true){
button.draw();
textbox.draw();
cards.draw();//draws cards based on the Mesh index, hard-coded atm
}
I have separately written the game logic which handles hand ranking, turn-by-turn play , settlement of the pot etc.,
How should this interaction happen between the rendering and game logic happen?
The rendering constantly draws button hover, textbox content etc as this is OpenGL and polls for events, whereas the game logic is awaiting an input to proceed forward.
I am asking asking how the program should be structured that facilitates this and this is the focus of my question.