To avoid issues with sprite priorities and having to use the
dbDrawSpritesFirst function, so that text and other 2-D elements display over the background, I would use an image for the background. Other than that, you’re gold. This little example only scrolls horizontally.
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
// define global variables
int screenx;
// the main entry point for the application is this function
void DarkGDK()
{
// turn on sync rate/VSync is active by default
dbSyncOn();
// load background image
dbLoadImage("mario.png", 1, 1);
// our main loop
while (LoopGDK())
{
// calculate screenx value and paste the image
screenx = screenx+(dbLeftKey()*(screenx<0)-dbRightKey()*(screenx>-6528))*4;
dbPasteImage(1, screenx, 0);
// update the screen
dbSync();
}
// return back to windows
return;
}