Fairly small OpenGL GLUT example not running on OSX

Member
Posts: 321
Joined: 2004.10
Post: #1
Anyone up for a challenge. I've been hacking at this Gordian Knot
for some time -- it's probably not that hard. I'm just no Alexander.

There are two fire/water example source code projects at
http://www.mkp.com/opengl (water.c and particle.c)
that I'd like to get working on OSX so I can play with the code
and learn from it. The code comes from the book "Advanced Graphics
Programming Using OpenGL".

It seems to be written for windows/linux. I can get both to compile
and link in Xcode with trivial tweaking, but when I run them I get
just... well, nothing.

The book is quite advanced (at least for me) and these guys really
know their stuff. There code is quite good too except for their
glutReshapeFunc(reshape) function: there is none!? Instead they
put the functionality that one would expect to go there, in their initialization
function.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
chnge the makefile to somthing like
LIBS = -L/usr/X11R6/lib -framework GLUT -framework OpenGL -lX11

and the includes in the files frlm GL/glut.h to GLUT/glut.h
also, add #include <OpenGL/gl.h>


make -f Makefile.linux


PS the examples suck

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 321
Joined: 2004.10
Post: #3
I brought them over into Xcode. Yeah, I'm underwhelmed too Sad
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #4
hehe yeah
well nehe has good stuff but I dont know..
I dont see much inspirational 3D gfx these days :|

a lot of cool stuff from the demoscene though (sucks to have to run it all in windows)

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
spaceb
Unregistered
 
Post: #5
WhatMeWorry Wrote:It seems to be written for windows/linux. I can get both to compile
and link in Xcode with trivial tweaking, but when I run them I get
just... well, nothing.

The book is quite advanced (at least for me) and these guys really
know their stuff. There code is quite good too except for their
glutReshapeFunc(reshape) function: there is none!? Instead they
put the functionality that one would expect to go there, in their initialization
function.

That's one thing I've never liked about OpenGL - it's error handling. You basically have to hack away at most bugs until you find out you were doing something ridiculous like drawing everything behind you...

One thought - Are you using loaded images for texture mapping? Sometimes that causes problems going between systems.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
spaceb Wrote:That's one thing I've never liked about OpenGL - it's error handling. You basically have to hack away at most bugs until you find out you were doing something ridiculous like drawing everything behind you...

That's not an OpenGL error, it's a user error... how could it know you meant to draw stuff somewhere else?

If you're using the OpenGL profiler, you can cause it to "break on error", which'll show you which functions cause OpenGL errors immediately they do.

Quote:One thought - Are you using loaded images for texture mapping? Sometimes that causes problems going between systems.

a) the problem's been solved, months ago... and b) only if the texture loading code is exceptionally poorly written...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GLUT, C++, and Opengl with Xcode WhatMeWorry 4 6,313 Jul 2, 2006 07:42 AM
Last Post: codemattic
  Configuring a makefile for OpenGL / GLUT zed_katarn 4 4,428 Feb 15, 2006 03:45 PM
Last Post: zed_katarn
  Attaching OpenGL Profiler to a running application scgames 9 4,768 Jan 18, 2006 04:27 PM
Last Post: scgames