Mercurial > sdl-ios-xcode
annotate src/events/SDL_windowevents.c @ 1734:f7c667ded87d SDL-1.3
The general code handles restoring video mode/gamma/etc. when the window loses focus.
Support for changing fullscreen/windowed mode in progress.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 09 Jul 2006 18:09:16 +0000 |
parents | 0b1070f2f94d |
children |
rev | line source |
---|---|
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 Sam Lantinga |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
20 slouken@libsdl.org |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
21 */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
22 #include "SDL_config.h" |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
23 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 /* Window event handling code for SDL */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
26 #include "SDL_events.h" |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 #include "SDL_events_c.h" |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
28 #include "../video/SDL_sysvideo.h" |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
30 int |
1724
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
31 SDL_SendWindowEvent(SDL_WindowID windowID, Uint8 windowevent, int data1, |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
32 int data2) |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
33 { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
34 int posted; |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
35 SDL_Window *window; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
36 |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
37 window = SDL_GetWindowFromID(windowID); |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
38 if (!window) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
39 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
40 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
41 switch (windowevent) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
42 case SDL_WINDOWEVENT_SHOWN: |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
43 if (window->flags & SDL_WINDOW_SHOWN) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
44 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
45 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
46 window->flags |= SDL_WINDOW_SHOWN; |
1733
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
47 SDL_OnWindowShown(window); |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
48 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
49 case SDL_WINDOWEVENT_HIDDEN: |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
50 if (!(window->flags & SDL_WINDOW_SHOWN)) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
51 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
52 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
53 window->flags &= ~SDL_WINDOW_SHOWN; |
1733
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
54 SDL_OnWindowHidden(window); |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
55 break; |
1724
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
56 case SDL_WINDOWEVENT_MOVED: |
1733
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
57 if (window->flags & SDL_WINDOW_FULLSCREEN) { |
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
58 return 0; |
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
59 } |
1724
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
60 if (data1 == window->x && data2 == window->y) { |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
61 return 0; |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
62 } |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
63 break; |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
64 case SDL_WINDOWEVENT_RESIZED: |
1733
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
65 if (window->flags & SDL_WINDOW_FULLSCREEN) { |
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
66 return 0; |
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
67 } |
1724
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
68 if (data1 == window->w && data2 == window->h) { |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
69 return 0; |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
70 } |
6c63fc2bd986
Proof of concept done - Win32 GDI implementation mostly complete.
Sam Lantinga <slouken@libsdl.org>
parents:
1722
diff
changeset
|
71 break; |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
72 case SDL_WINDOWEVENT_MINIMIZED: |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
73 if (window->flags & SDL_WINDOW_MINIMIZED) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
74 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
75 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
76 window->flags |= SDL_WINDOW_MINIMIZED; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
77 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
78 case SDL_WINDOWEVENT_MAXIMIZED: |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
79 if (window->flags & SDL_WINDOW_MAXIMIZED) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
80 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
81 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
82 window->flags |= SDL_WINDOW_MAXIMIZED; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
83 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
84 case SDL_WINDOWEVENT_RESTORED: |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
85 if (!(window->flags & (SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED))) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
86 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
87 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
88 window->flags &= ~(SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED); |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
89 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
90 case SDL_WINDOWEVENT_ENTER: |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
91 if (window->flags & SDL_WINDOW_MOUSE_FOCUS) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
92 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
93 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
94 window->flags |= SDL_WINDOW_MOUSE_FOCUS; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
95 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
96 case SDL_WINDOWEVENT_LEAVE: |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
97 if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS)) { |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
98 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
99 } |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
100 window->flags &= ~SDL_WINDOW_MOUSE_FOCUS; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
101 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
102 case SDL_WINDOWEVENT_FOCUS_GAINED: |
1734
f7c667ded87d
The general code handles restoring video mode/gamma/etc. when the window loses focus.
Sam Lantinga <slouken@libsdl.org>
parents:
1733
diff
changeset
|
103 if (window->flags & SDL_WINDOW_INPUT_FOCUS) { |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
104 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
105 } |
1734
f7c667ded87d
The general code handles restoring video mode/gamma/etc. when the window loses focus.
Sam Lantinga <slouken@libsdl.org>
parents:
1733
diff
changeset
|
106 window->flags |= SDL_WINDOW_INPUT_FOCUS; |
1733
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
107 SDL_OnWindowFocusGained(window); |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
108 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
109 case SDL_WINDOWEVENT_FOCUS_LOST: |
1734
f7c667ded87d
The general code handles restoring video mode/gamma/etc. when the window loses focus.
Sam Lantinga <slouken@libsdl.org>
parents:
1733
diff
changeset
|
110 if (!(window->flags & SDL_WINDOW_INPUT_FOCUS)) { |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
111 return 0; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
112 } |
1734
f7c667ded87d
The general code handles restoring video mode/gamma/etc. when the window loses focus.
Sam Lantinga <slouken@libsdl.org>
parents:
1733
diff
changeset
|
113 window->flags &= ~SDL_WINDOW_INPUT_FOCUS; |
1733
0b1070f2f94d
Implemented gamma correction on Windows.
Sam Lantinga <slouken@libsdl.org>
parents:
1731
diff
changeset
|
114 SDL_OnWindowFocusLost(window); |
1722
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
115 break; |
5daa04d862f1
Added a userdata parameter for event filters.
Sam Lantinga <slouken@libsdl.org>
parents:
1668
diff
changeset
|
116 } |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
117 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
118 /* Post the event, if desired */ |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
119 posted = 0; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
120 if (SDL_ProcessEvents[SDL_WINDOWEVENT] == SDL_ENABLE) { |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
121 SDL_Event event; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
122 event.type = SDL_WINDOWEVENT; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
123 event.window.event = windowevent; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
124 event.window.data1 = data1; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
125 event.window.data2 = data2; |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
126 event.window.windowID = windowID; |
1731
875c3cf1a12c
SDL_PushEvent() calls the event filter code, and has a return value to tell
Sam Lantinga <slouken@libsdl.org>
parents:
1724
diff
changeset
|
127 posted = (SDL_PushEvent(&event) > 0); |
1662
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
128 } |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
129 return (posted); |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
130 } |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
131 |
782fd950bd46
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
132 /* vi: set ts=4 sw=4 expandtab: */ |