Archived

This topic is now archived and is closed to further replies.

i want my dos window

This topic is 6159 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm making a game and going off NeHe's tutorials but I want to get back that handyDandy dos-like window so I can 'cout' information to it and debug more easily. I've seen other amateur openGL programs with an openGL window and a text window so I know it's possible, but what does one do to NeHe's basic outline to get that window? also, do I just need to 'cout' anywhere in my program to print to the new window, or would it be more complicated than that? I see that when 'CreateWindowEx' is called, there is a 'parent window' field that NeHe passes 'NULL' to.... looked probable. but I don't know what I would pass in its place.. thanks a bunch in advace -radjan spirit I am not (your dogfood pony) Edited by - radjan_spirit on January 29, 2001 2:15:37 AM

Share this post


Link to post
Share on other sites
Well, you could use GLUT (check it out at www.opengl.org).
To use it in VC, simply make a new project, but a _console_ one!
Then include the necesary things and link to necesary libs.
Then to print out info to the little dos window that appears, just do a simple printf or cout, just as usual.

Hope this helps.

Share this post


Link to post
Share on other sites
Hi,

Have you looked at the AllocConsole() function? It''s part of the Windows kernel (wincon.h) and lets you create a console just like the Dos one. Standard input and output gets directed there, but I''m not sure if you can use cout/cin or not, I use _cprintf() (console printf) but you may be able to redirect an output stream there. It''s handy because you can have the console in a debug version, but not in release mode. There''s a whole load of console functions to go with it, just search for AllocConsole in your programmers help system (MSDN, etc) and it should lead you back to the console section.

I use it regularly to log what''s going on in my programs and haven''t had a problem with it.

Dan

Share this post


Link to post
Share on other sites
just replace the
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,INT)
with
int main
and you have your doswindow (go to settings>linker>project options and delete the /subsystem:windows

(or write /subsystem:console in)

then you have your console back.. the rest should be let like before.. and then cout how much you want to

we wanna play, not watch the pictures

Share this post


Link to post
Share on other sites