I was trying to use the basic2d funcitons to draw to a bitmap, but I noticed the said bitmap is not drawn to the screen. If I set the current bitmap to 0 (the screen) it draws fine, but does not on the current bitmap. Below is the code that works, but draws to the screen and not a bitmap.
#include "DarkGDK.h"
int red = 0;
int green = 0;
int blue = 0;
int drawcol;
char* color;
void DarkGDK ( void )
{
dbAlwaysActiveOn();
dbSetDisplayMode(800, 600, 32);
DWORD black = dbRGB(0,0,0);
DWORD white = dbRGB(255,255,255);
drawcol = black;
dbInk( drawcol, black );
dbCLS( white );
while ( LoopGDK ( ) )
{
if (dbMouseClick() == 1)
{
dbCircle(dbMouseX(), dbMouseY(), 10);
}
else if(dbShiftKey())
{
color = dbInput();
red = dbVal( color );
color = dbInput();
green = dbVal(color);
color = dbInput();
blue = dbVal(color);
drawcol = dbRGB(red, green, blue);
dbInk(drawcol, black);
}
dbWait(1);
}
return;
}
Below is the code that does not work.
#include "DarkGDK.h"
int red = 0;
int green = 0;
int blue = 0;
int drawcol;
char* color;
void DarkGDK ( void )
{
dbAlwaysActiveOn();
dbSetDisplayMode(800, 600, 32);
dbCreateBitmap(1, 800, 600);
dbSetCurrentBitmap(1);
DWORD black = dbRGB(0,0,0);
DWORD white = dbRGB(255,255,255);
drawcol = black;
dbInk( drawcol, black );
dbCLS( white );
while ( LoopGDK ( ) )
{
if (dbMouseClick() == 1)
{
dbCircle(dbMouseX(), dbMouseY(), 10);
}
else if(dbShiftKey())
{
color = dbInput();
red = dbVal( color );
color = dbInput();
green = dbVal(color);
color = dbInput();
blue = dbVal(color);
drawcol = dbRGB(red, green, blue);
dbInk(drawcol, black);
}
dbWait(1);
}
return;
}
and in fact, will prevent any form of visual effects on the screen including any print operations or inputs from dbInput... can anyone help me with this odd problem?