Sign in to follow this  
celestis_genesis

OpenGL Starting with OpenGL

Recommended Posts

Hello everyone, I'm fairly new to using OpenGL (and game development in general, actually), and I have a few questios. I know this post would be better off in the Beginners forum, but I feel that more experienced people will be able to answer fastrer :D Anyway, here's my questions list: 1) In the OpenGL forum FAQ, there are links given to the BlueBook, and the RedBook. The BlueBook link doesn't work anymore, and the RedBook links to a manual for version 1.0 ...so, does anyone know where I could find updated versions of these two books? 2) I'm actually trying to develop a game with graphics close to commercial quality, so...I think i should use something past OpenGL 1.1 (I'm developing on a Windows XP). What would be a good manual (besides the one provided in the "Game Programming: Tricks of teh Trade" book)? 3) Are there any benefits in developing OpenGL games on a non-Windows platform? Like, getting the latest libraries or something? 4) Does anyone have a sample code to get me started with using OpenGL? (Yeah, I know there's NeHe's tutorials, but I think they're a bit outdated....but then again, I'm fairly new to this, so I just might be talking out of my ass here) Thanks in advance.

Share this post


Link to post
Share on other sites
Quote:
Original post by celestis_genesis
Hello everyone,

I'm fairly new to using OpenGL (and game development in general, actually), and I have a few questios. I know this post would be better off in the Beginners forum, but I feel that more experienced people will be able to answer fastrer :D

Posting questions in the wrong forum for your own convenience will make people ignore and/or flame you. Fair warning. I won't move your post this time, since a couple of these questions aren't quite "For Beginners"-level.
Quote:

1) In the OpenGL forum FAQ, there are links given to the BlueBook, and the RedBook. The BlueBook link doesn't work anymore, and the RedBook links to a manual for version 1.0 ...so, does anyone know where I could find updated versions of these two books?

They are, as their names imply, books. Try your local Barnes & Noble.
Quote:

2) I'm actually trying to develop a game with graphics close to commercial quality, so...I think i should use something past OpenGL 1.1 (I'm developing on a Windows XP). What would be a good manual (besides the one provided in the "Game Programming: Tricks of teh Trade" book)?

You should try clicking that "Books" link up at the top of the page.
Quote:

3) Are there any benefits in developing OpenGL games on a non-Windows platform? Like, getting the latest libraries or something?

Not particularly. Some graphics card manufacturers, such as SGI, release extensions that are not in the main core, but since they aren't widely available on consumer machines, they aren't particularly useful.
Quote:

4) Does anyone have a sample code to get me started with using OpenGL? (Yeah, I know there's NeHe's tutorials, but I think they're a bit outdated....but then again, I'm fairly new to this, so I just might be talking out of my ass here)

You're talking out of your ass. OpenGL is a much more stable API than Direct3D; the tutorials most likely will not be outdated.

Share this post


Link to post
Share on other sites
1) I haven't updated my bookmarks too recently, but both the Blue and Red books are in the 4th edition for OpenGL version 1.4, in case you didn't already know. A google search usually comes up with a few free online copies.

2) I'm not current on OpenGL books. I've been doing a lot more DirectX lately myself. I do know that Tricks of the trade is pretty good. Maybe someone else can recommend some other material for reference.

3) Haven't done much cross-platform programming, and I'm not sure I understand the question. Sorry.

4) Actually, NeHe would still be a great way to start, and even if you get through it quickly it's a good way to refine the basics. No matter how outdated a spinning triangle seems compared to the latest graphics engines, you always have to start with a blank window.

Good luck. I wish I could give you more information.

Share this post


Link to post
Share on other sites
Quote:
Original post by celestis_genesis
Hello everyone,


Hi.

Quote:

1) In the OpenGL forum FAQ, there are links given to the BlueBook, and the RedBook. The BlueBook link doesn't work anymore, and the RedBook links to a manual for version 1.0 ...so, does anyone know where I could find updated versions of these two books?


A google query would have solved this. Here are some links that I found:
http://www.opengl.org/documentation/blue_book_1.0/
http://www.amazon.com/exec/obidos/tg/detail/-/0201657651/ref=pd_sxp_f/103-0550504-2139847?v=glance&s=books

I don't own the blue book, so I can't comment on it. However, the red book is a very good resource if you're using OpenGL.
There is yet another book, The OpenGL Shading Language. It is a very thorough reference for glsl. I would not recommend this book until you are very familiar with OpenGL.

