PDA

View Full Version : GLUT emulation on a.n.other



Rob Fletcher
12-11-2002, 12:57 AM
Hi, thought a new thread is in order.

Given that the sources for GLUT don't seem to be ever going to make open-source, and there are many problems which need sorting out and updating. The argument for other packages is compelling - and hence the reason this section has others in it!

However, as pointed out by many, GLUT is pretty ubiquitous, and is used in many books and online web tutorials.

The proposal is to provide a GLUT emulation layer on top of a.n.other (maybe more than one) package.

However, it would NOT be sensible to try to recreate the whole API, and I therefore propose we should look to provide at least the functions calls used in e.g. redbook and the other major web sites. Not many calls in the end I'm sure.

Can folks please post up the list here so those of us considering doing the work can be sure we don't miss a call out.

With help I'm sure we can make this happen, and then the source code in so many places both on-line and printed can still work!

Rob.

marcus256
12-11-2002, 02:42 AM
Hi Rob,

Your proposal sounds like a good one. To make the process a bit quicker, maybe one could hack up a simple Unix shell script that does some statistics on GLUT programs.

Just download as many GLUT programs as possible (that seem relevant), place them in a dir, and do some clever grep | wc, and count the matches. That should give a good start. I'm not a shell guru, but I suppose csh or ksh should be the right tool.

Counting programs that use a certain call is probably better than counting total number of calls.

Function calls is not everything. Constants (e.g. glutGet( GLUT_XYZ )) are also important, but can be handled in the same way, probably.

That should give a rough break down, which can then be manually sorted in priority order.

Rob Fletcher
12-11-2002, 05:32 AM
hmmm

So, on the "redbook" directory with the distribution ..

glut function calls : 27

glutAddMenuEntry
glutAttachMenu
glutCreateMenu
glutCreateWindow
glutDisplayFunc
glutIdleFunc
glutInit
glutInitDisplayMode
glutInitWindowPosition
glutInitWindowSize
glutKeyboardFunc
glutMainLoop
glutMotionFunc
glutMouseFunc
glutPostRedisplay
glutReshapeFunc
glutSetColor
glutSolidCone
glutSolidCube
glutSolidOctahedron
glutSolidSphere
glutSolidTeapot
glutSolidTorus
glutSwapBuffers
glutWireCube
glutWireIcosahedron
glutWireSphere


glut constants: 14

GLUT_DOWN
GLUT_LEFT_BUTTON
GLUT_MIDDLE_BUTTON
GLUT_RIGHT_BUTTON
GLUT_UP
GLUT_RIGHT_BUTTON
GLUT_DOUBLE
GLUT_SINGLE
GLUT_DEPTH
GLUT_DOUBLE
GLUT_RGB
GLUT_INDEX
GLUT_ACCUM
GLUT_ALPHA

The problem space is therefore not big!

Does this now seem more feasible???

I guess people who use, or write, tutorials should add to this list any functions and GLUT constants they use so we don't miss too many!

Rob.

ldglite
12-11-2002, 10:08 AM
To make it even easier to build such an
emulation layer, you can probably borrow
some big pieces of this from the freeglut
sources which *are* open sourced.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/freeglut/freeglut/freeglut/

marcus256
01-03-2003, 03:01 AM
Originally posted by robus:
I count totally 107 distinct glut functions in "GLUT 3.7, Macintosh Implementation Reference Manual" and many, many constants and some built-in types.

The idea was to find the most widely used subset of GLUT to focus on when designing the emulation layer. Wouldn't it be nice if every single Redbook example compiled with the emulation library - even if it only implements 30% of the functions?

More functions would be added later, of course, but priority #1 must be to get a working prototype to build upon - a proof of concept if you will.

Rob: The next version of GLFW will be quite nice - superior keyboard interface for one thing: national keyboard, ISO-8859-1 8-bit encoding for the present key interface (plus loads of special keys, of course), plus an additional Unicode character/text interface (way ahead of GLUT anyway). Another thing is - Mac OS X support http://www.opengl.org/discussion_boards/ubb/biggrin.gif (state = "almost working").