[HOpenGL] HOpenGL1.02 on Sun's?

C.Reinke C.Reinke@ukc.ac.uk
Fri, 14 Jun 2002 19:49:47 +0100


> > [...] according to my reading of the OpenGL spec, it seems part of
> > the update to 1.2 (it's hidden in some table as GL_TEXTURE_BINDING_xD,
> > where x should presumably include 3 now).
> 
> Hmmm, the OpenGL spec is a bit strange here: GL_TEXTURE_BINDING_xD is
> not mentioned in the index, but is used in the tables describing the
> state queries. But it's quite clear that GL_TEXTURE_BINDING_3D should
> be there if texture objects and 3D textures are supported (both OpenGL
> 1.2 features). SUN's header claims to implement 1.2, but fails to #define
> the above token. 

I guess it's a bug. It's easy enough not to see this in the spec,
but I don't understand that the conformance tests (if any) didn't
pick it up and that noone has complained before.. If I get around to
it, I might let them know..

> Simple solution: Either comment it out if you don't need it or
> have a look at your favourite correct header and substitute the
> numeric value, perhaps the query is implemented nevertheless.

Forgot to answer this, because I ran into an unrelated problem,
but I should at least reassure other Sun HOpenGL users a bit;-).

Uncommenting seems to work, but I noticed some other installation
issues, related to us not having GLUT in the standard place. I guess
they are bugs in HOpenGL's configure script? I append a log of what
I had to do below. 

This doesn't help me because our Sun's are used as servers, accessed
mostly from PCs, via Exceed, and that doesn't seem to support GLX by
default. I've seen Exceed 3d mentioned on their product page

  http://www.hummingbird.com/products/nc/exceed/

which looks like the solution to this problem - does anyone here have
experience with that?-)

Btw, Ronald Legere (who first confirmed the Sun header problem off
list) vaguely recalled two other problems, default shell and black
windows, which I might be able to shed some light on:

- default make on Suns tends not to be gnu make, so you explicitly 
  have to call gmake, unless you've got a portable makefile.

  > which make
  /usr/ccs/bin/make

- black windows can easily be caused by a sub-optimal
  color-allocation scheme in some Sun graphics implementations:
  if one application "steals" all colors in the map (netscape was
  a favorite for that), new applications may come up empty-handed.

  I seem to recall that there was a way to make programs behave
  better, but otherwise moving the mousepointer into the new black 
  window might be sufficient to cause another disconcerting effect -
  now the new app gets its colors alright but all the surroundings 
  look very strange.

> This is just another example why the next release of HOpenGL won't
> depend on those #defines, but will use numeric values directly...

? bypassing the specified API in favour of values taken from sample 
  implementations doesn't strike me as a particularly good idea?

Cheers,
Claus

-------------- installation log

# GLUT isn't in the standard place here..
# configure recommends to set environment variables in such cases,
# but in this case, this is going to cause problems below

setenv LDFLAGS "-L/usr/local/packages/glut/lib/glut/" 
setenv CPPFLAGS "-I/usr/local/packages/glut/include/"

# Sun doesn't seem to have read the OpenGL1.2 spec:
# GL_TEXTURE_BINDING_3D is missing in GL/gl.h..
# remove GL_TEXTURE_BINDING_3D from lib/GL_EnumQueries3.gc

# ghc and green card were not in standard places, no problem

./configure \
  --with-hc=/home/cur/cr20/public/haskell/ghc-5.02.2/bin/ghc \
  --with-green-card=/home/cur/cr3/software/gc-2.03/src/green-card

# Sun's default make is *not* gnu make!

gmake depend

# unfortunately, HOpenGL's configure hasn't recorded the settings 
# for LDFLAGS and CPPFLAGS to pass them on to ghc..
#
# also, configure has added all kind of strange flags, but *not*
# the ones that are needed, namely: -lGLU -lGL 
#
# so we need to modify in config.mk by hand:
# 1. add  -lGLU -lGL to GL_LIBS
# 2. add LDFLAGS to GL_LIBS
# 3. add CPPFLAGS to HC_OPTS

  ---snip
  GL_LIBS   +=  -lSM -lICE  -L/usr/openwin/lib -R/usr/openwin/lib -L/usr/local/packages/glut/lib/glut/ -lglut -lGLU -lGL -lX11 -lXext -lXmu -lXt -lXi -lsocket  -lnsl -lm

  HC_OPTS   += -fglasgow-exts   -I/usr/openwin/include -I/usr/local/packages/glut/include/ "-\#include <GL/glut.h>"
  ---snip

gmake