Quote:

2) I'm actually trying to develop a game with graphics close to commercial quality, so...I think i should use something past OpenGL 1.1 (I'm developing on a Windows XP). What would be a good manual (besides the one provided in the "Game Programming: Tricks of teh Trade" book)?


The quality of the graphics do not essentially depend on which version of OpenGL you are using. In my opinion, it's got more to do with the quality of the game content.
Newer versions of OpenGL allow for a lot of functionality which can prove useful. You can still access this functionality through OpenGL extensions.

Quote:

3) Are there any benefits in developing OpenGL games on a non-Windows platform? Like, getting the latest libraries or something?


Not quite. You would probably have to access new functionality through extensions anyway.

Quote:

4) Does anyone have a sample code to get me started with using OpenGL? (Yeah, I know there's NeHe's tutorials, but I think they're a bit outdated....but then again, I'm fairly new to this, so I just might be talking out of my ass here)


I learned OpenGL from NeHe. It is a very good resource for beginning OpenGL.
Also, I recommend the OpenGL Programming Guide ("the red book").

Share this post


Link to post
Share on other sites
Quote:
I'm fairly new to using OpenGL (and game development in general, actually


Quote:
I'm actually trying to develop a game with graphics close to commercial quality, so...


ERROR
ERROR

Share this post


Link to post
Share on other sites
Your post sound like you want to start programming OpenGL without even learning the basics, just go with the advanced stuff.
That definitelly won't happen :-) A lot of people think they want to skip the basic stuff and just work on a commercial game product (including me when I was learning OpenGL :-). But take my suggestion and start with the basics at NeHe.
The tutorials are NOT outdated, as said earlier, OpenGL is a stable API. Furthermore, you won't have anything other than OpenGL 1.1 on a normal Windows PC - even with Windows XP. It's the Gfx Drivers, that add several extensions to the standard 1.1 API but read more about this on NeHe ;-) But keep in mind, that OpenGL is all based on extensions, while DirectX usually is available in a whole new release as soon as important features are added to new Hardware.

Starting with OpenGL is a good choice, though. I find the OpenGL API being more straight forward than Direct3D, though, when you're familiar with OpenGL it's not so hard anymore, to switch to Direct3D and vice versa, though the other way round might be more difficult for a beginner...

As said earlier in this thread, the reference books are available in newer versions. You might want to buy them and hold a "real copy" in your hands or just download them over the net. They are free and available from various sources: Use google on this!

So now: Go to NeHe's page and start off, putting your idea into code ;-)

Hope this helps...
ZMaster

EDIT: Sorry forgot... Here's something to read for you:
Ultimate Gameprogramming
Gametutorials

Share this post


Link to post
Share on other sites
NeHe definatly. Just start on the easy tutorials and work upwards. Some good sites are also:

Game Tutorials
(Unfortunatly it was a lot better when the tuts were free)

Ultimate Game Programming

EDIT: Make sure you are up to scratch with C++, otherwise you will be in a whole new world of s**t.

Quote:
Original post by ZMaster

EDIT: Sorry forgot... Here's something to read for you:
Ultimate Gameprogramming
Gametutorials


Bumgrapes.

Share this post


Link to post
Share on other sites
How about starting OpenGL 1.5 + GLSL on Linux and Windows? I'm especially interested in Linux.

Where can I find OGL headers and OGL precompiled libraries, samples, tutorials, etc. Also I have ATI card.


Share this post


Link to post
Share on other sites
Quote:
Original post by NamelessTwo
I'm especially interested in Linux.

Where can I find OGL headers and OGL precompiled libraries, samples, tutorials, etc. Also I have ATI card.


It would depend on your distribution. Usually the OpenGL and GLU headers are installed in /usr/include/GL. If you're running X, then it's likely that they're installed. In Debian, for instance, the headers are included in the xlibmesa-gl-dev and xlibmesa-glu-dev packages.
Otherwise, the ATI drivers should install the necessary libraries and headers.

Share this post


Link to post
Share on other sites
Quote:
Original post by James Trotter
It would depend on your distribution. Usually the OpenGL and GLU headers are installed in /usr/include/GL. If you're running X, then it's likely that they're installed. In Debian, for instance, the headers are included in the xlibmesa-gl-dev and xlibmesa-glu-dev packages.
Otherwise, the ATI drivers should install the necessary libraries and headers.


