Actually I wasn't planning on releasing it, but I already have one, lol. In its current state, it just manages 2 stl vector objects. One for the console messages, and another that store a user defined "type" integer that you can use to set or determine what kind of console message it should be.
With that being said, that version was intended to be separate from a graphical console. I did however make a small sample which uses my console library as well as the Dark GDK version of Cloggy's d3dfunc. I'll take a look and see if I can find it real quick then I'll post it.
Edit: Alright, here it is. As I said before, you'll need Cloggy's d3dfunc for Dark GDK for my example but I'd recommend taking the console.h by itself if you plan on using it. That way you can design your own graphic interface to it. One thing i never got around to is creating a console dump function but that could be easily added by just about anyone with a little C knowledge.
// 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
// the main entry point for the application is this function
void DarkGDK ( void )
Console::AddMessage("These messages are being sent to the text console",1);
Console::AddMessage("After that, I use the GConsole namespace to draw it using Cloggy's d3dfunc Library",2);
dbLoadImage("./media/_256.png",1); // change to whatever texture you want to use
float Rot = 0.0;
// our main loop
while ( LoopGDK ( ) )
Rot += 1.0;
dbSync ( );
// return back to windows
using namespace std;
void AddMessage(char* text,int type)
char* GetMessageString(int index)
int GetMessageType(int index)
gconsole.h, my graphical console
int ScrollPosition = 0;
char* Font = "Arial";
int FontSize = 12;
int HorizontalTextOffset = 2;
int VerticalTextOffset = 0;
DWORD BGColor = d3dRGBA(255,255,255,127);
int NumStrings = ScrollPosition / FontSize;
int YOffset = ScrollPosition - FontSize;
int StringOffset = 0;
int VerticalOffset = ScrollPosition - d3dGetTextHeight(1,Console::GetMessageString(Console::MessageQuantity()-1)) - VerticalTextOffset;
if(dbControlKey() && dbDownKey())
GConsole::ScrollPosition += 10;
if(dbControlKey() && dbUpKey())
GConsole::ScrollPosition -= 10;
if(GConsole::ScrollPosition > dbScreenHeight())
GConsole::ScrollPosition = dbScreenHeight();
if(GConsole::ScrollPosition <= 0)
GConsole::ScrollPosition = 0;
for(int CurrentIndex = Console::MessageQuantity()-1; CurrentIndex>=0; CurrentIndex--)
if(VerticalOffset > 0 - (FontSize*2))
TextColor = d3dRGBA(0,0,0,255);
TextColor = d3dRGBA(255,0,0,255);
TextColor = d3dRGBA(0,255,0,255);
TextColor = d3dRGBA(0,0,0,255);
VerticalOffset -= (d3dGetTextHeight(1,Console::GetMessageString(CurrentIndex)) + VerticalTextOffset);
To use the sample, create a new Dark GDK project and add d3dfunc library. Replace the projects "main.cpp" with the one above and also create and copy over the other two headers.
My GConsole namespace was never meant to be actually used and as such I have some hard coded input functions inside the draw function. The controls to pull down/push up the console are CTRL+Down Arrow, and CTRL+Up Key respectively.
I've also attached a EXE in case anyone doesn't want to bother with compiling.
@RedEye: As for misspelling my name, I have no good excuse for that, lol. I've been terrible with typing lately. Thats what I get for mixing programming with beer and/or vodka, lol.
Note to Moderators: If possible, please change the tag of topic from [DBP] to [DBP][DGDK]. I wasn't originally planning on it being for both