Windows GDI

This is a discussion on Windows GDI within the Game Programming forums, part of the General Programming Boards category; Alrighty. I've heard this from sooo many people already: "Should I use Allegro or SDL?" I would just like to ...

  1. #1
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879

    Windows GDI

    Alrighty. I've heard this from sooo many people already: "Should I use Allegro or SDL?" I would just like to know why nobody ever mentions Windows GDI? It does the job, and you don't need to download extra libraries or anything. Allegro and SDL are useful, true, but what's wrong with GDI (other than its slowness)? In fact, I have this feeling that around 80% of the people trying to get into gfx stuff haven't even heard of it. And yet, it's the gfx thing built into Windows! Can anybody please explain to me why this is?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    It's cooler to use DirectX.
    My games became very cool when I managed to add alpha-bending and hardware acceleration. They require a Geforce2+ to run, but they're very, very cool.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Heh ok, so it's cool. But shouldn't people at least learn how to use Windows' base graphics functions first? I mean, if you apply for a job at a company that doesn't use Allegro/SDL (i.e. M$ lol), supposing you're not smart enough to do actual DirectX yet, wouldn't it look really bad if you didn't even know how to use GDI?

    uh, graphics programming? Yeah, I know how to use this free gfx library I downloaded somewhere called Allegro.. what? you don't use "non-professional crap" like that? What, you expect me to code my own graphics library? Oh right, of course, GDI... uh, what's that?
    Last edited by Hunter2; 10-31-2002 at 05:09 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #4
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105
    Why use a stick when you could use a sword?

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Well, if you have a sword, why bother with a potato peeler?

    Besides, if all you know is Allegro... well, when are you gonna grow out of it? Learn how to do it yourself? Using Allegro is similar to copy and paste. It works, but you don't know how or why. On the other hand, if you want to learn DirectX itself, see the analogy above. Some things are best done with the less powerful tool.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #6
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105
    I use the most appropriate tool for the job, maybe if I encounter a potatoe I would use a potatoe peeler. But in general a sword as more power thus can acomplish a wider variety of choirs

  7. #7
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Seriously, I've actually made a game using GDI.

    GDI can be quite useful and it's not terribly slow given today's computer speed. I recommend GDI when developing non-fullscreen games.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  8. #8
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Seriously, I've actually made a game using GDI.
    So have I, as you might be able to tell

    I use the most appropriate tool for the job
    Which is going to be either GDI, DirectX or OpenGL, if you ever hope to get a job. True, raw DirectX and OpenGL are pretty hard to learn. But that doesn't mean you can't do GDI!

    And the only thing anybody ever suggests when somebody wants to get into graphics is "Try Allegro. It's fun and easy." or "Try SDL. You can get it here." But why is it that around 80% of the people have never heard of GDI? How are you supposed to use a potato peeler if you've never heard of one?

    About the sword. Allegro isn't a sword, it's an enchanted sword that fights your enemies for you. It'll do the job easily, but if you want to cut a tree down, it won't do it because TREES ARE YOUR FRIENDS YOU IDIOT! DirectX is a normal sword. You train, train and train some more with it, and once you're truly l33t at wielding it, you can dispatch any problem in your way, including that tree blocking the door.
    Last edited by Hunter2; 10-31-2002 at 06:28 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  9. #9
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    The GDI isn't really a game library and not everybody uses
    windows. Using the gdi requires using the windows api.
    Usually this means alot of documentation looking and the interface is sort of unintuitive.

  10. #10
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    True, it is sort of unintuitive, and not everybody uses Windows. However, most people do use Windows, and GDI remains probably the simplest way to implement graphics (besides Allegro - but is Allegro really that much easier?), and is probably a skill most people should have.

    GDI isn't really a game library
    True. But although GDI wasn't meant for games, it still can be used for them - and if you're not trying to make a game, it can probably be very useful indeed. And although Allegro is doubtlessly much better and easier for games, it remains a library made by somebody else, which no company is ever going to use (well, maybe if you're self-employed).

    True, it would be nice to have some knowledge of Allegro, but once somebody learns Allegro, they often lose interest in learning GDI, which is also very useful.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  11. #11
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    If it weren't for the experience I had with GDI I don't think I would have grasped DX as quickly as I did. Plus I still use GDI functions in support of my DX wrapper (ie: when a surface is lost I use BitBlt to blit the bitmaps image back onto the surface after it's restored).

    And while I'd love for everything I write to be easilly portable and make maximum use of the STL instead of the Win32 API, my employer doesn't share my enthusiasm. Not one of our systems at work use a non-Window's based OS and the early experience with the GDI as a hobby forced me to dig into and learn a good bit about the Win32 API. And that experience is now serving me quite well at work.

    Hunter, if you want to see a game made with the GDI try here. It's a dice game I started to get some experience using GDI and the Win32 API with full source included in the *.zip file. Unfortunately, it never got finished because it was just used as a side project to "cut my teeth" with the API so to speak.

  12. #12
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Heh, I got jdinger on my side now - I win!

    I'll take a look at the dice game when I get home; no time to look at it now, but thanks anyways.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  13. #13
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    I started out writing games using GDI. It was great I thought it was so cool. Then I started learning DirectX and thought that was even cooler. I noticed a big performance boost when porting my games from GDI to DirectX. I still liked GDI but just thought it wasn't as fast.

    Fast forward to today. I'm writing many 3D applications which really need to be written for performance considerations. GDI simply doesn't even bring anything to the table. I think I was getting 900 frames per second when displaying 8000 polys or so in my Direct3D application.

    Here is something else to consider. I am actually writing my own 3D library using GDI. This is all using Linear Algebra ( projects, matrix rotations, etc ). I have a bunch of cubes spinning around on the screen and lets just say the frame rate is less than stellar. It's over 100fps BUT I'm rendering like 36 polys. Bottom line is its just pretty slow when it comes to some things.

  14. #14
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    You see, that is when you use the sword; but when you're making... say, a calculator or something, that's when you bring out the 'ol potato peeler. Don't need nuthin fancy for that! And besides, I was trying to ask why people use Allegro/SDL instead of learning to use GDI or DirectX. So I am actually in agreement with you... use DirectX for your 3d apps! But why does everybody tell people to use Allegro/SDL?
    Last edited by Hunter2; 11-01-2002 at 04:41 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  15. #15
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    I use OpenGL for major projects, but I like Allegro if i'm doing a fast little test program, such as graphing something for my math courses.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

Page 1 of 3 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 10:59 AM
  2. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  3. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  4. Windows GDI Flickering
    By bartybasher in forum Windows Programming
    Replies: 10
    Last Post: 08-25-2003, 03:43 PM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 06:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21