Confuse with OpenGL, SFML, and its libraryopengl
Posted 06 October 2012 - 02:21 PM
Lately, I researched that "OPENGL" is one of the tools to use in graphics,
then I found out about "SFML" (I think that its a library or something that uses opengl).
I am so confuse because all books/ sites said using "GLUT",
but many people/fellow developers said that I must use a more updated one like "SFML"
but sfml has few/none tutorials.
What I am trying to say is "how to create own library or something like your own glut or sfml",
and why does opengl has no source code? And how can I use the EXACT(not glut/sfml) opengl in my c++
I am so confuse....
Posted 06 October 2012 - 05:09 PM
Now OpenGL itself is platform-independent, but in order to use OpenGL on a given platform, you have to first somehow create a window and tell the OS that you're going to be using OpenGL there. There are other things you'll want to do in a game, like receiving keyboard and mouse input, playing sound effects, measuring time, networking, and multithreading, that also require talking to the OS.
GLUT, SFML and so forth are wrapper libraries that hide all the platform-specific stuff. They give you a standardized way to create an OpenGL window as well as standardized ways to receive input, play sound effects, and all that other stuff. (Well, actually GLUT is a much smaller library; it only does windowing and input, not any of that other stuff.)
If you want to make a game that runs on PC, Mac, and Linux, then SFML or something like it would be useful, otherwise you have to write a bunch of different code for each OS. If you only care about one platform, though, you could just use that platform's own APIs. For example in Windows you could create your own window and use wglCreateContext etc. to initialize OpenGL.
Posted 06 October 2012 - 05:53 PM
Posted 06 October 2012 - 07:59 PM
As Reed said, OpenGL is an API. You can however view source code for the software implementations of OpenGL. I wouldn't recommend this unless you're really keen on knowing this stuff. You can download SGI's implementation here, or you can check out MesaGL's implementation here, which is basically the open source variant primarily used on *nix.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users