Thread: GDI woes

  1. #1
    Registered User cppdude's Avatar
    Join Date
    Jan 2002
    Posts
    62

    GDI woes

    how can i make the gdi draw faster or will i have to do the hard thing and learn that mother of an api Direct Draw?

  2. #2
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Well, GDI is GDI and that's that. I guess you could move onto DX, but that'll be a lot of learning. It's huge. The only way to make your code (GDI) faster is to program that way. You should probably pick up a book on optimized coding or something.
    1978 Silver Anniversary Corvette

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Garf has a good point....Code and system optimisation will often lead to faster execution....

    It depends what you are trying to do....but eventually you will reach the point where the GDI cannot easily be made to work faster...then DX or OpenGL become the better options as they can operate much faster

  4. #4
    Registered User cppdude's Avatar
    Join Date
    Jan 2002
    Posts
    62
    well i am making a program that scans the centre of your screen while playing a shootem up and magnifies it by drawing over the open screen. The only problem is that the GDI is so slow at drawing that teh magnification appears to flash a lot and slows down the game. I have attached my source.

    Which API should i use instead of the GDI to get faster drawing onto the screen?

    Any comments on how i can make my code faster are welcome.

    I have attached my source code in VC++ form.
    Last edited by cppdude; 03-17-2002 at 04:24 PM.

  5. #5
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Direct Draw really isn't that hard to learn. Especially if you create
    a wrapper. The biggest part of the code is the initialization and
    that's almost always going to be the same. So once you learn it
    that's it. The actual "blitting" code is less than that of
    the GDI because you don't need to blit masks for your sprites.
    If you can check out Ernest Pazera's "Isometric Game Programming with DirectX 7.0". I learned Direct Draw from his book in a day. He's got a really great writing style that makes it easy to learn.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows GDI vs. Java Graphics
    By Perspective in forum Windows Programming
    Replies: 7
    Last Post: 05-07-2007, 10:05 AM
  2. GDI object lifetime and C++ object lifetime
    By VirtualAce in forum Windows Programming
    Replies: 4
    Last Post: 06-16-2006, 05:26 AM
  3. opengl, or gdi?
    By n3v in forum Game Programming
    Replies: 25
    Last Post: 05-21-2006, 05:02 PM
  4. Whats Peoples Problem With the GDI?
    By MicroFiend in forum Game Programming
    Replies: 6
    Last Post: 07-28-2003, 07:52 PM
  5. Double buffering in GDI -- easy?
    By fusikon in forum Game Programming
    Replies: 17
    Last Post: 02-15-2003, 10:03 PM