Question about wrighting text to screen

Started by
13 comments, last by kingpinzs 20 years ago
OK, first to DerAnged and Rocket05. LOVE your work guys. Seriously. Oh no wait - I was getting confused. You''re f--kwits.

kingpinzs: In general falling back to GDI to overlay text on a DirectX game is a fairly bad idea; I''m an OpenGL guy myself but I understand that you''ll get a major performance hit if you do that - plus you won''t be able to take advantage of DirectX niceties like antialiased text. Not an expert as I said, please correct me if I''m wrong.

TheNerd: When you call System("cls"); as recommended by ToohrVyk you''re (under Win 2000 and XP) creating a whole new shell instance, allocating 640Kb to it, and then calling a system function that gets trapped by the emulation layer anyway (I *think*).

If you''re asking because you''re doing a console-mode game, I''d seriously recommend implementing a rendering layer using the console functions described here.

It''ll actually help you in the long run too, because you''re essentially getting a good taste of using an output API - which gives you a great context for understanding what level of abstraction you''re at when you get onto DirectX/OpenGL/whatever.

A really great implementation would be if you wrapped the console functions in a wrapper class of your own, which you then call with member functions such as renderer.OutputText (line, column, "Some text"). You could then expand the class to draw little windows for you and all sorts of stuff - AND you''d be getting really used to using an API to handle your output.

I use the console functions in my ASCII renderer class, which provides a similar implementation to that described above but doesn''t handle text output - although do feel free to extend it


www.coldcity.com
code, pics, life
[size="2"]www.coldcity.com code, art, life
Advertisement
quote:Original post by IainC
kingpinzs: In general falling back to GDI to overlay text on a DirectX game is a fairly bad idea; I''m an OpenGL guy myself but I understand that you''ll get a major performance hit if you do that - plus you won''t be able to take advantage of DirectX niceties like antialiased text. Not an expert as I said, please correct me if I''m wrong.
He did not mention making any DirectX game. I think he just started with Win32 API. That''s why I said GDI is easier, because it''s part of Win32 API.
wow, you people can''t take a joke, can you?

my apologies kingpinz if it offended you
"I never let schooling interfere with my education" - Mark Twain
quote:Original post by Rocket05
wow, you people can''t take a joke, can you?
It wasn''t funny. I had half a mind to NB you.

@kingpinzs and TheNerdTk421:
IainC gave you excellent answers.

@kingpinzs:
If you''re building a plain Win32 application, use GDI - if you''re using C++. Win32 GUIs are much more easily built in other languages/technologies, though: Visual Basic, C# and .NET, Delphi, etc.

If you''re building a DirectX application, stay away from GDI.
quote:Original post by DerAnged
DEV IS NOT A COMPILER ITS AN IDE!!!

and if you cant even make a console app go get a book or google a tutorial.
Would you like to be banned?

This topic is closed to new replies.

Advertisement