Thread: Want to learn Windows API for Game Programming

  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Greece
    Posts
    32

    Want to learn Windows API for Game Programming

    My book Beggining Game Programming http://ecx.images-amazon.com/images/...500_AA240_.jpg is based in C but uses also Windows API.

    As I'm about to finish the theory of C I want to learn Windows API separately, because the book describes it very shortly -despite the fact that it is reffered to a begginer- I found the following book but it seems to me like that API has tools for purposes that exceed game progamming.

    Is it true?
    If thats true it would be a waste of time, and i should get a book that learns you API for Game programming. Do you know any?

    Programming Win32 Under the API

    -----------------------------------------------------------------------------------
    My Programming Activities on my Blog
    Last edited by George M.; 09-21-2008 at 06:57 AM.

  2. #2
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    Depends on what you want to do. I used Win32 API for making little programs that do my bidding If you want to do 3D programming look in to OpenGL. There's a template for it on the codeblocks 8.02 compiler so you can get a feel for the basic "skeleton". I used the allegro library when I made my first pong game (good starting game btw). Really it depends on your plans. So... what are they?

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Greece
    Posts
    32
    My book by using C, API and DireXt teaches you how to crete simple 2D games and inb the end a 3D pong game.

    So I have to learn API from a specific source?

  4. #4
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    Not really. You can learn API where ever you feel best teaches you. I started with winprog.org. That site will teach you the basics of windows programming. The best 3D tutorial/learning site I have found for opengl is NeHe. This site can get really advanced really quick though, if you don't fully understand one concept before moving to the next.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No, for anything more than just a basic program, Win32 API won't do. Especially not 3D games.
    It simply wasn't designed for it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Sep 2008
    Location
    Greece
    Posts
    32
    Its not using for the basic programming, but from what i understood, for the code to contact wi windows and so the input-output devices (speakers, aceess to audio-graphic files etc)

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Playing sound files, sure. Putting together complex stuff and playing from resources and doing 3D-positioning stuff, no.
    Blitting pixels on surfaces, sure (may or may not be hardware accelerated, beware). Doing complex 3D stuff with triangles, lights, shadows, etc, no.
    Foreground input, sure. Background input, force feedback, action mapping, no.

    The list goes on. Win32 API was not designed for games.
    Even if it could be used for serious programming, it wasn't designed for it, so it isn't easy or flexible.
    Gaming APIs was made for this exact purpose and is flexible and easy to use and employ for games. Far easier than Win32 API anyway.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User
    Join Date
    Sep 2008
    Location
    Greece
    Posts
    32
    API gaming? Whats this? are you sure?

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yes, DirectX.
    Direct3D, DirectSound, DirectInput, DirectShow (though this is part of the platform sdk now), OpenGL and more.
    Point me to some Win32 API that handles 3D rendering and enables you to create shaders and lighting and maybe I'll change my mind.
    (You realize that Direct3D works directly with the drivers and not Win32 API, yes?)
    Last edited by Elysia; 09-21-2008 at 01:11 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Registered User
    Join Date
    Sep 2008
    Location
    Greece
    Posts
    32
    API gaming is direXt?!

    The book i think does use it, dont know where exactly but....

    So a prgoramm of DireXt is like a prgoramm in API?

  11. #11
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    We may be talking at cross purposes here. "API" is a general term for a programming interface that allows you access to some library without being a wizard in it. So there's the "Windows API", which allows you to do things in Win32, like pop up message boxes, draw windows, deal with messages from the OS, all the things you would want to make an "ordinary" Win32 program. DirectX is also an API that gives you access to more fancy graphics things, sound, etc. It doesn't overlap much with the Windows API. OpenGL is another API that does much the same as DirectX (graphics only, though) -- same/similar end product, but a different interface (so the "look and feel" as you are programming will be different).

    There are quite a few other game development APIs out there, but if I try to list them out I'll miss somebody and they'll feel bad. But you can probably find them if you try.

  12. #12
    Registered User samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Newport
    Posts
    382
    I'm writing a 2D game that uses the BitBlt function - it's pretty fast even though I haven't fully optimised yet.
    Current Setup: Win 10 with Code::Blocks 17.12 (GNU GCC)

  13. #13
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yes, Windows API may "cut it" for 2D, or simple games. But for more complex stuff, it just won't cut it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #14
    Registered User samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Newport
    Posts
    382
    True.

    I do know OpenGL, but can't really be bothered to use it for 2D. I wouldn't even know how to off the top of my head - would you just use textured polygons as sprites?
    Current Setup: Win 10 with Code::Blocks 17.12 (GNU GCC)

  15. #15
    Registered User Will Hemsworth's Avatar
    Join Date
    Sep 2008
    Location
    England - Lymm
    Posts
    6
    This book I found to be very useful for game programming, the first thing it teaches you is how to use the Windows API, then it moves onto DirectX, even though it uses a very old version (DirectX 7) it teaches you all the very advanced math's needed to make games. But I still baught it for the maths, and its always nice to know how all the low level stuff work (like how to write a function to draw and clip lines). I would still reccommend it

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Use windows API functions in a GTK+ program?
    By Jake.c in forum Windows Programming
    Replies: 19
    Last Post: 01-23-2009, 06:40 AM
  2. What does this do (Windows API)?
    By EVOEx in forum Windows Programming
    Replies: 4
    Last Post: 12-19-2008, 10:48 AM
  3. Windows API
    By valaris in forum Windows Programming
    Replies: 7
    Last Post: 08-01-2008, 12:37 AM
  4. Windows API - Controlling other windows
    By Asmyldof in forum Windows Programming
    Replies: 11
    Last Post: 11-06-2006, 08:05 AM
  5. Doing things like VB using Windows API in C++
    By conright in forum Windows Programming
    Replies: 6
    Last Post: 01-05-2003, 12:51 PM