Commit Graph

1528 Commits

Author SHA1 Message Date
dcnieho
b3b678a2f7 now have a default reshape callback function that is used if the user didn't set any, instead of having what to do spread out over the code
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1557 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-06 09:17:13 +00:00
dcnieho
d2991524cb fghHavePendingRedisplaysCallback: docs fixed up, and return without checking subwindows first if we have already found a window with pending redisplay
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1556 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-06 03:51:01 +00:00
dcnieho
05fc819508 comment on timer checking, are timers always sorted by triggertime? Else the code is wrong...
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1555 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-06 03:50:14 +00:00
dcnieho
9c2936cd85 joystick:
- only poll joysticks if we have an active joystick
- active joystick is defined as having callback and having positive (NON-ZERO!) pollInterval, as per GLUT sources
- use fgState.NumActiveJoysticks instead of fghHaveJoystick to save bunch of unnecessary function calls etc
- fghcbCheckJoystickPolls more concervative, per window we first check if a joystick is active (per above definition)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1554 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-06 03:39:00 +00:00
dcnieho
59ae6d2a56 fghSleepForEvents immediately returns if we have an idle callback, so simply don't call the function at all if we just processed the idle callback
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1553 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-05 17:08:32 +00:00
dcnieho
7365dc38d4 error when entering main loop with no windows defined, as GLUT does
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1552 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-04 16:27:00 +00:00
dcnieho
9fa8bcf4db if user opens menu in parent window and then clicked child window, the menu wasn't closed. Fixed (and some cleanup)
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1551 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-04 10:18:35 +00:00
dcnieho
5e97fed06a MenuStatusCallback when menu was closed did not return location of pointer relative to child window's top-left, it only worked for top level windows.
To make this work, fghPlatformGetCursorPos now can return cursor pos relative to top-left of a specified window's client area (this is untested on X11)

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1550 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-04 09:54:55 +00:00
dcnieho
5398d76b76 callign entryfunc should not steal the current window, so save before calling and restore after callback returns
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1549 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-04 09:25:15 +00:00
dcnieho
76f9c9a902 handling of mouse messages more conform docs, some cleanup
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1548 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-04 09:17:03 +00:00
dcnieho
bf4a53a72e missed the windowproc return value
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1547 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 18:43:22 +00:00
dcnieho
bab8eb3423 WM_PAINT more conform to docs
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1546 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 18:28:55 +00:00
dcnieho
c8177024db document glutSetWindowTitle, glutSetIconTitle
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1545 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 17:44:44 +00:00
dcnieho
4edd89470b some cleanup: on window creation, don't have to zero variables that
already set to zero by calloc
in windowproc, don't have handlers that only forward the message to
defwindowproc


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1544 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 17:22:34 +00:00
dcnieho
78707f3e63 implemented glutSetIconTitle that works on win32, when a window is
minimized, its title is now changed, and changed back when it is restored


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1543 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 17:20:47 +00:00
dcnieho
736f745cc1 fixed up handling of WM_MOUSEWHEEL, low order of wParam is not the mouse
wheel number, but indicates which virtual keys are pressed during the
scroll wheel motion


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1542 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 15:42:26 +00:00
dcnieho
7caa405f57 Visibility functions better implemented now. All goes through
WM_SHOWWINDOW except for a newly created window (WM_SHOWWINDOW is too
early for callback then). I now have a state variable that indicates
whether visibility has been notified yet for a new window. This
notification gets done just before the window is first drawn. This
removes the need for fgPlatformMainLoopPreliminaryWork on windows, and
it also works for windows created when the mainloop is already running


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1541 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 10:31:34 +00:00
dcnieho
c7656b8659 comment on implementation of window status callback
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1540 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 07:43:48 +00:00
dcnieho
4d83b5ab50 simplified some window rect calculations
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1539 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 07:41:23 +00:00
dcnieho
5e48d25cdb document coordinates returned by glutPositionFunc, other doc
improvements regarding docs


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1538 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 07:15:20 +00:00
dcnieho
6d9e4fdb30 updated docs for fgPlatformMainLoopPreliminaryWork
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1537 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 06:50:15 +00:00
dcnieho
1d9ec8e1e9 implemented somewhat better visibility/windowstatus support, some small
cleanup


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1536 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 05:53:51 +00:00
dcnieho
f46574e263 library should call window status func at all times, translation to
visibility callback happens if needed. Documented this, and added notes
on visibility/windowstatus func in callbackmaker demo


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1535 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 03:08:05 +00:00
dcnieho
41dd280289 made fghVisibility more intuitive, documented glutVisibilityfunc and
glutWindowStatusFunc


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1534 7f0cb862-5218-0410-a997-914c9d46530a
2013-03-01 02:42:14 +00:00
dcnieho
a2e3b9c31d fixed up docs a bit, provided docs for some functions
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1533 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-28 18:26:14 +00:00
dcnieho
8cafb13ec9 doc cleanup
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1532 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-28 17:41:20 +00:00
dcnieho
3299e79bdf files for demoing GLUT_ICON
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1531 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-28 17:40:45 +00:00
dcnieho
cd92d7fdd2 fixed documentation for GLUT_ICON (its not an environment variable, but
an identifier for a resource file) and added an example of it for the
One demo


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1530 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-28 13:40:28 +00:00
dcnieho
766e0cafc5 implemented GLUT_WINDOW_STENCIL_SIZE and GLUT_WINDOW_BUFFER_SIZE for glutGet
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1529 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-28 08:53:31 +00:00
dcnieho
ccebf6f3df No need to handle WM_CANCELMODE, defwindowproc takes care of it
(releasing capture), and we have WM_CAPTURECHANGED to make sure our
application is in consistent state


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1528 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 12:11:33 +00:00
dcnieho
c0522d1fcf updated README to point to README.cmake for building
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1527 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 12:07:26 +00:00
dcnieho
953dcc637c now that mouse capture was properly implemented, menus could be opened
outside the window when the window had capture because another mouse
button was depressed. fixed
Also implemented WM_CANCELMODE, which could be important as we should
cancel capture when it comes in


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1526 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 11:36:14 +00:00
dcnieho
a5ed343b38 Mousemotion events now generated outside the window until all mouse
buttons released, as is done on X11 (according to comments i now
deleted)


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1525 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 10:46:13 +00:00
dcnieho
371adb260e fgDeactivateMenu could sometimes be called twice on the same menu, avoid
crash in that situation


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1524 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 10:29:24 +00:00
dcnieho
5fe69bdac1 GLUT_CURSOR_INHERIT now works, also implemented another cursor
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1523 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 09:35:38 +00:00
dcnieho
0d353df338 should return zero after processing any of the mouse button down or up
events


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1522 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 08:18:09 +00:00
dcnieho
b362113e1f Only do mouse tracking for EntryFunc if user specified an entryfunc
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1521 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 08:06:24 +00:00
dcnieho
3eda176577 Now implemented properly working mouse entry and exit (EntryFunc callback) support on windows
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1520 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 07:52:55 +00:00
dcnieho
eccb722d20 demo glutSetCursor
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1519 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 07:07:55 +00:00
dcnieho
9652d57d4f Simplified fghWindowUnderCursor, cleane dup code
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1518 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 07:01:43 +00:00
dcnieho
363c2c363a Only check for child window when needed, some cleanup
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1517 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 06:18:20 +00:00
dcnieho
8363fa9507 WM_SETFOCUS should not change focus to child instead, then all input goes to child even if it should go to parent. Mousewheel needed to check if actually in child, other mouse action (move, press) are automatically passed to child
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1516 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 06:11:51 +00:00
dcnieho
6f9152c92e Use GetMessagePos, not GetCursorPos to make sure we get the right mouse position. Also, no need to get mouse position at time of keypress, every mouse movement before the keypress is processed in an earlier WM_MOUSE message already, so mouse position in the window state is all we need.
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1515 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 05:58:56 +00:00
dcnieho
b1274e9078 added API doc for glutSetKeyRepeat and glutIgnoreKeyRepeat
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1514 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 04:58:23 +00:00
dcnieho
00260311f3 clean up glutSetKeyRepeat function body
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1513 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 04:44:14 +00:00
dcnieho
e9318d4e55 Added subwindows to CallbackMaker demo, for testing and demonstration. Also figured out how key repeat's global and per-window flags are supposed to interact, documented and demonstrated it.
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1512 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 04:36:48 +00:00
dcnieho
71c6054fe0 added modifier key status to callbackmaker output, also added entryfunc
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1511 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-27 03:58:05 +00:00
dcnieho
ddda931bac reworked fullscreen code based on implementation of Chromium. can now handle/restore windows in maximized state and no longer uses WS_POPUP.
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1510 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-26 16:49:19 +00:00
dcnieho
5fa61c0c64 subwin demo now has a grandchild (subwin in subwin) for testing
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1509 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-26 16:14:41 +00:00
dcnieho
3b5f3573a1 some msgs only sent to parent window, find child under cursor. This before only search for childs of the parent, not grandchilds or more derived. Fixed
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1508 7f0cb862-5218-0410-a997-914c9d46530a
2013-02-26 16:13:09 +00:00