freeglut
20 years agoRemoval of all remaining TABs in the freeglut *.[ch] files. (I missed a
Richard Rauch [Tue, 11 Nov 2003 11:52:14 +0000 (11:52 +0000)]
Removal of all remaining TABs in the freeglut *.[ch] files.  (I missed a
few in the "one" demo, it seems, and some more crept back into
freeglut_(ext|font).c, presumably due to my own edits when I forgot to
use the "freeglut-c-mode" in EMACS.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@339 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMoved glutInit*() functions ahead of glutInit(). (This is proper use of
Richard Rauch [Tue, 11 Nov 2003 11:20:01 +0000 (11:20 +0000)]
Moved glutInit*() functions ahead of glutInit().  (This is proper use of
glutInit() in general, since it allows the user to override settings via
{argc, argv} command-line params.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@338 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoStyle normalizations: Removed CRs and hard TABs mostly.
Richard Rauch [Tue, 11 Nov 2003 11:18:16 +0000 (11:18 +0000)]
Style normalizations: Removed CRs and hard TABs mostly.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@337 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCorrected the numbering of the ChangeLog (there were two (110)s).
Richard Rauch [Tue, 11 Nov 2003 09:05:14 +0000 (09:05 +0000)]
Corrected the numbering of the ChangeLog (there were two (110)s).

Added entries summarizing my commits since September or late August, for
the benefit of those lacking both CVS and web access.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@336 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded CRs to the ends of all lines in MS developer studio demos.dsw file..
Richard Rauch [Tue, 11 Nov 2003 03:35:47 +0000 (03:35 +0000)]
Added CRs to the ends of all lines in MS developer studio demos.dsw file..

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@335 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoJohn's fix for the minimize/close/maximize controls no longer working.
Richard Rauch [Mon, 10 Nov 2003 18:19:53 +0000 (18:19 +0000)]
John's fix for the minimize/close/maximize controls no longer working.
WIN32 expected us to pass the message on up the chain (or do something
else with it), rather than just throwing away the event, for a certain
class of events.  (See the diffs for more details.)

The code is also slightly reformatted from what was previously in the
repository.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@334 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoA *.dsp file for CallbackMaker in the demos.
Richard Rauch [Mon, 10 Nov 2003 17:04:05 +0000 (17:04 +0000)]
A *.dsp file for CallbackMaker in the demos.

Plus updated *.dsp and *.dsw files to reflect the new freeglut header
file.

NOTE: The prior version of the *.dsw file does not in fact have CRs.  I
thought that it did.  For consistancy, I am not putting them in in this
version, either.  (At least one person said that his MSVC++ system is
happy with the current files.  If there are problems, we can easily add
the CRs, but that should be a separate commit...)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@333 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoNew demo from John: CallbackMaker.
Richard Rauch [Mon, 10 Nov 2003 16:01:05 +0000 (16:01 +0000)]
New demo from John: CallbackMaker.

This demo shows the use of every callback that you can register with
freeglut, and also generates event reports so that you can see what is
happening to the program as it runs.

Not much to look at, but both utilitarian and a practical example.

Please double-check that I updated everything that needs to be updated.
I reran autogen.sh and ./configure, and it built okay for me.  (^&

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@332 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoHm. I thought that I already hit this file for style normalization.
Richard Rauch [Mon, 10 Nov 2003 10:00:21 +0000 (10:00 +0000)]
Hm.  I thought that I already hit this file for style normalization.
Oh well...  Should be no functional changes.  Should be pretty
close to in-line with the style of changes that I've been making else-
where.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@331 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoOoops. Forgot that we already had a call to fgClearCallBacks() in the
Richard Rauch [Mon, 10 Nov 2003 09:45:47 +0000 (09:45 +0000)]
Ooops.  Forgot that we already had a call to fgClearCallBacks() in the
code and added a second one.  I just deleted the new one.  Sorry.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@330 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded Nigel's suggested code to clear all but the destroy callback early
Richard Rauch [Mon, 10 Nov 2003 09:42:14 +0000 (09:42 +0000)]
Added Nigel's suggested code to clear all but the destroy callback early
on, leaving Destroy to be cleared later after the last possible point
where it should be invoked.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@329 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoModified the menus to refer to {border} rather than {FREEGLUT_MENU_BORDER},
Richard Rauch [Mon, 10 Nov 2003 01:21:06 +0000 (01:21 +0000)]
Modified the menus to refer to {border} rather than {FREEGLUT_MENU_BORDER},
in fghDisplayMenuBox().  The local variable was already defined and used
for some purposes, so we might as well use it throughout.  It does serve
to shorten and clarify the code a bit---though I have mixed feelings about
creating aliases that way.

Still, the variable already existed and was already used in places.  (We
could even move it into the freeglut state, or make it a {const static}
value...)

Oh well.  Stuff to ponder.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@328 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoWell, a couple of days have gone by, so I assume that items (a) and (b)
Richard Rauch [Mon, 10 Nov 2003 00:32:15 +0000 (00:32 +0000)]
Well, a couple of days have gone by, so I assume that items (a) and (b)
in the freeglut_cursor.c file's "Open issues" comment are now satisfactor-
ily closed.

I also partially implemented some error-checking, using my limited
understanding of how Xlib users are supposed to do this.  (No one commented
about the lack of error-checking, pro or con.  Perhaps someone will care to
comment now?)

At present, it just will print out a warning, via fgWarning().  In part
because I'm not sure what is best to do, and in part because failure to
set the cursor type is probably not a fatal problem.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@327 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoApplied Braden McDaniel's non-srcdir build patch.
Christopher John Purnell [Sat, 8 Nov 2003 17:40:42 +0000 (17:40 +0000)]
Applied Braden McDaniel's non-srcdir build patch.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@326 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoA first pass over freeglut_menu.c to bring it in line with the rest of
Richard Rauch [Sat, 8 Nov 2003 11:28:34 +0000 (11:28 +0000)]
A first pass over freeglut_menu.c to bring it in line with the rest of
freeglut's style.  Mostly re-indenting and splitting long lines.
For those that may be concerned: No, I didn't do any more arrangments
of the form (CONST == a) rather than (a == CONST).  (^&

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@325 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAltered the way that the {random} value (from 0..3) is chosen.
Richard Rauch [Sat, 8 Nov 2003 01:56:45 +0000 (01:56 +0000)]
Altered the way that the {random} value (from 0..3) is chosen.

Previously, it picked out two adjacent bits in the result of rand().
Unfortunately, these adjacent bits (at least on NetBSD) have a certain
amount of dependance.  After a period (perhaps a thousand or so?), it
starts to repeat the pattern of those two bits.  (I think; I haven't
actually tested that directly.)  This presumably is locking it into a
an an N-way attractor on the "snowflake", such that if you zoom in a
ways, you will start to see some spots *quickly* are colored, and
others are *never* colored.

What I've done now is to pick up two widely-spaced bits in a single
rand() call.  (Perhaps we would do as well to pick up something like
bit #16 from two consecutive rand() calls?)  These widely-spaced bits
have a lower statistical dependance on one another (if I can get away
with using that term for an arithmetic operation; though since stats
has more to do with sampling and less to do with true randomness, I
may be safe).

The net effect, at leats on NetBSD, is far better snowflake if you zoom
in on it.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@324 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoFrom John:
Richard Rauch [Fri, 7 Nov 2003 17:30:32 +0000 (17:30 +0000)]
From John:

[This] implements the visible/invisible for Windows.  It does
NOT call the visibility callback, though.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@323 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoStripped out the now truly extraneous {braces} in such forms as:
Richard Rauch [Fri, 7 Nov 2003 15:50:56 +0000 (15:50 +0000)]
Stripped out the now truly extraneous {braces} in such forms as:

if( ... )
{
    INVOKE_WCB( ... );
}

Check for compiling on WIN32.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@322 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdopted Eero Pajarre's suggestion of using a do { ... } while
Richard Rauch [Fri, 7 Nov 2003 15:30:59 +0000 (15:30 +0000)]
Adopted Eero Pajarre's suggestion of using a do { ... } while
rather than { ... } for the INVOKE_WCB() macro.  This lets it
be used "more like a function", in that:

if( ... )
    INVOKE_WCB( ... );
else
    ...

...is now legal.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@321 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoPure code janitoring: Shuffled the order of some of the case statements
Richard Rauch [Fri, 7 Nov 2003 10:32:38 +0000 (10:32 +0000)]
Pure code janitoring: Shuffled the order of some of the case statements
in the UNIX_X11 X event processing loop.  (In general, it's nice to have
case statements sorted, especially when you have a *huge* switch statement
like this.  That makes it easier to find the one that you're looking for,
and to see if a certain case is defined...)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@320 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCombined EnterNotify and LeaveNotify event processing in the UNIX_X11
Richard Rauch [Fri, 7 Nov 2003 10:26:37 +0000 (10:26 +0000)]
Combined EnterNotify and LeaveNotify event processing in the UNIX_X11
event loop.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@319 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded ReparentNotify case to UNIX_X11 event loop, to catch the extraneous
Richard Rauch [Fri, 7 Nov 2003 10:22:31 +0000 (10:22 +0000)]
Added ReparentNotify case to UNIX_X11 event loop, to catch the extraneous
ReparentNotify event types (type 21).

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@318 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoOh well, I might as well add the call to clear callbacks on window
Richard Rauch [Fri, 7 Nov 2003 10:18:10 +0000 (10:18 +0000)]
Oh well, I might as well add the call to clear callbacks on window
destruction.  Also renamed the function to do this: fgClearCallBacks().
Ho-hum.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@317 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded fgInitCallBacks() to freeglut_structure.c. (The function takes
Richard Rauch [Fri, 7 Nov 2003 09:55:43 +0000 (09:55 +0000)]
Added fgInitCallBacks() to freeglut_structure.c.  (The function takes
an {SFG_Window *}.)  Added prototype to freeglut_internal.h.  Added use
of the function to the window initialization.  (Don't count on calloc(),
which sets all bits to 0.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@316 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoStyle normalization; removal of say-nothing-useful comments.
Richard Rauch [Fri, 7 Nov 2003 08:46:53 +0000 (08:46 +0000)]
Style normalization; removal of say-nothing-useful comments.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@315 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoNormalized the style of freeglut_font.c No substantial alterations.
Richard Rauch [Fri, 7 Nov 2003 08:25:30 +0000 (08:25 +0000)]
Normalized the style of freeglut_font.c  No substantial alterations.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@314 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoSomewhat normalized the style of this file.
Richard Rauch [Fri, 7 Nov 2003 08:06:10 +0000 (08:06 +0000)]
Somewhat normalized the style of this file.

Also moved the "glutMouseWheelFunc" extension down into the "extensions"
part of the table.  (Purely internal organization.  It will still be
found.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@313 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoFurther normalization of the code's style. No substantial changes.
Richard Rauch [Fri, 7 Nov 2003 07:57:03 +0000 (07:57 +0000)]
Further normalization of the code's style.  No substantial changes.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@312 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoSplit one last overlong line in freeglut_cursor.c.
Richard Rauch [Fri, 7 Nov 2003 07:48:13 +0000 (07:48 +0000)]
Split one last overlong line in freeglut_cursor.c.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@311 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded GLUT_CURSOR_NONE support in UNIX_X11 (well, NetBSD; you lot need
Richard Rauch [Fri, 7 Nov 2003 07:46:08 +0000 (07:46 +0000)]
Added GLUT_CURSOR_NONE support in UNIX_X11 (well, NetBSD; you lot need
to try it on others; (^&).

Deallocated some resources that we are creating.  VERY slight memory leak,
but plugged now.

These two complete the first two "Open issues" ( (a) and (b) ).  The first
one also completes X support for glutSetCursor().  If others can verify,
we can fully demote the outstanding bug over this to WIN32-specific.

I'll delete the dead Open issues and re-letter the others if someone will
cross-check me.  Or if no one says anything in a day or two.  (^&

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@310 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoFurther normalized the style of the cursor code.
Richard Rauch [Fri, 7 Nov 2003 06:25:20 +0000 (06:25 +0000)]
Further normalized the style of the cursor code.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@309 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoSlight style improvements. Two rules of thumb that are almost always
Richard Rauch [Fri, 7 Nov 2003 06:12:58 +0000 (06:12 +0000)]
Slight style improvements.  Two rules of thumb that are almost always
good to apply:

 * Don't write a == CONST.  Instead, write CONST == a.  Or, more generally
   (in C like languages): Avoid putting an lvalue on the left-hand side of
   an == comparison.  (For consistancy, I try to avoid lvalues on the left-
   hand side of any comparison---but == is the most notorious.)

   (An "lvalue" is a value that can safely go on the left side of an
   "=" assignment, of course.  (^&)

 * Do not write
       if( !condition )
           return;
       other_thing;
       return;

   (See page 18 of K&P's _The Elements of Programming Style_.)

   Instead, it is better to just write:

       if( condition )
           other_thing;
       return;

   There are times when sacrificing structured programming (e.g., via
   multiple return statements) is okay.  But, here, there is no apparent
   gain---indeed, there seems only loss---in the non-structured code.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@308 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoGrr. Forgot to enable the "freeglut" C programming mode in EMACS, and
Richard Rauch [Fri, 7 Nov 2003 05:46:33 +0000 (05:46 +0000)]
Grr.  Forgot to enable the "freeglut" C programming mode in EMACS, and
had a few TABs in the last commit.  This fixes that.  Sorry.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@307 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMinor corrections to the UNIX_X11 mouse-wheel support. In part this
Richard Rauch [Fri, 7 Nov 2003 05:43:34 +0000 (05:43 +0000)]
Minor corrections to the UNIX_X11 mouse-wheel support.  In part this
reflects that {button} is already shifted to the GLUT numbering, and
hence should be counted as 3&4, 5&6, etc.

The other change was simply to clarify the computation of {direction}.
The original code did some clever arithmetic.  The new code is more
straightforward, even if it requires more lines to express.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@306 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoOoops. I screwed up on part of John's fixes. Sorry.
Richard Rauch [Thu, 6 Nov 2003 23:40:21 +0000 (23:40 +0000)]
Ooops.  I screwed up on part of John's fixes.  Sorry.

I think that I have his fix properly committed now.  Mea culpa.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@305 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleanup pass after committing callback conversion (from structure to
Richard Rauch [Thu, 6 Nov 2003 23:29:55 +0000 (23:29 +0000)]
Cleanup pass after committing callback conversion (from structure to
array-of-pointers).  Mostly deleted commented-out struct-based code.
Also added some XXX comments that I though should be pondered.  (My
own pair of eyes, and one brain cell, were not sufficient at this time
to decide what to do for those ponderables.  (^&)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@304 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoConverted the "Callbacks" structure (with named members holding individual
Richard Rauch [Thu, 6 Nov 2003 22:09:35 +0000 (22:09 +0000)]
Converted the "Callbacks" structure (with named members holding individual
callback pointers) to a "CallBacks" array in fgState.  (This is to allow
us to write a loop to clear all callbacks from windows when the window is
dead/dying.  Using this, we can safely assign NULL to each in a loop.)

Support includes two new macros, FETCH_WCB() and INVOKE_WCB().  See
freeglut_internal.h for more details there.

Some typedefs of function pointer types were altered to make them more
uniform (necessary for the macros).

All references to window-based callbacks in freeglut are updated to
use the new macros.

Old usages will cause compile-time errors.

As a side bonus, the new invocation macro sets the current window and
checks pointers so that these common steps can be uniformly done on
every window-based callback.  This makes it easier to do things right.
At the same time, the array notation (and now required associated casts)
make it harder to bypass the macros and abuse the function pointers,
in general.

After this commit, I will go through the code and clean up dangling issues
about formatting.  This commit is just a "it now works, let's checkpoint it"
type of affair.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@303 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoFrom John, a couple of lines needed to be changed to fix the mouse wheel
Richard Rauch [Thu, 6 Nov 2003 21:41:17 +0000 (21:41 +0000)]
From John, a couple of lines needed to be changed to fix the mouse wheel
support on WIN32.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@302 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoUpdate from John: Includes mouse button, mouse motion, and mouse wheel
Richard Rauch [Thu, 6 Nov 2003 21:38:21 +0000 (21:38 +0000)]
Update from John: Includes mouse button, mouse motion, and mouse wheel
support.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@301 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMultiple changes from John. Style issues, plus a bug-fix to check
Richard Rauch [Tue, 4 Nov 2003 18:47:26 +0000 (18:47 +0000)]
Multiple changes from John.  Style issues, plus a bug-fix to check
a pointer before deallocating some memory.

He also removed one obsolete comment, and added some more comments.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@300 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoSome changes, mostly from John. Mostly style changes.
Richard Rauch [Tue, 4 Nov 2003 18:16:52 +0000 (18:16 +0000)]
Some changes, mostly from John.  Mostly style changes.

One bug fix from John: Execution state bug-fix in glutMainLoop(), per his
post yesterday.

One fix from me: Changed "if( ButtonPress )" to "if( pressed )".
{ButtonPress} is a constant.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@299 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoPer John's emailed desire to have all files obey UNIX EOL conventions,
Richard Rauch [Tue, 4 Nov 2003 16:08:26 +0000 (16:08 +0000)]
Per John's emailed desire to have all files obey UNIX EOL conventions,
I have stripped out carriage returns from this file.

This is the *only* change, but every line is touched.  If you want to
see the real differences between older and newer versions, you will have
to get local copies of each and first match their EOL convnetions.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@298 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoUpdate from John:
Richard Rauch [Tue, 4 Nov 2003 15:53:49 +0000 (15:53 +0000)]
Update from John:

I [John] added a feature to check for memory leaks under Windows.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@297 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoUpdate from John:
Richard Rauch [Tue, 4 Nov 2003 15:32:57 +0000 (15:32 +0000)]
Update from John:

I [John] converted everything to double precision to avoid compiler
warnings.  I also added a feature to check for memory leaks under
Windows and removed a memory leak (surprise!).

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@296 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoGot rid of the G_LOG_DOMAIN junk, per discussion on the mailing list.
Richard Rauch [Tue, 4 Nov 2003 01:30:32 +0000 (01:30 +0000)]
Got rid of the G_LOG_DOMAIN junk, per discussion on the mailing list.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@295 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMinor formatting quibbles. (The brain isn't up to anything more serious
Richard Rauch [Tue, 4 Nov 2003 01:17:18 +0000 (01:17 +0000)]
Minor formatting quibbles.  (The brain isn't up to anything more serious
at the moment.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@294 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMissed a block where one level was 2-space indented.
Richard Rauch [Tue, 4 Nov 2003 01:10:13 +0000 (01:10 +0000)]
Missed a block where one level was 2-space indented.

Nit-picked a few other lines for consistancy.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@293 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoFixed a memory leak (thanks for the correction, John!).
Richard Rauch [Mon, 3 Nov 2003 21:41:07 +0000 (21:41 +0000)]
Fixed a memory leak (thanks for the correction, John!).

Smoothed over some code style issues while I was here, but left the
init-string parsing alone for now.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@292 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoDeleted 3 files (again?) from CVS, on John's request. Old/obsolete
Richard Rauch [Mon, 3 Nov 2003 21:28:54 +0000 (21:28 +0000)]
Deleted 3 files (again?) from CVS, on John's request.  Old/obsolete
MSVC++ project files.
(freeglut13.dsp, freeglutdll.dsp, freeglutstatic.dsw)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@291 7f0cb862-5218-0410-a997-914c9d46530a

20 years ago * Indentation issues.
Richard Rauch [Mon, 3 Nov 2003 21:25:11 +0000 (21:25 +0000)]
 * Indentation issues.
 * Pulled some common code into a nicely packaged function.
 * Found some pointer/int issues.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@290 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoHeh.
Richard Rauch [Mon, 3 Nov 2003 10:56:48 +0000 (10:56 +0000)]
Heh.

Forgot to wrap the fgGetXModifiers() in a #if.  Fixed.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@289 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoExtracted some common code to a subroutine, in glutMainLoopEvent().
Richard Rauch [Mon, 3 Nov 2003 10:51:26 +0000 (10:51 +0000)]
Extracted some common code to a subroutine, in glutMainLoopEvent().
(The common code was a snippet to compute X keyboard modifiers as a
bit-mask of GLUT symbols.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@288 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCaught a few more little style issues.
Richard Rauch [Mon, 3 Nov 2003 10:31:41 +0000 (10:31 +0000)]
Caught a few more little style issues.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@287 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded a "case" for an X event that we turn on but do not use.
Richard Rauch [Mon, 3 Nov 2003 10:29:30 +0000 (10:29 +0000)]
Added a "case" for an X event that we turn on but do not use.
({MapNotify}).  We already caught {MappingNotify} and {UnmapNotify}.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@286 7f0cb862-5218-0410-a997-914c9d46530a

20 years ago * Fixed a bug in the X11 handling of scrollwheel/mouse. The old code,
Richard Rauch [Mon, 3 Nov 2003 10:05:07 +0000 (10:05 +0000)]
 * Fixed a bug in the X11 handling of scrollwheel/mouse.  The old code,
   I believe, checked if *either* a wheel or button callback was set,
   and then decided which to use---and unconditionally called it.
   I left the "either" check in, but added additional checks before
   actually doing the invocation.
 * Lots of reformatting.  Massive.  The usual suspects, though, and fairly
   trivial: Re-indenting to standard size, shuffling some spaces to match
   the freeglut "standard" of:
     if( ... )
   ...and:
     func( ... )

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@285 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleaned up one macro definition.
Richard Rauch [Fri, 31 Oct 2003 20:51:56 +0000 (20:51 +0000)]
Cleaned up one macro definition.

Picked up an over-long line that I missed before.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@284 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoFit some long lines to 80 columns.
Richard Rauch [Fri, 31 Oct 2003 20:49:07 +0000 (20:49 +0000)]
Fit some long lines to 80 columns.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@283 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoLast of the hard TABs in the src/*.c files.
Richard Rauch [Fri, 31 Oct 2003 13:40:08 +0000 (13:40 +0000)]
Last of the hard TABs in the src/*.c files.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@282 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoEn masse removal of most (I think) of the remaining hard TABs in files.
Richard Rauch [Fri, 31 Oct 2003 11:33:12 +0000 (11:33 +0000)]
En masse removal of most (I think) of the remaining hard TABs in files.
There are still a couple of files that need to be hit.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@281 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoPicked up some stray TABs scattered in this file.
Richard Rauch [Fri, 31 Oct 2003 11:28:14 +0000 (11:28 +0000)]
Picked up some stray TABs scattered in this file.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@280 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoNoted by XXX comments that the XFlush() calls probably shouldn't be there.
Richard Rauch [Fri, 31 Oct 2003 11:25:23 +0000 (11:25 +0000)]
Noted by XXX comments that the XFlush() calls probably shouldn't be there.
Flushing the X protocol stack every little bit both adds clutter to the
code and may impede performance.

It seems that we should be able to get rid of these, though
allowing client code to directly call glutMainLoopEvent() does make it
a little more complicated.

Something to ponder.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@279 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoPolished off the say-nothing-new comments and lines-over-80-columns in
Richard Rauch [Fri, 31 Oct 2003 11:11:48 +0000 (11:11 +0000)]
Polished off the say-nothing-new comments and lines-over-80-columns in
freeglut_window.c

There should be no functional changes.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@278 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMissed a few say-nothing-new comments in fgOpenWindow().
Richard Rauch [Fri, 31 Oct 2003 06:25:34 +0000 (06:25 +0000)]
Missed a few say-nothing-new comments in fgOpenWindow().
Eeep.  Should be better now.  (^&

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@277 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleansed fgCloseWindow():
Richard Rauch [Fri, 31 Oct 2003 06:20:07 +0000 (06:20 +0000)]
Cleansed fgCloseWindow():
 * say-nothing-new comments axed.
 * de-TABbed.
 * Made the white-space to be consistant.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@276 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleaned up fgOpenWindow():
Richard Rauch [Fri, 31 Oct 2003 06:11:25 +0000 (06:11 +0000)]
Cleaned up fgOpenWindow():
 * Removed TABs.
 * Made indentation consistant.
 * Deleted say-nothing-new comments.
 * Changed an *error*check* from an assert to an if().
   (The error-check was on window creation; we don't want to
    lose that if the user compiles with asserts deactivated.
    Also, assert()s really tell us more about programming errors,
    rather than run-time errors, so it is a little misleading to
    use assert() for error-checks, even if you can depend upon
    assert()s never being compiled away to null statements.)
 * Added some XXX comments for things that bear some rumination.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@275 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleanup to fgSetWindow(). The usual suspects:
Richard Rauch [Fri, 31 Oct 2003 05:34:19 +0000 (05:34 +0000)]
Cleanup to fgSetWindow().  The usual suspects:
 * Removed tabs.
 * Made indentation consistant.
 * Killed off say-nothing-new comments.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@274 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleanup to fgSetupixelFormat(). Should be no functional changes.
Richard Rauch [Fri, 31 Oct 2003 04:25:34 +0000 (04:25 +0000)]
Cleanup to fgSetupixelFormat().  Should be no functional changes.

Code facelift included:

 * Consistant indentation.
 * Removal of all TABs (there were a bunch).
 * Fit to 80 columns.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@273 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoThere should be no changes to code functionality, though a fair bit of
Richard Rauch [Fri, 31 Oct 2003 03:37:27 +0000 (03:37 +0000)]
There should be no changes to code functionality, though a fair bit of
little changes to the code appearance.

 * Fit the comments at the start of the file to fit 80 columns.
 * Noted an unusual feature of the ATTRIB() macro.
 * Added ATTRIB_VAL() macro which is really just two ATTRIB()s.
   This lets us put things like {ATTRIB (GLX_RED_SIZE); ATTRIB (1);}
   on one statement: {ATTRIB_VAL (GLX_RED_SIZE, 1);}.
   I did this to preserve some of the layout of information while also
   avoiding the nasty semi-visible ";" in the middle of a line of code.
   And by putting the {braces} in the macro definition, I was able to
   visually clean code of the form:
       if (condition)
       {
           ATTRIB( X ); ATTRIB( 1 );
       }
   ...rewriting as:
       if (condition)
           ATTRIB_VAL( X, 1 );
 * Eliminated a bunch of say-nothing-new comments in fgChooseVisual().
 * Combined some semi-useful comments into a block comment summarizing
   a loop.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@272 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoFinished off most of the issues with freeglut_structure.c, from a stylistic
Richard Rauch [Thu, 30 Oct 2003 04:43:08 +0000 (04:43 +0000)]
Finished off most of the issues with freeglut_structure.c, from a stylistic
point of view (at least, insofar as: The original file's code was INCON-
SISTANT.  I did not remove the "!= NULL" stuff, did not address the
shortest-branch-first issue for if-else statements, and left some rather
ugly "if (x) {... return y} /* else do this */ return NULL;" garbage.
This should, I think, be re-written as "if (x) return y; else return NULL;"
or even better, "ret = NULL; if (x) ret = y; return ret;"

In short, the code still has some issues, but I think that it's a bit
better.

(Oh, I also got rid of oustanding TABs.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@271 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoEliminated most of the say-nothing-new comments.
Richard Rauch [Thu, 30 Oct 2003 04:36:54 +0000 (04:36 +0000)]
Eliminated most of the say-nothing-new comments.

Fit most of the code to no more than 80 columns.

Raised some issues about completeness/correctness of trying to
decrement the max-window-ID (apparently in order to partially
recycle some window IDs to slightly slow the rate of growth of
window IDs).  (I didn't change what the code does, though.)

The functionality of the code should be unchanged.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@270 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoForgot to set {direction} explicitly to +/- 1 for freeglut mouse-wheel
Richard Rauch [Thu, 30 Oct 2003 03:51:33 +0000 (03:51 +0000)]
Forgot to set {direction} explicitly to +/- 1 for freeglut mouse-wheel
API on MS-WINDOWS.  Oops.

Now it should always report +/- 1 on MS-WINDOWS, per the spec.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@269 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMinor fix to allow for multiple ticks to be received at one time by the
Richard Rauch [Thu, 30 Oct 2003 03:20:24 +0000 (03:20 +0000)]
Minor fix to allow for multiple ticks to be received at one time by the
WIN32 code.  Take abs(direction) as the number of ticks, and count it
down.

<stdlib.h> *should* be included by freeglut_internal.h, I think, so it
should be okay; otherwise add a suitable #include.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@268 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoGrrr. My attempt to commit got aborted, and the commit message was lost.
Richard Rauch [Thu, 30 Oct 2003 03:08:16 +0000 (03:08 +0000)]
Grrr.  My attempt to commit got aborted, and the commit message was lost.
Now I've lost track of what I said I'd done.  Something like:

 * Fixed some issues with multiple wheels.
 * Noted in comments some issues about other-than-3-real-buttons.
 * Fixed formatting to fit 80 columns.
 * Removed some BCPL/C++ style comments (//) that are not legal, and
   which, if memory servers, are not even strictly legal when disabled
   by preprocessor directives.  E.g.,

   #if 0
     not-syntactically-valid-C
   #endif

   ...is not legal.  Though most cpp's will discard the bracketed material
   completely before the main C compiler pass has a chance to analyze the
   syntax.  (MSVC++ and GCC both don't seem to mind the BCPL style comments
   in plain C, but let's keep the sources clean, eh?)
 * Fixed a problem that would have caused freeglut to report doubled
   wheel events under XFree86.

Not tested other than compiling.  Personally, I think that the interface
is inherently broken at this point unless you are willing to get user-
configuration.  (Which would then solve the complaint that Steve had
about computing the tick-size on behalf of applications.)  I.e., there
is NO WAY to know if we have the right buttons to start wheels at, or
if there are any buttons after the first wheel(s), etc.  We just have to
guess---and if we are wrong, we can get varying degrees of brokeness.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@267 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoThere is a problem with the way I did glutFullscreen() in my last commit.
Christopher John Purnell [Wed, 29 Oct 2003 23:01:56 +0000 (23:01 +0000)]
There is a problem with the way I did glutFullscreen() in my last commit.
So I've copied the way the game mode does it.  It's not ideal but it works.
The glutGet() for the window border sizes will also have to be fixed at
some point.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@266 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoRewrote glutFullscreen().
Christopher John Purnell [Wed, 29 Oct 2003 18:19:17 +0000 (18:19 +0000)]
Rewrote glutFullscreen().
It now correctly places the window in X11.
It now uses system dependant code for more efficient use of
windowing system calls.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@265 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoShould be no real changes to the code function.
Richard Rauch [Wed, 29 Oct 2003 18:05:48 +0000 (18:05 +0000)]
Should be no real changes to the code function.

I missed a few lines that went past 80 columns.  (^&

Also made formatting more consistant.

Added a couple of XXX comments re. FreeBSD vs. general BSD #ifdef's.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@264 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoShould be entirely superficial changes to code style:
Richard Rauch [Wed, 29 Oct 2003 17:44:42 +0000 (17:44 +0000)]
Should be entirely superficial changes to code style:

 * Fit lines to 80 columns.  (It does get tiresome seeing long lines
   forced to break by the right-hand border of windows...(^&)
 * Eliminated say-nothing-new comments.
 * Made formatting more consistant in spots.
 * Eliminated some hard TAB characters.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@263 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded Thierry's change to include sys/param.h. This lets us pick out version
Richard Rauch [Wed, 29 Oct 2003 17:29:10 +0000 (17:29 +0000)]
Added Thierry's change to include sys/param.h.  This lets us pick out version
numbers for OS releases corresponding to system headers.

I modified it to also work with NetBSD; I cannot confirm if it is safe with
any other systems, so it remains protected by a #if.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@262 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoDeleted some say-nothing-new comments.
Richard Rauch [Wed, 29 Oct 2003 07:49:59 +0000 (07:49 +0000)]
Deleted some say-nothing-new comments.

Added some XXX's where comments seemed to require future attention.

Added some new comments with XXX's where future attention seems profitable.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@261 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoDeleted a bunch of say-nothing-new comments. Someday, there shall
Richard Rauch [Wed, 29 Oct 2003 07:18:10 +0000 (07:18 +0000)]
Deleted a bunch of say-nothing-new comments.  Someday, there shall
be an end to them.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@260 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoPrevious changes were made without the freeglut major mode in EMACS.
Richard Rauch [Wed, 29 Oct 2003 07:13:55 +0000 (07:13 +0000)]
Previous changes were made without the freeglut major mode in EMACS.
Re-tweaked some lines (mostly got rid of some TABs, but also resulted
in some changed indentation).

Reformatted a big comment to fit to 80 columns.

Removed bogus references to "Linux".  (UNIX, and/or X11 were relavent,
and "UNIX/X11" was substituted for "Linux" in those places.  This includes
UNIX-alike systems.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@259 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoRewrote the TODO BEFORE THE STABLE RELEASE comment to fit to 80 columns.
Richard Rauch [Wed, 29 Oct 2003 06:57:07 +0000 (06:57 +0000)]
Rewrote the TODO BEFORE THE STABLE RELEASE comment to fit to 80 columns.

Cleanup of fghGetConfig().  (One return statement, simpler code.)

Made glutSetOption() have a more consistant style---and also got its lines
to stay under 80 columns.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@258 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoGot the last of the say-nothing-new comments in freeglut_misc.c.
Richard Rauch [Wed, 29 Oct 2003 06:43:32 +0000 (06:43 +0000)]
Got the last of the say-nothing-new comments in freeglut_misc.c.

(I would have picked them up before, but wanted the bug-fix and
conversion-to-error-message changes to go in before I did more
superficial stuff.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@257 7f0cb862-5218-0410-a997-914c9d46530a

20 years ago * Fixed a bug that I introduced in fgWarning()/fgError(): I thought that
Richard Rauch [Wed, 29 Oct 2003 06:40:51 +0000 (06:40 +0000)]
 * Fixed a bug that I introduced in fgWarning()/fgError(): I thought that
   ((a) || (b)) was defined to have value as:
     (a) if (a) != 0
     (b) if (a) == 0

   ...instead, it has value 0/1.  This was causing a bug.  It's probably
   just as well, since what I was trying to do definitely fell into the
   category of "clever code" rather than "clear code".

   Sorry.

 * Made glutSetKeyRepeat() call fgError() if you go out of range.  (The
   old code silently did nothing---not even a warning.)

   If it is really desirable to keep running, we should probably at least
   generate an fgWarning().

 * Deleted some say-nothing-new comments.

 * XXX added: Is glutSetKeyRepeat() deprecated?

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@256 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCommit, mostly of work from John:
Richard Rauch [Tue, 28 Oct 2003 20:17:39 +0000 (20:17 +0000)]
Commit, mostly of work from John:

 * Removed some say-nothing-useful comments.
 * Added some tentative mouse-wheel support.
 * Fairly massive reformatting of code.

I made some secondary changes to his changes:

 * One compilation error was fixed (missing close-paren + semicolon).
 * Deleted a few ore say-nothing-useful comments.
 * Some of John's code was strangely formatted to the point that it
   seemed completely out of place, so I took the liberty of reformatting
   it.  Since I used GNU EMACS's <tab> key (which re-indents rather than
   inserts TAB characters), I had to propogate some indentation changes
   a little further than the bare necessity to match up with John's
   changes.  (John seems to shoot for 2-space indents, while EMACS
   (and I, I confess) strongly prefer 4-space indents.  The code that
   I was re-indenting had been put to 8-space indents, however.)

I have *not* tested the code beyond compiling.  I assume that John did
(and that the compilation error was a result a minor change just before
asking me to commit).

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@255 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoRe-indentation style changes from John.
Richard Rauch [Tue, 28 Oct 2003 19:37:09 +0000 (19:37 +0000)]
Re-indentation style changes from John.

There should be no alterations to how the code performs.

(I modified how the X11 section of the set-cursor code is indented to
slightly better match (IMHO) the rest of his changes.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@254 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoConverted a few "x != NULL" tests to "x" for clarity.
Richard Rauch [Mon, 27 Oct 2003 15:38:14 +0000 (15:38 +0000)]
Converted a few "x != NULL" tests to "x" for clarity.

I think that I've touched enough lines of source for one morning.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@253 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleaned up a little redundancy in a comment on the {menu_pen_*} variables.
Richard Rauch [Mon, 27 Oct 2003 13:51:35 +0000 (13:51 +0000)]
Cleaned up a little redundancy in a comment on the {menu_pen_*} variables.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@252 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoRemoved about 90 lines of say-nothing-new comments.
Richard Rauch [Mon, 27 Oct 2003 13:47:55 +0000 (13:47 +0000)]
Removed about 90 lines of say-nothing-new comments.

The code should be functionally unaltered by these changes.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@251 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoPropogated a pointer-check from menu-attach to menu-detach. (Apparently,
Richard Rauch [Mon, 27 Oct 2003 06:39:57 +0000 (06:39 +0000)]
Propogated a pointer-check from menu-attach to menu-detach.  (Apparently,
in some cases, the Menu member variable can be NULL.)

Corrected the menu-attach code to make sure that both Window and Menu
pointers are non-NULL (rather than "at least one").

Rewrote button-checks to more simply and more clearly assert that the
"menu button" is a valid button for menu actions: Instead of laboriously
comparing against the three valid buttons (0, 1, 2 or GLUT_BUTTON_*),
we do a simpler range-check and the upper bound is {FREEGLUT_MAX_MENUS},
allowing us to change the number of menuable buttons fairly easily in
the future.

Also deleted a few say-nothing-new comments.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@250 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCosmetic changes (mostly deleted a few more say-nothing-new comments).
Richard Rauch [Mon, 27 Oct 2003 05:45:48 +0000 (05:45 +0000)]
Cosmetic changes (mostly deleted a few more say-nothing-new comments).
The functionality of the code should be unchanged.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@249 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoChanged an "#elif TARGET_HOST_UNIX_X11" to "#else", since this simply
Richard Rauch [Mon, 27 Oct 2003 05:36:29 +0000 (05:36 +0000)]
Changed an "#elif TARGET_HOST_UNIX_X11" to "#else", since this simply
governed menu aesthetics.  I think that it's better to have a default
that works than to break completely, should freeglut ever be ported to
a new (non-WIN32, non-UNIX/X11) target.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@248 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMinor modifications to the menus:
Richard Rauch [Mon, 27 Oct 2003 05:32:14 +0000 (05:32 +0000)]
Minor modifications to the menus:

 * Updated an old "TODO BEFORE STABLE" comment.

 * Expanded a comment re. some #define macros.

 * Made colors and font choice system dependant.  The UNIX freeglut
   menus look more like UNIX GLUT menus, now.  (This is PURELY a
   cosmetic change.  But it achieves better compatibility visually.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@247 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCleaned up glutMainLoop() a bit:
Richard Rauch [Mon, 27 Oct 2003 05:12:09 +0000 (05:12 +0000)]
Cleaned up glutMainLoop() a bit:

 * Deleted numerous say-nothing-new comments.
 * Reformatted a say-something-useful comment to fit on an 80-column
   display.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@246 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoPartially (re-?)unified some of the glutMainLoopEvent() code. The only
Richard Rauch [Mon, 27 Oct 2003 05:03:31 +0000 (05:03 +0000)]
Partially (re-?)unified some of the glutMainLoopEvent() code.  The only
code that really needs to be system-specific is the window event handling,
which in MS-WINDOWS is tucked into a separate function.  In UNIX/X11, it's
all spilled out into glutMainLoopEvent() for some reason.

If the X11 code could be tucked into another function, glutMainLoopEvent()
could be platform-independant.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@245 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoMoved the idle callback out of glutMainLoopEvent() and into
Richard Rauch [Sun, 26 Oct 2003 06:13:50 +0000 (06:13 +0000)]
Moved the idle callback out of glutMainLoopEvent() and into
glutMainLoop(), per discussion on the list.  The code looks okay,
to me, though I remain less than wholly convinced that treating idles
as special cases is the best way to go.  Still, a case can be made
for taking "non-event" idle callbacks out of the "event loop".
From an organizational perspective, I think that it's an improvement,
and it fixes a bug for at least one program.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@244 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded John's text-positioning modification.
Richard Rauch [Sun, 26 Oct 2003 05:59:15 +0000 (05:59 +0000)]
Added John's text-positioning modification.

The lines that he was altering were very oddly-split, so while I was at
it, I repaired the line-break damage.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@243 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoCommitted change from Nigel to fix the joystick bug. (The joystick
Richard Rauch [Sun, 26 Oct 2003 05:44:07 +0000 (05:44 +0000)]
Committed change from Nigel to fix the joystick bug.  (The joystick
code was not setting the GLUT window prior to calling callbacks.)

Please verify.  If so, this closes out, I think, the latter half of
that bug report, so anyone with the means to modify/close bug reports
should do so upon verification of the fix.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@242 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoSuperficial cleanup of the code. Mostly taking lines such as:
Richard Rauch [Sun, 26 Oct 2003 05:38:12 +0000 (05:38 +0000)]
Superficial cleanup of the code.  Mostly taking lines such as:

  ...

  /*
   * <Enslish recapituation of the single following C statement>
   */
  <single C statement>

...and rewrote as:

  ...
  <single C statement>

freeglut_main.c still has a lot of that in it, but it looks a bit
better, now.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@241 7f0cb862-5218-0410-a997-914c9d46530a

20 years agoAdded some error-checking (particularly w.r.t. strdup()).
Richard Rauch [Sun, 26 Oct 2003 05:19:02 +0000 (05:19 +0000)]
Added some error-checking (particularly w.r.t. strdup()).

Deleted numerous 4-line "padding" sequences of C-as-English trans-
literation comments.

Re-indented some (but not all) code that is using 2-space indentation.
(Most of the freeglut code seems to be using 4-space indentation.)

I did not touch the "INIT DISPLAY STRING PARSING" code, since it is
filled with a ton of over-long lines and also appears to be in more
flux than the rest of the code.  (Well, I added one error-check
to a strdup().)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@240 7f0cb862-5218-0410-a997-914c9d46530a