Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Basics In DarkGDK

Author
Message
James McGlocken
16
Years of Service
User Offline
Joined: 29th Jan 2008
Location: In The Beautiful Mountains of Vermont
Posted: 29th Jan 2008 20:56
I've got everything set up and it seems to be working just fine. I would like to know how to do a couple things that I am having a hard time with:

1. I've been using the dbText command to output text, but I don't understand how you can output a string from C++.

How would I write something like:

dbText (310, 200, $hello);

I'm more of a PHP scripter so I put in $hello, but how would you do this in Visual C++? The best guess I have is that you use #include <string.h> and do

string hello = "hello there";

and then do

dbText (310, 200, string hello);

or something, but of course as I am not completely familiar with the C++ language yet this isn't working.

2. with dbLoadImage, how do you load an image from a directory on your computer?

The kinds of things I want to do with DarkGDK include 2d or 3d world builders, so it is necessary to import from what the user selects. I need the dbLoadImage function to load an image from a $variable.

PHP Programming, Music Composition
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Jan 2008 22:18
1) dbText() uses a char pointer, aka char*. You can turn an std::string into a char* by doing: (char*)mystring.c_str()

2) Just put in the directory you want to load from. If you wanna start from C, do "C:/", if you wanna go up a layer, do "./"

Your signature has been erased by a mod

Login to post a reply

Server time is: 2024-11-20 01:18:36
Your offset time is: 2024-11-20 01:18:36