I hate trying to program windows, but will I have to?

I’ll open up a tutorial, and see stuff like hgWnd, clip_children, messagebox; its all for Windows! I know I know, windows is cool, but I hate having to program it!
I am an experienced C/C++/PHP programmer who is just, JUST starting to learn openGL, and I’m wondering what path I should take. First of all, is oGL platform-dependant? If not, then what would be the best language to program it in. Second, do you believe that the future of 3D gaming will still rely heavily on Windows? And third, If I am looking to become pro, as in, I WILL become a 3D game programmer, do I have to learn Windows programming, or is there a way to get around that?

~Jesse

PS
I guess my real question is to all those experts out there who have been prorgamming since they were my age: To become a successful 3D game programmer, I’ll end up having to learn Windows programming, won’t I…=(

PSS THANK YOU TO ANYONE who will take their time and reply… Your help is very, very appreciated!

You can use GLUT for portability. There are many other options as well, but GLUT is the most widely used. GLUT is also great for learning OpenGL. However, GLUT may not be enough for a cutting edge real-time 3D game (and isn’t used in any AFAIK).

The future of 3D gaming will be on Windows, because that’s the platform that the majority of gamers run on and you can’t change that. Also, OpenGL is a good graphics library, but it’s quite low-level and doesn’t handle input or sound so a lot of people here use DirectInput and DirectSound for that. You could look into SDL or OpenML as alternatives to DirectX that will run on Unices.

In answer to your question, to be a successful 3D game programmer, you will have to end up learning Windows programming, and probably the Direct3D API as well. The road ahead of you is very long though. As well as programming, a solid background in (or a willingness to learn) fairly advanced maths can help a lot. I’m not saying don’t learn OpenGL - it’s a great API - but be aware that there’s much to learn.

Hope that helps.

In my opinion, having traced the same path you are embarking on, I’d say start with NeHe’s tutorials, and yes… do Windows.

Once you’re proficient with rendering contexts, pixel formats and of course OpenGL drawing primitives etc. you’ll be qualified to move your work to whatever platform (Linux, Mac OS X, etc.) you need.

Bottom line, for me, is that Windows is ‘mostly harmless’…

My suggestion is: learn Windows programming, but don’t start out with Windows programming! The NeHe tutorials are great for getting started, but in my opinion, the whole philosophy of mixing Windows and OpenGL code is wrong. You should always separate operating system specific stuff from “your own” program code (besides, the Windows include files badly pollutes your function/variable/constant name-space).

Have a look at GLFW (opengl.freehosting.net/glfw), which is a simple open source API that takes care of the windows code. It even works for X11 (Linux, Irix, Solaris, FreeBSD etc). AND, you get the code to play with if you really want to “do it yourself” later on.
And yes, OpenGL IS cross-platform. That is (in my opinion) one of the strongest advantages of OpenGL compared to other APIs. For instance, I prefer to do my OpenGL development under Linux (which I find more stable and suitable for development), and then simply recompile and run the programs under Windows (with the help of GLFW of course).

/Marcus

I agree. I’ve only been programming OpenGL for 3-4 months now, and i havent even started to learn how to program Windows. For starters i cant even find any information on it, but hey who cares when your having fun coding in nice 3D scenes. But you will need to learn it at some point in time. Im trying to get some info on it now. So if anyone can lead me in the right direction, it’ll be much appriciated.

Also get the nehe tutorials, these are an invaluble source of information, especially if your new to the game. You can get these from nehe.gamedev.net

I will give you one piece of advice though. Try to stay away from GLUT. Although its easy to use, its also slow (from my own experience anyway), plus i feel its much more rewarding if you do it from the main opengl headers. Plus if your a dedicated to getting a high fps like me, learn opengl in assembly.

Originally posted by Kaos:
I will give you one piece of advice though. Try to stay away from GLUT. Although its easy to use, its also slow (from my own experience anyway)

Not too slow for the NVIDIA SDK demos

also take a look at SDL (http://www.libsdl.org). it is somehow similar to directx, but is system independent.
as i heard, there’s also a port to sony ps2…
however, my advice to you: don’t be platform dependant! for now, almost all games are for windows, but you can see, that the gaming industry requires more independance (eg ps2, linux, mac, etc).
and, if you think of distributing your game for free in the internet, more people will test, copy and help developing it…

however, good luck.
best regards,
tolga dalman.

Originally posted by ffish:
However, GLUT may not be enough for a cutting edge real-time 3D game (and isn’t used in any AFAIK).
[/b]

Actually, FlightGear is a pretty decent (and Free ) flight simulator that uses glut.

I’d like to second the vote for SDL (www.libsdl.org) which is a fantastic cross-platform API.

Here is example SDL code for getting an OpenGL window up and ready for use. How easy can it get?

#include "SDL.h"

SDL_Surface *window;

SDL_Init(SDL_INIT_VIDEO);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
window = SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);

/* render stuff etc */
SDL_GL_SwapBuffers();

SDL is game-worthy, the Linux ports of lots of games use it (e.g., Unreal Tournament).

  • Mike

Originally posted by ffish:
Not too slow for the NVIDIA SDK demos

Do you think that has anything to do with Mark J. Kilgard working for nvidia?

  • Mike

I notice you said in your fist post that windows is cool… i consider that blasphemy against my religion of Linux… Trovalds will get you for that…

Originally posted by MrShoe:
I notice you said in your fist post that windows is cool… i consider that blasphemy against my religion of Linux… Trovalds will get you for that…

Windows was never cool. Linux has always been cool, but fairly difficult to appreciate for the most of us, including me (a Unix fanatic)… Until recently when I found Mandrake 8.0. Boy! Now we’re talking cool! Super easy installation and way-simple-and-cool user interface. And of course, accelerated OpenGL drivers are available from nVidia When will ATI and the others release Linux OpenGL drivers?

hm, ati “doesn’t need” to release a driver, there is one: dri.sourceforge.net.
in my opinion, dri is far better then the casual glx-way. nevertheless, nvidia has for now the better drivers under linux.
btw, this is not really important for the actual topic, is it?