-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput_window_test.c
More file actions
569 lines (491 loc) · 16.8 KB
/
input_window_test.c
File metadata and controls
569 lines (491 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
#include "pal/pal_video.h"
#include "tests.h"
#define DISPATCH_MODE_POLL 0
static const char* s_KeyNames[PAL_KEYCODE_MAX] = {
[PAL_KEYCODE_UNKNOWN] = "Unknown",
// Letters
[PAL_KEYCODE_A] = "A",
[PAL_KEYCODE_B] = "B",
[PAL_KEYCODE_C] = "C",
[PAL_KEYCODE_D] = "D",
[PAL_KEYCODE_E] = "E",
[PAL_KEYCODE_F] = "F",
[PAL_KEYCODE_G] = "G",
[PAL_KEYCODE_H] = "H",
[PAL_KEYCODE_I] = "I",
[PAL_KEYCODE_J] = "J",
[PAL_KEYCODE_K] = "K",
[PAL_KEYCODE_L] = "L",
[PAL_KEYCODE_M] = "M",
[PAL_KEYCODE_N] = "N",
[PAL_KEYCODE_O] = "O",
[PAL_KEYCODE_P] = "P",
[PAL_KEYCODE_Q] = "Q",
[PAL_KEYCODE_R] = "R",
[PAL_KEYCODE_S] = "S",
[PAL_KEYCODE_T] = "T",
[PAL_KEYCODE_U] = "U",
[PAL_KEYCODE_V] = "V",
[PAL_KEYCODE_W] = "W",
[PAL_KEYCODE_X] = "X",
[PAL_KEYCODE_Y] = "Y",
[PAL_KEYCODE_Z] = "Z",
// Numbers (top row)
[PAL_KEYCODE_0] = "0",
[PAL_KEYCODE_1] = "1",
[PAL_KEYCODE_2] = "2",
[PAL_KEYCODE_3] = "3",
[PAL_KEYCODE_4] = "4",
[PAL_KEYCODE_5] = "5",
[PAL_KEYCODE_6] = "6",
[PAL_KEYCODE_7] = "7",
[PAL_KEYCODE_8] = "8",
[PAL_KEYCODE_9] = "9",
// Function keys
[PAL_KEYCODE_F1] = "F1",
[PAL_KEYCODE_F2] = "F2",
[PAL_KEYCODE_F3] = "F3",
[PAL_KEYCODE_F4] = "F4",
[PAL_KEYCODE_F5] = "F5",
[PAL_KEYCODE_F6] = "F6",
[PAL_KEYCODE_F7] = "F7",
[PAL_KEYCODE_F8] = "F8",
[PAL_KEYCODE_F9] = "F9",
[PAL_KEYCODE_F10] = "F10",
[PAL_KEYCODE_F11] = "F11",
[PAL_KEYCODE_F12] = "F12",
// Control
[PAL_KEYCODE_ESCAPE] = "Escape",
[PAL_KEYCODE_ENTER] = "Enter",
[PAL_KEYCODE_TAB] = "Tab",
[PAL_KEYCODE_BACKSPACE] = "Backspace",
[PAL_KEYCODE_SPACE] = "Space",
[PAL_KEYCODE_CAPSLOCK] = "Capslock",
[PAL_KEYCODE_NUMLOCK] = "Numlock",
[PAL_KEYCODE_SCROLLLOCK] = "Scrolllock",
[PAL_KEYCODE_LSHIFT] = "LeftShift",
[PAL_KEYCODE_RSHIFT] = "RightShift",
[PAL_KEYCODE_LCTRL] = "LeftControl",
[PAL_KEYCODE_RCTRL] = "RightControl",
[PAL_KEYCODE_LALT] = "LeftAlt",
[PAL_KEYCODE_RALT] = "RightAlt",
// Arrows
[PAL_KEYCODE_LEFT] = "Left",
[PAL_KEYCODE_RIGHT] = "Right",
[PAL_KEYCODE_UP] = "Up",
[PAL_KEYCODE_DOWN] = "Down",
// Navigation
[PAL_KEYCODE_INSERT] = "Insert",
[PAL_KEYCODE_DELETE] = "Delete",
[PAL_KEYCODE_HOME] = "Home",
[PAL_KEYCODE_END] = "End",
[PAL_KEYCODE_PAGEUP] = "Pageup",
[PAL_KEYCODE_PAGEDOWN] = "Pagedown",
// Keypad
[PAL_KEYCODE_KP_0] = "Keypad 0",
[PAL_KEYCODE_KP_1] = "Keypad 1",
[PAL_KEYCODE_KP_2] = "Keypad 2",
[PAL_KEYCODE_KP_3] = "Keypad 3",
[PAL_KEYCODE_KP_4] = "Keypad 4",
[PAL_KEYCODE_KP_5] = "Keypad 5",
[PAL_KEYCODE_KP_6] = "Keypad 6",
[PAL_KEYCODE_KP_7] = "Keypad 7",
[PAL_KEYCODE_KP_8] = "Keypad 8",
[PAL_KEYCODE_KP_9] = "Keypad 9",
[PAL_KEYCODE_KP_ENTER] = "Keypad Enter",
[PAL_KEYCODE_KP_ADD] = "Keypad Add",
[PAL_KEYCODE_KP_SUBTRACT] = "Keypad Subtract",
[PAL_KEYCODE_KP_MULTIPLY] = "Keypad Multiply",
[PAL_KEYCODE_KP_DIVIDE] = "Keypad Divide",
[PAL_KEYCODE_KP_DECIMAL] = "Keypad Decimal",
[PAL_KEYCODE_KP_EQUAL] = "Keypad Equal",
// Misc
[PAL_KEYCODE_PRINTSCREEN] = "Printscreen",
[PAL_KEYCODE_PAUSE] = "Pause",
[PAL_KEYCODE_MENU] = "Menu",
[PAL_KEYCODE_APOSTROPHE] = "Apostrophe",
[PAL_KEYCODE_BACKSLASH] = "Backslash",
[PAL_KEYCODE_COMMA] = "Comma",
[PAL_KEYCODE_EQUAL] = "Equal",
[PAL_KEYCODE_GRAVEACCENT] = "Graveaccent",
[PAL_KEYCODE_SUBTRACT] = "Subtract",
[PAL_KEYCODE_PERIOD] = "Period",
[PAL_KEYCODE_SEMICOLON] = "Semicolon",
[PAL_KEYCODE_SLASH] = "Slash",
[PAL_KEYCODE_LBRACKET] = "LeftBracket",
[PAL_KEYCODE_RBRACKET] = "RightBracket",
[PAL_KEYCODE_LSUPER] = "LeftSuper",
[PAL_KEYCODE_RSUPER] = "RightSuper",
};
static const char* s_ScancodeNames[PAL_SCANCODE_MAX] = {
[PAL_SCANCODE_UNKNOWN] = "Unknown",
// Letters
[PAL_SCANCODE_A] = "A",
[PAL_SCANCODE_B] = "B",
[PAL_SCANCODE_C] = "C",
[PAL_SCANCODE_D] = "D",
[PAL_SCANCODE_E] = "E",
[PAL_SCANCODE_F] = "F",
[PAL_SCANCODE_G] = "G",
[PAL_SCANCODE_H] = "H",
[PAL_SCANCODE_I] = "I",
[PAL_SCANCODE_J] = "J",
[PAL_SCANCODE_K] = "K",
[PAL_SCANCODE_L] = "L",
[PAL_SCANCODE_M] = "M",
[PAL_SCANCODE_N] = "N",
[PAL_SCANCODE_O] = "O",
[PAL_SCANCODE_P] = "P",
[PAL_SCANCODE_Q] = "Q",
[PAL_SCANCODE_R] = "R",
[PAL_SCANCODE_S] = "S",
[PAL_SCANCODE_T] = "T",
[PAL_SCANCODE_U] = "U",
[PAL_SCANCODE_V] = "V",
[PAL_SCANCODE_W] = "W",
[PAL_SCANCODE_X] = "X",
[PAL_SCANCODE_Y] = "Y",
[PAL_SCANCODE_Z] = "Z",
// Numbers (top row)
[PAL_SCANCODE_0] = "0",
[PAL_SCANCODE_1] = "1",
[PAL_SCANCODE_2] = "2",
[PAL_SCANCODE_3] = "3",
[PAL_SCANCODE_4] = "4",
[PAL_SCANCODE_5] = "5",
[PAL_SCANCODE_6] = "6",
[PAL_SCANCODE_7] = "7",
[PAL_SCANCODE_8] = "8",
[PAL_SCANCODE_9] = "9",
// Function keys
[PAL_SCANCODE_F1] = "F1",
[PAL_SCANCODE_F2] = "F2",
[PAL_SCANCODE_F3] = "F3",
[PAL_SCANCODE_F4] = "F4",
[PAL_SCANCODE_F5] = "F5",
[PAL_SCANCODE_F6] = "F6",
[PAL_SCANCODE_F7] = "F7",
[PAL_SCANCODE_F8] = "F8",
[PAL_SCANCODE_F9] = "F9",
[PAL_SCANCODE_F10] = "F10",
[PAL_SCANCODE_F11] = "F11",
[PAL_SCANCODE_F12] = "F12",
// Control
[PAL_SCANCODE_ESCAPE] = "Escape",
[PAL_SCANCODE_ENTER] = "Enter",
[PAL_SCANCODE_TAB] = "Tab",
[PAL_SCANCODE_BACKSPACE] = "Backspace",
[PAL_SCANCODE_SPACE] = "Space",
[PAL_SCANCODE_CAPSLOCK] = "Capslock",
[PAL_SCANCODE_NUMLOCK] = "Numlock",
[PAL_SCANCODE_SCROLLLOCK] = "Scrolllock",
[PAL_SCANCODE_LSHIFT] = "LeftShift",
[PAL_SCANCODE_RSHIFT] = "RightShift",
[PAL_SCANCODE_LCTRL] = "LeftControl",
[PAL_SCANCODE_RCTRL] = "RightControl",
[PAL_SCANCODE_LALT] = "LeftAlt",
[PAL_SCANCODE_RALT] = "RightAlt",
// Arrows
[PAL_SCANCODE_LEFT] = "Left",
[PAL_SCANCODE_RIGHT] = "Right",
[PAL_SCANCODE_UP] = "Up",
[PAL_SCANCODE_DOWN] = "Down",
// Navigation
[PAL_SCANCODE_INSERT] = "Insert",
[PAL_SCANCODE_DELETE] = "Delete",
[PAL_SCANCODE_HOME] = "Home",
[PAL_SCANCODE_END] = "End",
[PAL_SCANCODE_PAGEUP] = "Pageup",
[PAL_SCANCODE_PAGEDOWN] = "Pagedown",
// Keypad
[PAL_SCANCODE_KP_0] = "Keypad 0",
[PAL_SCANCODE_KP_1] = "Keypad 1",
[PAL_SCANCODE_KP_2] = "Keypad 2",
[PAL_SCANCODE_KP_3] = "Keypad 3",
[PAL_SCANCODE_KP_4] = "Keypad 4",
[PAL_SCANCODE_KP_5] = "Keypad 5",
[PAL_SCANCODE_KP_6] = "Keypad 6",
[PAL_SCANCODE_KP_7] = "Keypad 7",
[PAL_SCANCODE_KP_8] = "Keypad 8",
[PAL_SCANCODE_KP_9] = "Keypad 9",
[PAL_SCANCODE_KP_ENTER] = "Keypad Enter",
[PAL_SCANCODE_KP_ADD] = "Keypad Add",
[PAL_SCANCODE_KP_SUBTRACT] = "Keypad Subtract",
[PAL_SCANCODE_KP_MULTIPLY] = "Keypad Multiply",
[PAL_SCANCODE_KP_DIVIDE] = "Keypad Divide",
[PAL_SCANCODE_KP_DECIMAL] = "Keypad Decimal",
[PAL_SCANCODE_KP_EQUAL] = "Keypad Equal",
// Misc
[PAL_SCANCODE_PRINTSCREEN] = "Printscreen",
[PAL_SCANCODE_PAUSE] = "Pause",
[PAL_SCANCODE_MENU] = "Menu",
[PAL_SCANCODE_APOSTROPHE] = "Apostrophe",
[PAL_SCANCODE_BACKSLASH] = "Backslash",
[PAL_SCANCODE_COMMA] = "Comma",
[PAL_SCANCODE_EQUAL] = "Equal",
[PAL_SCANCODE_GRAVEACCENT] = "Graveaccent",
[PAL_SCANCODE_SUBTRACT] = "Subtract",
[PAL_SCANCODE_PERIOD] = "Period",
[PAL_SCANCODE_SEMICOLON] = "Semicolon",
[PAL_SCANCODE_SLASH] = "Slash",
[PAL_SCANCODE_LBRACKET] = "LeftBracket",
[PAL_SCANCODE_RBRACKET] = "RightBracket",
[PAL_SCANCODE_LSUPER] = "LeftSuper",
[PAL_SCANCODE_RSUPER] = "RightSuper"};
static const char* s_MouseButtonNames[PAL_MOUSE_BUTTON_MAX] = {
[PAL_MOUSE_BUTTON_UNKNOWN] = "Unknown",
[PAL_MOUSE_BUTTON_LEFT] = "Left",
[PAL_MOUSE_BUTTON_RIGHT] = "Right",
[PAL_MOUSE_BUTTON_MIDDLE] = "Middle",
[PAL_MOUSE_BUTTON_X1] = "X1",
[PAL_MOUSE_BUTTON_X2] = "X2"};
#if DISPATCH_MODE_POLL
static const char* dispatchString = "Poll Mode";
#else
static const char* dispatchString = "Callback Mode";
#endif // DISPATCH_MODE_POLL
static bool s_Running = false;
// inline helpers
static inline void onKeydown(const PalEvent* event)
{
Uint32 keycode, scancode; // keycode == low, scancode == high
palUnpackUint32(event->data, &keycode, &scancode);
PalWindow* window = palUnpackPointer(event->data2);
// get keycode and scancode name
const char* keyName = s_KeyNames[keycode];
const char* scancodeName = s_ScancodeNames[scancode];
palLog(
nullptr,
"%s: Key pressed: (%s, %s)",
dispatchString,
keyName,
scancodeName);
if (keycode == PAL_KEYCODE_ESCAPE) {
s_Running = false;
}
}
static inline void onKeyrepeat(const PalEvent* event)
{
Uint32 keycode, scancode; // keycode == low, scancode == high
palUnpackUint32(event->data, &keycode, &scancode);
PalWindow* window = palUnpackPointer(event->data2);
// get keycode and scancode name
const char* keyName = s_KeyNames[keycode];
const char* scancodeName = s_ScancodeNames[scancode];
palLog(
nullptr,
"%s: Key repeat: (%s, %s)",
dispatchString,
keyName,
scancodeName);
}
static inline void onKeyup(const PalEvent* event)
{
Uint32 keycode, scancode; // keycode == low, scancode == high
palUnpackUint32(event->data, &keycode, &scancode);
PalWindow* window = palUnpackPointer(event->data2);
// get keycode and scancode name
const char* keyName = s_KeyNames[keycode];
const char* scancodeName = s_ScancodeNames[scancode];
palLog(
nullptr,
"%s: Key released: (%s, %s)",
dispatchString,
keyName,
scancodeName);
}
static inline void onMouseButtondown(const PalEvent* event)
{
Uint32 button, serial; // button == low, serial == high
palUnpackUint32(event->data, &button, &serial);
PalWindow* window = palUnpackPointer(event->data2);
// get mouse button name
const char* name = s_MouseButtonNames[button];
palLog(nullptr, "%s: Mouse Button pressed: %s", dispatchString, name);
}
static inline void onMouseButtonup(const PalEvent* event)
{
Uint32 button, serial; // button == low, serial == high
palUnpackUint32(event->data, &button, &serial);
PalWindow* window = palUnpackPointer(event->data2);
// get mouse button name
const char* name = s_MouseButtonNames[button];
palLog(nullptr, "%s: Mouse Button released: %s", dispatchString, name);
}
static inline void onMouseMove(const PalEvent* event)
{
Int32 x, y; // x == low, y == high
palUnpackInt32(event->data, &x, &y);
PalWindow* window = palUnpackPointer(event->data2);
palLog(nullptr, "%s: Mouse Moved: (%d, %d)", dispatchString, x, y);
}
static inline void onMouseDelta(const PalEvent* event)
{
Int32 dx, dy; // dx == low, dy == high
palUnpackInt32(event->data, &dx, &dy);
PalWindow* window = palUnpackPointer(event->data2);
palLog(nullptr, "%s: Mouse Delta: (%d, %d)", dispatchString, dx, dy);
}
static inline void onMouseWheel(const PalEvent* event)
{
Int32 dx, dy; // dx == low, dy == high
palUnpackInt32(event->data, &dx, &dy);
// get the raw wheel delta (float)
float fdx, fdy;
palGetRawMouseWheelDelta(&fdx, &fdy);
PalWindow* window = palUnpackPointer(event->data2);
palLog(nullptr, "%s: Mouse Wheel: (%d, %d)", dispatchString, dx, dy);
palLog(
nullptr,
"%s: Mouse Wheel Raw: (%.2f, %.2f)",
dispatchString,
fdx,
fdy);
}
static void PAL_CALL onEvent(
void* userData,
const PalEvent* event)
{
if (event->type == PAL_EVENT_KEYDOWN) {
onKeydown(event);
} else if (event->type == PAL_EVENT_KEYREPEAT) {
onKeyrepeat(event);
} else if (event->type == PAL_EVENT_KEYUP) {
onKeyup(event);
} else if (event->type == PAL_EVENT_MOUSE_BUTTONDOWN) {
onMouseButtondown(event);
} else if (event->type == PAL_EVENT_MOUSE_BUTTONUP) {
onMouseButtonup(event);
} else if (event->type == PAL_EVENT_MOUSE_MOVE) {
onMouseMove(event);
} else if (event->type == PAL_EVENT_MOUSE_DELTA) {
onMouseDelta(event);
} else if (event->type == PAL_EVENT_MOUSE_WHEEL) {
onMouseWheel(event);
}
}
bool inputWindowTest()
{
palLog(nullptr, "");
palLog(nullptr, "===========================================");
palLog(nullptr, "Input Window Test");
palLog(nullptr, "Press Escape or click close button to close Test");
palLog(nullptr, "===========================================");
palLog(nullptr, "");
PalResult result;
PalWindow* window = nullptr;
PalWindowCreateInfo createInfo = {0};
bool running = false;
// event driver
PalEventDriver* eventDriver = nullptr;
PalEventDriverCreateInfo eventDriverCreateInfo = {0};
// fill the event driver create info
eventDriverCreateInfo.allocator = nullptr; // default allocator
eventDriverCreateInfo.callback = onEvent; // for callback dispatch
eventDriverCreateInfo.queue = nullptr; // default queue
eventDriverCreateInfo.userData = nullptr; // null
// create the event driver
result = palCreateEventDriver(&eventDriverCreateInfo, &eventDriver);
if (result != PAL_RESULT_SUCCESS) {
const char* error = palFormatResult(result);
palLog(nullptr, "Failed to create event driver: %s", error);
return false;
}
// initialize the video system. We pass the event driver to recieve video
// related events the video system does not copy the event driver, it must
// be valid till the video system is shutdown
result = palInitVideo(nullptr, eventDriver);
if (result != PAL_RESULT_SUCCESS) {
const char* error = palFormatResult(result);
palLog(nullptr, "Failed to initialize video: %s", error);
return false;
}
// fill the create info struct
createInfo.monitor = nullptr; // use default monitor
createInfo.height = 480;
createInfo.width = 640;
createInfo.show = true;
createInfo.style = PAL_WINDOW_STYLE_RESIZABLE;
createInfo.title = "Input Window";
// check if we support decorated windows (title bar, close etc)
PalVideoFeatures64 features = palGetVideoFeaturesEx();
if (!(features & PAL_VIDEO_FEATURE64_DECORATED_WINDOW)) {
// if we dont support, we need to create a borderless window
// and create the decorations ourselves
createInfo.style |= PAL_WINDOW_STYLE_BORDERLESS;
}
// create the window with the create info struct
result = palCreateWindow(&createInfo, &window);
if (result != PAL_RESULT_SUCCESS) {
const char* error = palFormatResult(result);
palLog(nullptr, "Failed to create window: %s", error);
return false;
}
// we set window close to poll
palSetEventDispatchMode(
eventDriver,
PAL_EVENT_WINDOW_CLOSE,
PAL_DISPATCH_POLL);
PalDispatchMode dispatchMode = PAL_DISPATCH_NONE;
#if DISPATCH_MODE_POLL
dispatchMode = PAL_DISPATCH_POLL;
#else
dispatchMode = PAL_DISPATCH_CALLBACK;
#endif // DISPATCH_MODE_POLL
// set dispatch mode for all events.
for (Uint32 e = PAL_EVENT_KEYDOWN; e < PAL_EVENT_USER; e++) {
palSetEventDispatchMode(eventDriver, e, dispatchMode);
}
s_Running = true;
while (s_Running) {
// update the video system to push video events
palUpdateVideo();
PalEvent event;
while (palPollEvent(eventDriver, &event)) {
switch (event.type) {
case PAL_EVENT_WINDOW_CLOSE: {
s_Running = false;
break;
}
case PAL_EVENT_KEYDOWN: {
onKeydown(&event);
break;
}
case PAL_EVENT_KEYREPEAT: {
onKeyrepeat(&event);
break;
}
case PAL_EVENT_KEYUP: {
onKeyup(&event);
break;
}
case PAL_EVENT_MOUSE_BUTTONDOWN: {
onMouseButtondown(&event);
break;
}
case PAL_EVENT_MOUSE_BUTTONUP: {
onMouseButtonup(&event);
break;
}
case PAL_EVENT_MOUSE_MOVE: {
onMouseMove(&event);
break;
}
case PAL_EVENT_MOUSE_DELTA: {
onMouseDelta(&event);
break;
}
case PAL_EVENT_MOUSE_WHEEL: {
onMouseWheel(&event);
break;
}
}
}
}
palDestroyWindow(window);
// shutdown the video system
palShutdownVideo();
// destroy the event driver
palDestroyEventDriver(eventDriver);
return true;
}