The first thing I can tell you is that code snippet I gave you is for your game loop in the "void DarkGDK()" function definition, it is not supposed to be it's own function.
You see, those if statement in that "while (LoopGDK())" Loop are supposed to tell the program what to do when the game is paused and when it is not.
All you need to do is just slightly modify your game loop to reflect this method.
Just put the paused game code in the "if (isPaused)" section, and the actual game code in the "else" section of that one if statement.
Here, let me illustrate an example of proper usage:
#include "DarkGDK.h"
// Pause key is the "P" key
#define PAUSE_KEY 25
void DarkGDK() {
dbSyncOn();
dbSyncRate(60);
bool isPaused = false;
int timer = dbTimer();
int var = 0;
while (LoopGDK()) {
dbCLS();
if (dbKeyState(PAUSE_KEY) && (dbTimer() > timer + 500)) {
timer = dbTimer();
if (!isPaused)
isPaused = true;
else
isPaused = false;
}
if (isPaused) {
// Pause Code
dbText(dbScreenWidth() / 2 - 75, dbScreenHeight() / 2, "Game Paused");
dbText(dbScreenWidth() / 2 - 125, dbScreenHeight() / 2 + 12, "Press \"P\" Key to contine.");
} else {
// Game Code
dbCircle(dbScreenWidth() /2, dbScreenHeight() / 2, (int) (dbSin(var) * 200));
var++;
}
dbSync();
}
return;
}
Where you place the dbCLS() and dbSync() code is up to you, like if you place it right, you can have that "Game Paused" message over a freeze frame of the game. Or like in the example above, it cuts to a blank screen.
http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.