Whats Peoples Problem With the GDI?

This is a discussion on Whats Peoples Problem With the GDI? within the Game Programming forums, part of the General Programming Boards category; i agree that the GDI isnt great as it isnt as powerfull as these direct device driver interfacing engines like ...

  1. #1
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80

    Question Whats Peoples Problem With the GDI?

    i agree that the GDI isnt great as it isnt as powerfull as these direct device driver interfacing engines like DirectX and OpenGL but i find it a great tool for game programming ive created a collection of very efficient classes for buffering screen blitting, sprites etc and can blit full screen (800x600mode cpustats: 900mhz 256sdram intel810 [lol] graphics) at a frame rate of 125fps and the gdi can be used as a failsafe for some functions that people may not be sure about in other engines also it can be directly integrated with say a game coded in directx or opengl, with all of these points being usefull to any game programmer why do people say to newbie game programmers to avoid the gdi? the way i found it was that being able to program using the gdi and getting the grasp of screen buffers, alpha blending and layers would allow some1 to learn game engineering in directx or opengl alot faster,, oh well i guess thats just my view on that whatd u guys think?

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    249
    I think that periods are your friend
    Well, there are a few things wrong with your code:

    1) It does not work.
    2) It does not work.
    3) It does not work.

    Hope this helps.

  3. #3
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    It's funny how you said that funkydude, and then didn't use one to end your own sentence.
    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

  4. #4
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    It's funny how Micro typed that whole thing without using one. Wait, no it isn't.

    GDI is resource hungry and doesn't give you much for the resources that it eats. It's as hard to use as DirectX (speaking in general terms... it's not easy, it's ugly and the function names are hard to read... a lot to remember for a newbie). But it only gives you the power of SDL or Allegro (again, general terms). It's fine for doing really simple things, or if you're already diving into the WinAPI, but it ISN'T the thing to learn to do graphics. For something simple that will run on underpowered machines, allegro or SDL are the best options. For something powerful and resource hungry, choose OpenGL or DirectX. I don't know why someone would want to choose something slow, resource hungry, weak, hard to use, and weak for the first graphics library they use.

    (I'm not saying that you shouldn't use it Micro. I'm saying that it isn't a good first thing for people to use. If GDI fits what you need to do in the app, and you're comfortable with it, by all means, use it. But the complexity/power ratio is too high for many applications)
    Away.

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,854
    >>why do people say to newbie game programmers to avoid the gdi?<<

    Because they have never used it correctly (or spent the time to learn GDI properly).

    >>GDI is resource hungry and doesn't give you much for the resources that it eats.<<

    If you are doing it properly there are no resource leaks or flicker. Most people just don't read the fine print in the help and think it is the GDI's problem not their apps.

    Or they don't understand all painting should be compleated before calling for a paint msg.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    In fairness I didn't read it (because it's ugly and un formatted), but there are at least two question marks that I saw.
    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

  7. #7
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    I use GDI for the main reason it was developed -- to make windows look prettier and display bitmaps. If you use it for the reason it was invented, it is actually a pretty good API. That's why it doesn't have all the bells and whistles needed for games.

    I say, if you want to make games, learn a graphics API, if you want to make things prettier, or display bitmaps, use GDI.

    Of course, some people may have different opinions on GDI, but I see it as simply something to paint windows. That's it. You can make a game with it, but it's going to be so much easier and faster if you use Allegro or SDL to learn on.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM

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