About the header files: I don't think they are part of the driver. As with windows, the drivers only overwrite your gl libraries. This can be especially annoying on linux distributions which come with bad headers (such as my old Red Hat 7.2 distribution). You can solve that by overwriting the gl headers with the MESA headers, or by using GLEW. I would recommend GLEW, as it is a perfect tool for creating platform-independant OpenGL programs (especially if you use the latest extensions).

Tom

Share this post


Link to post
Share on other sites
As far as I know, GLEW doesn't actually let you write platform-independent OpenGL programs in itself. It allows for cross-platform means of using OpenGL extensions. You might have meant GLFW, which is a framework for writing cross-platform OpenGL applications. (However, if you're new to OpenGL I'd recommend you use GLUT instead. This is what they use for the code examples in the red book.)

Share this post


Link to post
Share on other sites
Quote:
Original post by James Trotter
As far as I know, GLEW doesn't actually let you write platform-independent OpenGL programs in itself. It allows for cross-platform means of using OpenGL extensions. You might have meant GLFW, which is a framework for writing cross-platform OpenGL applications. (However, if you're new to OpenGL I'd recommend you use GLUT instead. This is what they use for the code examples in the red book.)


That is correct. My wording was rather ackward. What I meant to say, was that it allows platform independant access to the GL library and extensions. Of course, for os-dependant things like creating windows, you could use glut.

Tom

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by James Trotter
Quote:
Original post by NamelessTwo
I'm especially interested in Linux.

Where can I find OGL headers and OGL precompiled libraries, samples, tutorials, etc. Also I have ATI card.


It would depend on your distribution. Usually the OpenGL and GLU headers are installed in /usr/include/GL. If you're running X, then it's likely that they're installed. In Debian, for instance, the headers are included in the xlibmesa-gl-dev and xlibmesa-glu-dev packages.
Otherwise, the ATI drivers should install the necessary libraries and headers.


I use Ubuntu and it comes with Mesa 5 which does not support OGL 1.5 but I intend to compile Mesa 6. Is it possible to install Mesa locally just for the program I develop or I have to replace the original Mesa? I want to do this so that the end user does not need to update his Mesa.

What is GLEW? Does it replace gl.h and glu.h and the appropriate libraries?

Where can I find OpenGL 1.5 headers for Windows?

Share this post


Link to post
Share on other sites
Quote:
Original post by James Trotter
As far as I know, GLEW doesn't actually let you write platform-independent OpenGL programs in itself. It allows for cross-platform means of using OpenGL extensions. You might have meant GLFW, which is a framework for writing cross-platform OpenGL applications. (However, if you're new to OpenGL I'd recommend you use GLUT instead. This is what they use for the code examples in the red book.)


For better crossplatform compatability I'll use SDL - OpenGL, SDL, GLSL and standard C++ libraries only.

I have lots of books and tutorials about OpenGL but none explain how to use the latest versions and GLSL on ATI hardware. That's why I'm asking here.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I use Ubuntu and it comes with Mesa 5 which does not support OGL 1.5 but I intend to compile Mesa 6. Is it possible to install Mesa locally just for the program I develop or I have to replace the original Mesa? I want to do this so that the end user does not need to update his Mesa.


I use Ubuntu too. [smile]
If the mesa library uses shared linking, then it has to be available on the system running your programs. If it is statically linked, however, then all the symbols should be included in the executable you compile on your system.

Quote:

What is GLEW? Does it replace gl.h and glu.h and the appropriate libraries?


Not exactly. It does not replace gl.h and glu.h, but it does provide definitions and entry points for functions defined in the OpenGL specification not otherwise available. In other words, it allows you to use OpenGL 2.0. But, of course, only if your graphics card supports the necessary extensions.

Quote:

Where can I find OpenGL 1.5 headers for Windows?


