openGL + freeglut problems.

so I've pretty much finished console application programming and it's a lot of fun, but I've been trying to find out how to start doing graphics and window applications or window overlays that run on top of another programs display. So I looked around and found glut and saw it hasn't been updated since 2001 so I found something called freeglut which was updated this year being I want to develop with current tools and use openGL instead of directX as I wouldn't even be able to start with the most current release because I don't have windows vista+.
This being the best tutorial or guide I could find I followed these directions http://surflab.cise.ufl.edu/wiki/Getting_Started_with_OpenGL_in_VisualC%2B%2B_2010#Install_FreeGLUT
I downloaded extracted and placed the files in the correct spots
but came to my first problem that I'm even aware of which is, the sample code link which he has is invalid.
I really want to start programming applications with Gui's and graphics and I want to use the most up to date tools that would be best for a developer and I thought openGL and freeglut were the best options, am I wrong? I can't even get it to work and can't find any clear information on how to set it up.
I'm using windows XP with microsoft Visual C++ 2010 express.
I've got SDL to work, and I'm not sure if I want to put time and effort into learning it because it seems like it's only a 2D api... or what ever name it has...
OpenGL is just a graphics lib. It does not do things like audio, input, window management, etc. glut is sort of an addon that does window management, but still does not do audio/input/etc.

SDL and SFML are both libs that do pretty much the whole deal (window management, audio, input, graphics, etc). The two are very similar in nature, but executed a bit differently.

Reasons why SDL is better:

-) SDL has been around longer so it's supported on more semi-obscure platforms (like some consoles and portable devices).

-) SDL is much easier to install, because it doesn't require the lib to be recompiled. This also makes it easier to distribute with your program.

-) SFML requires you to rebuild the lib before you can use it. While this is mostly automated, many beginners seem to have trouble doing it, so it's generally a bit more difficult to set up than SDL.


Reasons why SFML is better:

-) SFML is more modern and uses OpenGL under the hood, so more modern drawing techniques are employed, which allow it to do things SDL can't easily do, like image rotation, flipping, employing pixel shading for fancy effects, etc. SDL drawing revolves around rather outdated drawing techniques, like surface blitting, dirty rects, etc.

-) SFML takes more advantage of C++ RAII concepts, so it's generally easier to learn and use.

-) SFML supports more things "out of the box" than SDL does, like loading various types of image formats (png, jpeg, etc), loading .ogg files for audio, and printing text. SDL only has built in functions to load bmp and wav, and has no way to output text to the screen. SDL has addon libs to support other formats (see SDL_Image and SDL_Mixer... and there's another lib for text output but I forget the name), but they all require additional dependencies, and before you know it you're using like 8 additional dlls for a simple hello world program.

-) Both libs have the option for you to use OpenGL directly, but since SFML already uses it under the hood, it works more naturally. For example, SFML loads images directly to OpenGL textures, whereas SDL loads them to "surfaces" which you must manually convert and put in textures. Plus, alternating between SFML output and OpenGL output is transparent and simple... so you can draw your scene in OpenGL, then switch to SFML to draw some text on screen very easily.




Both libs are built around 2D rendering, but as mentioned, you can ignore their drawing completely and use OpenGL directly with either of them.

Really, the big tradeoff between them is that SFML is harder to setup and easier to use, whereas SDL is easier to set up and harder to use.


I personally prefer SFML and typically recommend it to others. I tend to shy away from libs like glut because they're a little too minimalist for me.


If you're interested in SFML, Installation instructions are here:

To compile sfml:
http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

Making your first sfml program in visual studio:
http://www.sfml-dev.org/tutorials/2.0/start-vc.php



Or if you would rather just use SDL, you can. You said you already had it installed, so all you have to do is create your main display surface with the OPENGL option then just ignore all of SDL's drawing stuff and use OpenGL for drawing.
Well based off that, I'd rather use SFML over SML. But thinking about it I'm not sure if a 2D graphics drawing or access to openGL is what I really need and if I was going to make a game I'd probably use source or cry engine. I really only want to make programs with gui's or programs that have graphic overlay on another program, but i'm not sure if the second is something winapi could do. Recommendations?
If you're talking about widgetry like pushbuttons, text fields, and other typical windows controls, then OpenGL is not what you want. You would want a widgetry library.

You can use WinAPI, but there are also some crossplatform options available. wxWidgets and Qt are both very popular (google either one of them). I can't really do a real pros/cons comparison of them since I've never used Qt.
If I was going to make a game I'd probably use source or cry engine.


http://mycryengine.com/

CryENGINE3 is free for non-commercial game development.
Last edited on
iseeplusplus, I'm aware of cryengine being available for non-commercial use, valve's source engine is the same.

Disch, the best way i can describe it is this
http://www.youtube.com/watch?v=tcOVemvfqKc

I'll find a better example if you don't get what i'm talking about, but steam Valve's video game library has a ui overlay that comes up when you press shift tab and i'd like to be able to do that, it comes up in game in full screen. I'd imagine I'd be able to employ the same technique to have an interactive ui ontop of another ui program, would that widget library wxwidgets or QT I looked into them and it looks like it's able to make gui's but i'm looking for a little more.
Clutter is another option. It renders with openGL so it's hardware accelerated. No widgets. You create "actors", which you can load from an image file, or shapes. You can then do whatever you want with them, change opacity, position, size, add effects, animations, hide/show, connect functions to events on them. I've been using it for a while now and I love it.

If you make a gui with it, it's completely custom. But it can be a lot of work making everything yourself, without widgets. Right now I'm building an audio player with clutter. So far it has a signal level meter, a spectral analyzer, and file browser, and my code is a pretty dense 70 pages long.

Clutter is an open source (LGPL 2.1) software library for creating fast, compelling, portable, and dynamic graphical user interfaces. It is a core part of MeeGo, and is supported by the open source community. Its development is sponsored by Intel.

Clutter uses OpenGL for rendering (and optionally OpenGL|ES for use on mobile and embedded platforms), but wraps an easy to use, efficient, flexible API around GL's complexity.

Clutter enforces no particular user interface style, but provides a rich, generic foundation for higher-level toolkits tailored to specific needs.


http://www.clutter-project.org/
Last edited on
Topic archived. No new replies allowed.