Jump to content
  • Advertisement
Sign in to follow this  
dk32321

using gdi functions in console

This topic is 4804 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

Advertisement
No, you will need to use the Win32 API in order to make a window and GDI context to use those functions. There exist console functions that let you set the color of text, but that's about as graphic as you can get.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by dk32321
Is it possible to use gdi graphic function in the console of a windows system.
I am using c++

Certainly, but what device context are you planning to use?

Share this post


Link to post
Share on other sites
You can create a window in a console application and use GDI functions on that. You can access the desktop device context and use GDI functions on that. Some GDI functions can be used with just the desktop device context and still be useful like EnumFontFamilies(). However, drawing to the console window the GDI functions is non-kosher.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
not worth it

just make a window
and use a static text control for the text, and an edit control for text input
and all the gdi's work

you can get an hdc from the console through win32 trickery, as a matter of fact you can get the hdc from any open window system wide and mess with it, close it, paint on it, etc
but thats a lot of hard work

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!