The problem might be that you're only calling dbSync() once before waiting. Ideally one would think this should be enough, but I seem to recall that sometimes you need to double sync before anything will show on screen (might be related to DB using double buffers, thus writing to the first while rendering the second (that hasn't been set yet) to the screen).
Try slapping in an extra dbSync() at the end of your gamesetup()-function.
Otherwise your code looks fine
A word of advice though; calling dbWait() without re-drawing the screen will cause it to appear frozen, ie. dragging it or any other windows over the screen will interfere with the image.
A better approach would be to keep on refreshing the screen and polling the system timer until it tells you the desired amount of time has passed. You can throw in calls to Sleep() in this loop with short time values as well if you want to reduce CPU-load while you're just waiting anyway.
Something like this:
#include <Windows.h> // Needed to access the Sleep()-function
#include <time.h> // Needed to acces the clock()-function
// ... Your code as is should work
void gamesplash() {
size_t timeout = clock() + 5000; // Current time + 5000 milliseconds
while(clock() < timeout) {
dbSync(); // Re-draw the screen
Sleep(1); // Reduce CPU load
}
// When we get here, at least 5 seconds have passed since we entered this function
e_gamestate = e_gamemenu;
}
With this second solution you're continously redrawing the screen, thus a blank buffer at the first frame will quickly be redrawn with the filled buffer version so you won't need an extra dbSync()-call before accessing this function.
"Why do programmers get Halloween and Christmas mixed up?" Because Oct(31) = Dec(25)