OpenGL stuff

Hi, it's been a long time since I've been programming in C++, went to Java for the easy portability, but came back for the performance. What I'm here for are a couple of questions:

- Is it better(performance-wise) to use GLUT(or similar) or write platform specific way to open a window to work with OpenGL?

- What is a good site to show a simple how-to for OpenGL in C++?
(tried http://bobobobo.wordpress.com/2008/02/11/opengl-in-a-proper-windows-app-no-glut/ (had some errors) for non-glut and a site for GLUT - don't quite remember, but it was using freeglut.dll)

- What is the most compact way to work with OpenGL and C++ (least .dlls, change of code for other platforms, least total files - excluding textures ofc.)?
Last edited on
closed account (N36fSL3A)
- What is the most compact way to work with OpenGL and C++ (least .dlls, change of code for other platforms, least total files - excluding textures ofc.)?
Just statically link SFML or SDL. No DLLs, and it's pretty much a recompile.

- Is it better(performance-wise) to use GLUT(or similar) or write platform specific way to open a window to work with OpenGL?
Of course the platform specific way.

Arcsynthesis's OpenGL will teach you nice Modern OpenGL. (3.0+) The tutorial that you linked is depreciated OpenGL.
I came across this video a while back. I haven't watched it all but it looked promising.

http://www.youtube.com/watch?feature=player_embedded&v=T8gjVbn8VBk
Thank you for the answer, I've guessed that the code might be faster for platform specific build, thanks for confirming.

Also great thanks for reminding me of SFML, I've been working with it before, but somehow completely forgot it was capable of using OpenGL :P

About the tutorials, I did manage to find the one you mentioned, but failed to build it in the Makefile section - TBH never did it before that, so it was a little confusing. All other tutorials I've found have been quite outdated, several from year 2000 or a little later, this one was the most recent non-GLUT that I could find.
Actually, in general, a platform generic method should be exactly the same is a platform specific way. All the platform generic method does is add an abstraction layer to the actual windowing system - however, it uses the underlying platform API itself anyway. The only reason that would cause it to be slower is the extra layer of function calls, which makes a very negligible difference. In general, especially for just getting a window with an OpenGL context to draw in, platform generic methods are superior, due to the compatibility they offer. The only times that a platform generic method should be avoided is if a large amount of control is required over the window, such as (for example) making the window semitransparent, with a menu, advanced dialogue boxes and weird message handling schemes. But that is unlikely.

As for the arc-synthesis tutorials, what problems did you have? I didn't have any problems... maybe you could be using premake wrong and are generating Makefiles for the wrong target?
Another alternative if you want to be dedicated to OpenGL is GLFW. It's basically GLUT without all the disadvantages. I personally prefer it to SFML when you're working with dedicated OpenGL. The main thing separating it from SFML is that the API is very similar to OpenGL, and it is written in C. I like consistency, and thus I prefer GLFW.

Also, there is quite an annoying bug in the current release of SFML. On Windows, if you click out of your window (unfocus it), and then click on the context, it won't regain it's focus. As far as I know, it hasn't been fixed yet (even if I downloaded the source and built it myself).
Also, there is quite an annoying bug in the current release of SFML. On Windows, if you click out of your window (unfocus it), and then click on the context, it won't regain it's focus. As far as I know, it hasn't been fixed yet (even if I downloaded the source and built it myself).


This particular bug if I am understanding you right has been fixed quite some time ago actually. https://github.com/LaurentGomila/SFML/issues/437 and https://github.com/LaurentGomila/SFML/pull/457
I believe I remember hearing something about this: but that's still an annoyance with SFML. The official download (source and pre-built) still have this bug, and that means anyone who doesn't download it from the Github is screwed over in that regard.
Topic archived. No new replies allowed.