Hi im new here and intrested in learning C++ openGL. Ive got books On C++ but not OpenGL. Ive been looking at openGL for ages but dont no what to install. Ive been looking and no that you need GULT etc but not sure which version to use. Im using.
Creating 64bit applications that use OpenGL is not a problem at all. All needed header and library files come with Visual Studio (i.e. Visual C++). Additionally (for extensions), you need to download extra header files here: http://www.opengl.org/registry/
…although 32-bit OpenGL apps will run just fine on Windows 7 64-bit as well, and are perfectly suitable for learning with. (Being on a 64-bit OS doesn’t mean that one has to create 64-bit apps… )
I recommend using one of the extension and window manager wrappers too, although you can also get good mileage from dear old SDL. I’d also recommend - at some point in the future - learning how to set up OpenGL properly under Windows, using the raw API calls. Don’t do it now as you don’t want to be distracted by stuff like CS_OWNDC and SetPixelFormat, you just want to start putting triangles on-screen.
The big decision now is whether to go for “classic” OpenGL (i.e. 2.1 or earlier, with or without shaders) or “new” OpenGL (later versions). I personally would still recommend “classic” OpenGL (without shaders) as being the single best entry-level with the easiest learning curve. It’s great for answering questions like “what is a matrix and how does it affect what I draw” without smothering you under the accumulated baggage of all the supporting infrastructure you need to set up for the newer stuff.
The quintessential OpenGL “hello world” application is typically a single triangle on-screen, with you can then colour in and make spin, and maybe put a texture on. This gives a great foundation of knowledge for moving forward from, and you’ll learn a LOT of basic concepts from it that will be essential to know moving forward. So I’d say not to worry about extensions either for now, just draw that triangle and get comfortable with the most basic OpenGL 1.1 code before moving forward.
If you can find an older copy of the OpenGL Red Book or the Superbible either on-line or in a used bookstore it’ll be really good for easing you in. Look for something that supports roundabout OpenGL 1.3 to 1.4 level, although don’t be put off if there is an appendix on shaders. There are also several good tutorials on-line, although I personally find that some of them confuse matters a little by focussing too much on the C++ class structure at the expense of the basic OpenGL code you need to know.
What does that mean? I have found openGL to be a great cross platform API. Nothing more frustrating than seeing extraneous os-specific code when there are perfectly good libraries to help simplify openGL coding. It is definitely worth learning the “proper” windows way just to see how much easier it can be to use SDL, GLUT, GLFW, and the like cross-platform helper libraries.
It just means using the native Windows API, which has the advantage that the end-user doesn’t have to install any additional libraries on their machine to get the app working. This of course only applies if you’re distributing the app, and it’s a balancing act between making things easier for the developer vs making things easier for the user.
Take the example of SDL. The end user needs the SDL DLLs, yes? But in Visual Studio 2008 you need to configure your app to use the DLL versions of the C/C++ runtime, meaning that the end user also needs to install the C/C++ runtime. These are all usability barriers and can make the difference between the user thinking “this app’s cool” or thinking “this app sucks, it’s stupid, I get weird error messages”.
Ultimately the OS-specific portion, involving getting a Window up and enabled for OpenGL and loading any extensions needed, will be a very very small part of the application code so I don’t see it as being that big a deal.
But all of this is a LONG way from where the OP is at, and should probably be in a separate thread.
But in Visual Studio 2008 you need to configure your app to use the DLL versions of the C/C++ runtime, meaning that the end user also needs to install the C/C++ runtime. These are all usability barriers and can make the difference between the user thinking “this app’s cool” or thinking “this app sucks, it’s stupid, I get weird error messages”.
Just about every application that gets delivered on Windows uses Visual Studio, and just about every one uses the C++ DLL runtimes from VS. They don’t have a problem with delivering the runtimes in their installer.
It is not the end-user’s job to deliver any DLLs necessary for your application to run. It is the application developer’s job. And this isn’t exactly some mysterious arcane bit of programmer lore; everyone does this. It’s a solved problem.
Because <GL/glut.h> is not a magic word that means “make GLUT work.”
The angle bracket notation around a #include has a meaning. Specifically, it means that it will look for the header file using the library path specified in your build options. The “GL” part is a directory name.
Specifying <GL/glut.h> means that one of the directories in your library path will have a directory named “GL” in it, and in that directory will be a file called “glut.h”. If this is not the case, then the compiler will not be able to find the file.
Which means if you point your library paths at the directory that has “glut.h” in it, then it will not be in the directory “GL” beneath that path. The compiler will not find the file, and it will complain about it.