Richard Rauch [Tue, 2 Dec 2003 21:04:33 +0000 (21:04 +0000)]
Ensure that the time-out for sleeping is never negative.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@375
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 2 Dec 2003 15:03:48 +0000 (15:03 +0000)]
Fixed a bug for UNIX_X11 where window reshape events were causing freeglut
to mark the window as *needing* a reshape (which during general display
callback handling would result in effectively a glutReshapeWindow()).
The code is now system-dependant. It should be abstracted to a function,
but is presently copied in two places. Sorry.
Also, inverted the order of the associated if()/else check (in both
WIN32 and UNIX_X11 branches) since the former "else" part was a one-line
callback invocation.
This fixes two seemingly unrelated bugs that I was seeing in UNIX_X11.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@374
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Mon, 1 Dec 2003 17:59:42 +0000 (17:59 +0000)]
Added missing prototype for new list function.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@373
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Fri, 28 Nov 2003 19:19:59 +0000 (19:19 +0000)]
Timer optimizations.
Made the list of pendinig timers ordered.
Added a free list of used timer structures.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@372
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Fri, 28 Nov 2003 19:08:25 +0000 (19:08 +0000)]
Timer optimizations.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@371
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Fri, 28 Nov 2003 12:04:24 +0000 (12:04 +0000)]
Fixed windows compilation problem with last update.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@370
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Thu, 27 Nov 2003 19:49:53 +0000 (19:49 +0000)]
Window close fix.
The default behaiour should now be the same as with glut.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@369
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Wed, 26 Nov 2003 01:21:29 +0000 (01:21 +0000)]
Added change from Nigel to have resize events cause redraw events in WIN32.
Also slightly reshuffled comments to deal with line-wrap issues.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@368
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 25 Nov 2003 17:25:43 +0000 (17:25 +0000)]
John reported, and fixed, a problem that recent changes caused for
the Lorenz demo (seems to be WIN32 specific).
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@367
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 25 Nov 2003 14:17:05 +0000 (14:17 +0000)]
Update from John: Removed the freeglut hack of decrementing the
highst-window-ID marker when the highest window is deleted. (This
was a half-way measure for an idea that was decided to be dubious
in the first place.)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@366
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 25 Nov 2003 14:10:35 +0000 (14:10 +0000)]
Added a new demo (from Nigel) showing some of the basic GLUT geometry
shapes. "shapes" is the name of the demo.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@365
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 25 Nov 2003 13:53:19 +0000 (13:53 +0000)]
Commit of work from Nigel:
Massive rework of the geometric primitive code. Includes a new
primitive (cylinder; solid and wireframe) and corresponding update
to freeglut_ext.h for the prototype.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@364
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 25 Nov 2003 04:57:10 +0000 (04:57 +0000)]
More work from John (sorry for procrastinating):
* We forgot to bump our version number in freeglut_internal.h
It is now at 2.0.2 (actually, I think that 2.1.0 might be
a better choice), which is presumably going to be our next
formal release. 2.0.1 is incorrectly identified as 2.0.0 in
the header.
* A typo in a comment has been corrected ("than"/"that").
* Numerous "manual" checks for callbacks are omitted now, since
INVOKE_WCB() does this for us. These were holdovers from the
pre-INVOKE_WCB() days. There may be some very subtle changes
in freeglut behavior, since freeglut used to test the callbacks
a little earlier in some cases and may have skipped some minor
things (like changes to the current window) in some special cases,
otherwise. It is not believed that any documented behavior is
broken, and it is unlikely---not to say impossible---that any
extant applications will detect the change. It is even possible
that there is no external behavioral change in freeglut.
This also significantly simplifies some sections of code that used
to have conditional execution. "Unconditional code is simpler code"
as one of the comments used to say.
* Lots of XXX commentary is now removed. Some of it was obsoleted
by other changes, some by changes from John.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@363
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 25 Nov 2003 04:21:48 +0000 (04:21 +0000)]
Change from John (I removed a couple of spaces from a couple of lines in
his freeglut_internal.h file where they were wrapping in EMACS; otherwise,
the files are exactly as he sent them to me).
The change unifies the WIN32 and UNIX_X11 code by defining our own
window-handle-type in freeglut_internal.h. This let John rip out some
#if garbage in several places. The result is clearer code.
Thanks, John!
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@362
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 21 Nov 2003 21:15:58 +0000 (21:15 +0000)]
Numerous style normalizations from John:
* Convert "return( value );" to "return value;"
* Normalize spacing around semicolons.
* Remove extraneous parens.
* Split multi-statement lines into multiple lines. (Mostly things
of the form: "if( condition ) return;".)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@361
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 21 Nov 2003 00:49:51 +0000 (00:49 +0000)]
All changes are from John, except for:
(a) I re-inserted the meat of a comment that I still feel is relavent.
(b) I fixed a compile-time error in the UNIX_X11 code where a variable
is declared after executable code in a block without creating
a new sub-block for the declaration.
Changes from John include:
(a) Style revision.
(b) Changes to postpone the handling of window resizes.
Lots of lines were changed, but I think that thos two cover the ground that
he hit. See the diffs for details.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@360
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Tue, 18 Nov 2003 22:09:15 +0000 (22:09 +0000)]
Lots of stuff that John F. Fay pointed out.
Plus some changes to remove gcc warnings.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@359
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Mon, 17 Nov 2003 21:11:33 +0000 (21:11 +0000)]
Fix spelling mistake in a variable name.
Added a comment for John Fay.
Added the copyright notice for XParseGeometry source.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@358
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sun, 16 Nov 2003 14:10:35 +0000 (14:10 +0000)]
Made Modifers variable global as per glut classic.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@357
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sun, 16 Nov 2003 13:49:49 +0000 (13:49 +0000)]
Removed old unused glutInitDisplayString code.
Reformated new glutInitDisplayString and XParseGeometry code.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@356
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sun, 16 Nov 2003 01:41:18 +0000 (01:41 +0000)]
Use XParseGeometry for better geometry parsing.
Moved geometry parsing to after fgInitialize() so we can use the screen size
to correctly calculate negative positions in the geometry string.
Copied the code for XParseGeometry from the X11 sources for use in the
Win32 version.
freeglut now passes test1 of the glut test suite.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@355
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sat, 15 Nov 2003 19:25:22 +0000 (19:25 +0000)]
Removed the state variable BuildingAMenu.
Instead pass a new parameter isMenu to fgCreateWindow().
Elsewhere use window->IsMenu.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@354
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sat, 15 Nov 2003 19:11:09 +0000 (19:11 +0000)]
freeglut_assert_ready is going to have to go at some point.
But for now I've moved setting fgState.Initalized to GL_FALSE.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@353
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sat, 15 Nov 2003 19:06:28 +0000 (19:06 +0000)]
Replace TRUE with GL_TRUE and FALSE with GL_FALSE where the type is
GLboolean.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@352
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Sat, 15 Nov 2003 17:48:43 +0000 (17:48 +0000)]
Normalized the spacing around symbols, for the most part. Ho-hum.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@351
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sat, 15 Nov 2003 16:52:46 +0000 (16:52 +0000)]
Added a call to fgDeinitialize() before the call to exit() in fgError().
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@350
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Sat, 15 Nov 2003 16:39:46 +0000 (16:39 +0000)]
Style normalizations to the joystick code.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@349
7f0cb862-5218-0410-a997-
914c9d46530a
Christopher John Purnell [Sat, 15 Nov 2003 16:24:33 +0000 (16:24 +0000)]
Added a new state variable "Initalized".
Replaced referenced to Time.Set with this new variable where appropriate.
fgElapsedTime() now set the start time if Time.Set is false.
Moved glutGet(GLUT_ELAPSED_TIME) handling to before the assert.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@348
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 14 Nov 2003 17:46:01 +0000 (17:46 +0000)]
Normalized the internal header's style a bit.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@347
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 14 Nov 2003 15:10:50 +0000 (15:10 +0000)]
Plowed one more file this morning. Still just trivial formatting issues.
And I left alone the "INIT DISPLAY STRING PARSING" section, since
it still appears to be in flux.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@346
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 14 Nov 2003 14:59:49 +0000 (14:59 +0000)]
Yet more trivial style normalizations.
Sorry, but that's all that I'm up to at the moment. On the plus,
excepting the font_data file (which I've been skipping), up through
this file, I think that the code style is pretty close to uniform.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@345
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 14 Nov 2003 14:52:15 +0000 (14:52 +0000)]
Minor style corrections.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@344
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 14 Nov 2003 14:39:20 +0000 (14:39 +0000)]
Minor spacing quibble.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@343
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 14 Nov 2003 14:36:27 +0000 (14:36 +0000)]
Added a brief explanatory note to the X code for GLUT_CURSOR_NONE.
Corrected the indentation of a block of code.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@342
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Fri, 14 Nov 2003 11:04:11 +0000 (11:04 +0000)]
Noted one of a few cases where we do something immediately that could more
efficiently be postponed, quite easily---and which GLUT promises *is* to
be postponed. (It is unlikely that the difference will break any apps, but
postponing should be easy...)
No real change, just a comment in the code.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@341
7f0cb862-5218-0410-a997-
914c9d46530a
Richard Rauch [Tue, 11 Nov 2003 11:55:19 +0000 (11:55 +0000)]
Updated ChangeLog for the day.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@340
7f0cb862-5218-0410-a997-
914c9d46530a
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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