GLEW is cross-platform, and works just as well in Windows as in Linux. (I've tried them both myself!)

Quote:
Original post by NamelessTwo
For better crossplatform compatability I'll use SDL - OpenGL, SDL, GLSL and standard C++ libraries only.


SDL also allows you to create cross-platform OpenGL applications. Though, personally I prefer GLFW or glut. SDL is really more than just a windowing framework, and provides alot of unnecessary functionality for my needs. Although it certainly is cool that it provides you with functionality for audio, CD-rom, timers, threads, and probably more.

Quote:

I have lots of books and tutorials about OpenGL but none explain how to use the latest versions and GLSL on ATI hardware. That's why I'm asking here.


I'm pretty sure you need to access glsl functionality through extensions, (ARB_shading_language_100, ARB_shader_objects).
That at least goes for OpenGL's interface to glsl programs. You can write glsl code independently, as it's a language of its own.

[Edited by - James Trotter on July 6, 2005 2:01:22 PM]

Share this post


Link to post
Share on other sites
Thank you for your extensive reply!

Quote:

Not exactly. It does not replace gl.h and glu.h, but it does provide definitions and entry points for functions defined in the OpenGL specification not otherwise available. In other words, it allows you to use OpenGL 2.0. But, of course, only if your graphics card supports the necessary extensions.


So I've found this tutorial:
[url]http://www.lighthouse3d.com/opengl/glsl/index.php?ogloverview[/url]
It describes how to setup OpenGL with GLEW and glut.

I think that current ATI drivers support OpenGL 1.5 only. Probably both on Windows and Linux.
Would I be able to use OpenGL 1.5 functionality with GLEW? I've also checked GLEE but I don't see the difference.

In case I have OpenGL 2.0 compatible driver and MESA 5.0 (which supports only... I don't know what version but it isn't greater than 1.4 for sure), could I use OpenGL 2.0 functionality with GLEW?

Are there any other GLEW tutorials for beginners?

Quote:

Quote:

I have lots of books and tutorials about OpenGL but none explain how to use the latest versions and GLSL on ATI hardware. That's why I'm asking here.


I'm pretty sure you need to access glsl functionality through extensions, (ARB_shading_language_100, ARB_shader_objects).
That at least goes for OpenGL's interface to glsl programs. You can write glsl code independently, as it's a language of its own.



Yes that is true.

Share this post


Link to post
Share on other sites
Quote:
Original post by NamelessTwo
Thank you for your extensive reply!

I think that current ATI drivers support OpenGL 1.5 only. Probably both on Windows and Linux.
Would I be able to use OpenGL 1.5 functionality with GLEW? I've also checked GLEE but I don't see the difference.


I have never used GLEE, so I'm not certain. Though, I do think it generates definitions and entry points for OpenGL extensions automatically from the their specifications, like GLEW does. Someone here should be able to verify/correct this.

Quote:

In case I have OpenGL 2.0 compatible driver and MESA 5.0 (which supports only... I don't know what version but it isn't greater than 1.4 for sure), could I use OpenGL 2.0 functionality with GLEW?


I hope you realize that mesa does not benefit from hardware acceleration. If your drivers support it you should be able to use OpenGL 2.0 functionality. To check this, do something like:


if (GLEW_VERSION_2_0) {
// Use OpenGL 2.0 code...
} else if (GLEW_ARB_shading_language_100) {
// We can't use OpenGL 2.0, so use the ARB_shading_language_100 extension instead...
}


Quote:

Are there any other GLEW tutorials for beginners?


GLEW is extremely simple to use. All you should need to know is explained under GLEW basic usage.

Share this post


Link to post
Share on other sites
Quote:

I hope you realize that mesa does not benefit from hardware acceleration. If your drivers support it you should be able to use OpenGL 2.0 functionality. To check this, do something like:


I mean the OpenGL headers in Ubuntu are those from the MESA library.

Quote:


GLEW is extremely simple to use. All you should need to know is explained under GLEW basic usage.


Sometimes I'm blind and stupid. I've been reading this page and I haven't seen this link! Horrible!

Thank you you've helped me a lot. I'm going to try it soon. I'll do a little bit more research & reading before I start. I think you've cleared alot of things for me.

Share this post


Link to post
Share on other sites
Quote:
Original post by NamelessTwo
Quote:

I hope you realize that mesa does not benefit from hardware acceleration. If your drivers support it you should be able to use OpenGL 2.0 functionality. To check this, do something like:


I mean the OpenGL headers in Ubuntu are those from the MESA library.



Ah, yes. I'm sorry, I misunderstood. You can actually use GLEW to access the functionality of OpenGL 2.0 (or any other version for that matter), regardless of the OpenGL headers installed on the system. I'm pretty certain that when you include glew.h. it takes care of defining all the things which are usually in gl.h. You don't actually include gl.h at all.

Quote:

Thank you you've helped me a lot. I'm going to try it soon. I'll do a little bit more research & reading before I start. I think you've cleared alot of things for me.


I'm glad I could help. [smile]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this