Thread: Graphics in the console (for real)

  1. #1
    Registered User harryP's Avatar
    Join Date
    Sep 2002
    Posts
    124

    Graphics in the console (for real)

    Ok, I didn't know if everyone knew this already or not, but contrary to what people say, graphics are more than possible in the console program. Like bitmaps and stuff...it isn't just limited to ASCII stuff. Granted, it's using Windows GDI stuff, but I was so excited when I found out. So I'm in the process now of making a new graphics library thing for the console which will allow bitmaps and stuff. Sorry, I'm just excited . Did anyone else know that this stuff was possible in the console?

    Brendan

    By the way, if you want proof or whatever, I'll post a screenshot if you want.
    Draco dormiens nunquam titallandus.
    Console Graphics Library: http://www.geocities.com/steve_alberto/cgl.html

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    I think most people know it's possible, what graphics api are you using?

  3. #3
    Registered User harryP's Avatar
    Join Date
    Sep 2002
    Posts
    124
    Ummm...I dunno...I'm using the Windows GDI functions (BitBlt() and such) in the console program.

    Brendan
    Draco dormiens nunquam titallandus.
    Console Graphics Library: http://www.geocities.com/steve_alberto/cgl.html

  4. #4
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    I think most people know it's possible
    Wow, shot down in flames!

    Seriously though, I'd be giving the console up now HarryP. If you're using Windows functions anyway you may as well have a nice window to run them in, instead of console.
    Thor's self help tip:
    Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.

    OS: Windows XP
    Compiler: MSVC

  5. #5
    Registered User kiss_psycho's Avatar
    Join Date
    Feb 2003
    Posts
    49
    if you really want to do something radical, try doing it in Turbo C++ instead. i guran-dam-tee you that it'll keep you busy for a long long time . and i'd like the screen shot.
    Definition of Programmer : A red-eyed mumbling mammal capable of conversing with inanimate objects.

    Happy Hunting...
    The Root

  6. #6
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    Didn't mean to sound sarchastic, actually sounds quite interesting. Glad you are having fun with it. Your using the win32 api btw.

  7. #7
    Registered User harryP's Avatar
    Join Date
    Sep 2002
    Posts
    124
    I have made a few Windows programs, but I really hate the interface...all that code just to make a window. So I decided to see if I could do the same stuff in a console program, and after a little experimentation and some checks at MSDN, I found that any of the standard Windows API functions work in the console.

    The 2 shots below are of: 1)Lines drawn in random colours using MoveToEx() and LineTo(). 2)The closing screen of the program, using StretchBlt(), CreateFont(), and DrawText().

    Brendan
    Draco dormiens nunquam titallandus.
    Console Graphics Library: http://www.geocities.com/steve_alberto/cgl.html

  8. #8
    Registered User harryP's Avatar
    Join Date
    Sep 2002
    Posts
    124
    Oops, I cliked Submit too fast...Sorry.

    Brendan
    Draco dormiens nunquam titallandus.
    Console Graphics Library: http://www.geocities.com/steve_alberto/cgl.html

  9. #9
    Registered User
    Join Date
    Oct 2003
    Posts
    9
    Heh, wow. I actually didn't know that you could do that (that's what I get for never coding Win32 API). It sounds pretty neat, keep it up
    Last edited by Jeb.; 10-15-2003 at 04:46 AM.

  10. #10
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Actually getting graphics into a console window is quite easy, FindWindow will give you the console windows handle, and with that you can do just about anything. What is more of a problem is the hoops you have to jump through to keep them there if you, for example, minimise and maximise again.

    You need to use Windows programming techniques, and frankly, if your doing that anyway, why are you bothering with a console?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  11. #11
    Registered User harryP's Avatar
    Join Date
    Sep 2002
    Posts
    124
    Yeah I know, I realized that the whole re-painting the window thing would be interesting, and I don't really plan on doing much with it...I was just pointing out that I found it is possible, to I was excited hehe. I really don't see much of a practical use for it, frankly, because if one is going to use Windows API functions, might as well just make Windows programs.

    Brendan
    Draco dormiens nunquam titallandus.
    Console Graphics Library: http://www.geocities.com/steve_alberto/cgl.html

  12. #12
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    cant you also just use allegro (i think thats what it was called)

    though those wont give you much in terms of quality..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do i put a graphics - console application
    By hero_bash in forum C++ Programming
    Replies: 10
    Last Post: 06-12-2006, 05:03 PM
  2. Console graphics library (again)
    By harryP in forum C++ Programming
    Replies: 4
    Last Post: 08-23-2003, 10:24 AM
  3. Console Graphics
    By tetradtech in forum Linux Programming
    Replies: 0
    Last Post: 10-27-2002, 11:12 AM
  4. graphics in c/c++ console apps
    By anthonye in forum C Programming
    Replies: 2
    Last Post: 06-20-2002, 05:39 AM
  5. console graphics??
    By kormofi in forum C++ Programming
    Replies: 1
    Last Post: 06-13-2002, 04:37 AM