YES! Sorry, you are correct. All those books were not written just for linux users!
I was mixed up slightly because of course the chapters on "OGL without glut" are divided into linux, windows, and mac. I had it in my head I'd just been following the linux part, silly me.
So yeah, that is the further point of glut -- to provide a uniform standard for the window management...however, this may be where the glut/freeglut distinction became an issue, since originally freeglut may not have been available for windows (methinks it is now), qv:
http://freeglut.sourceforge.net/index.php#download
Which basically explains that it is a 100% compatible replacement AND that it is an improvement. In my experience, there are no issues there. zacs7 is just a silly fool.
Last edited by MK27; 09-28-2009 at 12:26 PM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Oh come on. If you are worth your salt, you can deal with the treeview! After that it is mostly tea and crumpets.
Plus Qt is butt-ugly
Vis, "so much more", GTK is build on glib which is built with pthreads, I think these are portable too. glib is quite a monster if you like built in complex datatypes, threaded timers, threaded file handle/socket monitors, etc.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Qt looks almost like I want my C++ class libraries look like. But this is just matter of taste.
I'm rather positive that glut works on Linux, Mac, and Windows (maybe others, IDK).
@OP
To compile via command line without make just use
However, I suggest you get acquainted with an IDE or learn to use automake && autoconfig as they will make your life much easier.Code:g++ -o myprogram mysource.cpp -lSDL
Check out lazyfoo for great SDL tutorials.
Checkout VTR for good Glut/OGL tutorials.
Also, I'm just starting to learn c++, so I would not call myself a graphics expert (or any other sort of expert). So take any advice I give you with caution
cs_student
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
2D graphics with the SDL: The SDL is a cross-platform C library with bindings to other languages. One of my favourites.
I'll recommend the Lazy Foo tutorials a third time. Compiling an SDL program is usually done with a command line like
If you're lazy like me, you could probably get away withCode:$ gcc `sdl-config --cflags` *.c -o program `sdl-config --libs`
The command-line suggested above, namelyCode:$ gcc -I /usr/include/SDL *.c -o program -lSDL
works too if you #include <SDL/SDL.h>, but not if you use <SDL.h> or "SDL.h". The latter is recommended.Code:g++ -o myprogram mysource.cpp -lSDL
3D graphics with OpenGL: OpenGL is just the way to go if you want 3D graphics.
You can use [free-]glut if you like, or the SDL, or Qt to provide a wrapper around your OpenGL code. Those three are just the ones I've used, there are certainly others. Freeglut is definitely the simplest, I'd suggest starting there.
Compiling an OpenGL program can usually be done with a command-line like
Add -lGLu if you're using GLu, and add -lglut if you're using [free-]glut.Code:$ gcc *.c -o program -lGL
GUI programming with Qt: I must say I've never used Qt 4 to any large degree, but I have used Qt 3, and it's a very nice toolkit. Qt is C++, cross-platform, and with a large number of available widgets built-in. Qt 3 is apparently a pain to get to work on Windows, but I assume Qt 4 is easier.
GUI programming with GTK+ or wxWidgets: Sorry, never tried those, I can't really help you there. GTK+ is a C library, and wxWidgets is a C++ one.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Yes, everyone does. But those are C++ tutorials, the OP is asking about C.I'll recommend the Lazy Foo tutorials a third time.
There is very little material on SDL in C on the web, beyond their official stuff (which is good):
http://sdl.beuc.net/sdl.wiki/HelpContents
I also have a long, well put together, very in-depth HTML'ified thing called the "SDL Library Documentation", but I do not know where I got it -- the only thing I've done with SDL was the tuxpaint patch hack, and that helped much there.
I notice that if you google "SDL Library Documentation" there are some possible online & pdf versions around.
I have a suspicion the people who did that (SDLdoc) created the help wiki since some of the text is word for word, while the old SDLdoc address is defunct.
And, once again, if you are using OGL with glut on linux, you need to link to X as well:
gcc test.c -lglut -lGLU -lGL -lXext -lX11
Last edited by MK27; 09-29-2009 at 11:03 AM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge