It shouldn't matter what graphics library you use. This will work with any game code, regardless of graphics library, OS, platform, etc.
Enumerate 2 variables to hold Major Game states and Minor Game states. In your main game loop use a switch to test for the major states, then a sub switch to test for the minor states (I actually only test for the major states in my main game loop, then calls a function (seperate function for each major state) that has a switch that checks for minor game states).
Here's a generic example:
Code:
//global declares
enum GameState
{gsIntro,gsMenu,gsSettings,gsCombat,gsOptions};
enum SubState
{ss1,ss2,ss3,ss4,ss5,ss6};
GameState MajorState;
SubState MinorState;
//main game loop
void GameLoop()
{
switch(MajorState)
{
case gsIntro:
{
GetIntroInput();
DoIntroBlt();
}break;
case gsMenu:
{
GetMenuInput();
DoMenuBlt();
}break;
case etc. etc. etc.....do the same
}
}
//sample generic minor state check function
void GetMenuInput()
{
switch(MinorState)
{
case ss1:
{
//get mouse/keyboard input for main menu buttons
}break;
case ss2:
{
//get mouse/keyboard input for options menu buttons
}break;
case etc. etc. etc.....
}
}