Skip to main content
gamedev.net
🔒 Locked

Dev console

Started by Matlock Jul 3, 2007 at 12:52 AM 2 replies 900+ views
Original Post
Matlock
Matlock
In order to more efficiently test my game engine, i am looking into creating a seperate dev console window, which contains only a text input box for typing commands into. I am assuming that I could just create a window with the standard win32 library. Problem with this is that the standard way I know how to do this is from a WinMain, however I am using SDL and don't have access to some of the necessary data items from the generic main entry point. Any suggestions as to where I might find some resources on this sort of thing would be appreciated. Thanks.
Matlock
Matlock
This is nifty, however it doesn't quite fit what I need. Since last night I found some code to pop up a window with a single line text edit box, which is actually precisely what I need. The following code sums it up:

Create the window

CreateWindow( "edit", "",
WS_VISIBLE|WS_CHILD|WS_BORDER|ES_AUTOHSCROLL|ES_AUTOVSCROLL,
0, 0, nClientWidth, nClientHeight, hwnd, (HMENU)nEditID, hInstance, NULL);

Query the window

GetDlgItemText(hwnd, nEditID, szString, nMax);

The reason I can't use the sdl console is because I am using SDL only for input, while Ogre is being used for rendering. I could use CEGUI, however I don't want the console to be attached to the rendering window, I want to be able to use the dev console to create rendering windows and anything else that I want. So basically I settled in a win32 console with a text entry box. So what I suppose is needed at this point is a way to create this window with needing the hwnd and hInstance items, as well as a way to process any received entry messages.
LessBread
LessBread
You can use GetModuleHandle(NULL) to obtain the hInstance for the current process.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.