Index: [thread] [date] [subject] [author]
  From: Jon M. Taylor <taylorj@gaia.ecs.csus.edu>
  To  : ggi-develop@eskimo.com
  Date: Fri, 30 Jul 1999 14:16:51 -0700 (PDT)

Re: GLUT and ggi

On Fri, 30 Jul 1999, James Simmons wrote:

> On Fri, 30 Jul 1999, Jon M. Taylor wrote:
> 
> > > One thing tell the mesa guys to go
> > > over the vector code. Its kill my programs. I can send you specific bugs
> > > if you want to pass them onto the Mesa group. 
> > 
> > 	There is a mailing list for this, mesa-bugs@mesa3d.org.  All bug
> > reports must be submitted there or they will probably not get looked at.
> 
> Okay. I kind of figure that. Just pointed out execpt for some mesa code 
> thats not ggi based it works great. I love running at 50 fps.
> 
> > > Whats the deal with GLUT by
> > > the way? Still having problems with the copyright? 
> > 
> > 	I'm not going to worry about it anymore.  Not many serious games use 
> > GLUT anyway and that is my primary area of concern right now.  GLUT is 
> > now in the Mesa CVS tree, although it is not supposed to be modified.
> > 
> 
> I just did it because quote glut is supposed to make opengl totally
> platform independent. 

	Yes, this is true.  If you don't use GLUT, you have to use one of
the platform-specific OpenGL interface libraries (GLX, GGIMesa, WGL, etc)
and use those libraries to create, destroy, map and unmap buffers and
OpenGL contexts.  GLUT is supposed to wrap all of this in a completely 
platform-independent management layer, which it does.  However, GLUT also 
does a whole lot of additional stuff, most of which is not necessary for 
the core purpose of making OpenGL platform-independent:

* Input device handling
* Windowing and menuing
* Event handling, timers and callbacks
* Font handling
* Prebuild high-level models (sphere, cube, cone, torus, etc)

	See, the problem is that GLUT was originally written by Mark Kilgard
as a toolkit to be used with a how-to-program-OpenGL textbook.  Thus, its
design was informed by the desire to keep its users from having to do as
little programming as possible outside of straight OpenGL, and on many
different platforms.  Thus, GLUT is actually _too_ high-level for many
real-world tasks (like games) - it abstracts so much stuff that an optimized
implementation takes far too much work to do properly.  Most of GLUT could be
better implemented by using LibGGI, LibGII, LibGWT, LibGFont, etc etc etc.

> Also I have alot of OpenGL software that uses does
> use GLUT. I just got sick of running Mesa-GGI in X because of glut and I
> didn't want to rewrite all the OpenGL code to not use glut but use the
> MesaGGI context stuff. 

	I understand your frustration.  I really don't know what to tell you 
at this point.  Other than that you should be able to get the same 
gross-platform benefits of GLUT by using GGIMesa along with the rest of 
the GGI library system.  I realize that this doesn't help you run your 
existing GLUT-using code, but right now that looks to me like the lesser 
of two evils compared with rewriting GLUT and it would produce a much 
cleaner cross-platform OpenGL solution in the long run.

	We had a long discussion on mesa-devel a few month back about this
problem, and most people seemed to favor starting a new project to rewrite
all of GLUT as open-source.  Thomas Tanner and I favored a simpler approach,
which would take all of the existing OpenGL interface libraries (GLX,
GGIMesa, WGL, etc), figure out the common elements and pull those elements
out into a new generic cross-platform interface library which would use
dynamic libraries.  I didn't mention on the list the obvious fact that such a
library already exists and is called GGIMesa (|->).

> > 	I really don't know a whole lot about event handling in GGI/GII.  
> > That isn't my area.  You should ask someone else for help on this.  And I 
> > would not invest a whole lot of time in GLUT hacking until the copyright 
> > issues get straightened out, unless you are willing to rewrite the whole 
> > thing which would be a rather large amount of work.
> 
> I did it for my personal needs. I'm annouce it in case any one wanted to
> try Mesa completely without X. 

	Huh?  I have had Mesa without X working for months now.  Uwe's 
original ggimesa.c required only minimal patching.  I just did a clean 
download and build of GGIMesa from CVS, and ggi/demos/gears.c (which uses 
GLUT) build and ran just fine.

> Its bad enough when some OpenGL programs 
> require gtkgl now. Gtk is of course X window base which makes you stuck 
> at square one. Now with glut-ggi I get 50 fps instead of the crumy 18 fps.

	Yes, this situation needs to be resolved soon.  If you want to take a
serious stab at rewriting GLUT from the ground up to be based on GGI, I'd be
glad to help out.  The windowing, menuing, font handling and high-level
object handling would be the hard parts, but the rest of it (OpenGL context
management, input handling, events, window system bridging) could probably be
done fairly quickly and easily since most of the code already exists in
LibGGI and friends.  Most of the work would involve setting up the source
tree and build environment, and then writing the GLUT->GGI glue code, a lot
of which has already been written.  Let me know if you are interested. 

Jon

---
'Cloning and the reprogramming of DNA is the first serious step in 
becoming one with God.'
	- Scientist G. Richard Seed


Index: [thread] [date] [subject] [author]