Skip to main content
GameDev.net gamedev.net
🔒 Locked

Is windows API programming required for learning DirectX and Open GL

Started by neerajshastry Jun 12, 2009 at 3:07 AM 8 replies 800+ views
Original Post
neerajshastry
neerajshastry
please tell me weather it is required and if it is then how should I go about it
Fiddler
Fiddler
No, it's not required. Indeed, I'd advise you to stay away from any tutorials that use the win32 API directly.

Download GLFW and get started. It comes with excellent documentation and good examples.
[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]
mmakrzem
mmakrzem
I disagree with Fiddler.

If you are going to use DirectX or OpenGL you should know how to use the Win32 API. Everything is based around it (when you are developing for Windows) and it is best to know what you are dealing with. Plus, if you use the Win32 API directly rather than a 3rd party library (which will sit ontop of Win32 anyway) then you have more direct control over how your game/app will work.

That's just my two cents :)
eppo
eppo
The necessary things to know (at least for a beginner) are how to create a window and how to handle messages. Most DirectX books start out with a chapter on this.
Anddos
Anddos
how do you expect to create a window without the windows api?
:)
jpetrie
jpetrie
Basic Win32 knowledge is required to get started with Direct3D or OpenGL if you are not using a third-party API, such as SDL or SFML, that abstracts the process. It's not difficult to grasp, most introductory material will give you a sufficient rundown of the basics (including the tutorials in the DirectX SDK documentation and on MSDN).

It's useful to have a good working knowledge of the Win32 API though. But you can acquire that over time.

Quote:

how do you expect to create a window without the windows api?

Using a third-party API.
PureBlackSin
PureBlackSin
Quick answer, no, but in directx you do use a small amount for getting some inputs and you create a window using the windows api. Opengl however doesn't however touch the windows api, or shouldn't if it is made truely portable, like it was intended.

PureBlackSin
For Games, Articles and Custom High End Computers, come visit.Myndoko
jpetrie
jpetrie
Quote:

Opengl however doesn't however touch the windows api, or shouldn't if it is made truely portable, like it was intended.

OpenGL requires OS level code in order to set up a window as well. The OpenGL specification for portability is for the graphics system, not the OS windowing system. Barring GLUT, which is outside of the standard, iirc, and is in either case pretty non-scalable.
skwee
skwee
I don't know about DirectX but OpenGL or games in general its not just window creation, its also texture loading, music streaming, networking (some of the games), fonts.

So why to bother learning particular implementation of this when you can use SDL for example? It handles the window creation and message queue (not that its so hard to do with win32), as for textures you can use SDL_image, and SDL_ttf for fonts.

In my opinion, if you program in DirectX use Win32API, using cross-platform libraries like SDL is useless since it adds more complexity on the code (in execution time) and in the end anyway transformed to DirectX calls + DirectX as far as I know gives functionality for creating TrueType fonts and textures, and OpenGL gives you just rendering.

Even if you use Win32Api you should re-factor the code, encapsulate the window creation code in function/class and use it instead of writing it over and over again.

Good luck!
I would love to change the world, but they won’t give me the source code.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.