comparison modules/ui.tp @ 376:d61b1f0e1936

Some minor WIP stuff in UI module
author Michael Pavone <pavone@retrodev.com>
date Sat, 15 Aug 2015 22:45:24 -0700
parents b8f721bde066
children
comparison
equal deleted inserted replaced
375:f8d80c16abbd 376:d61b1f0e1936
230 230
231 show <- { 231 show <- {
232 if: (_checkInitSDL: ) { 232 if: (_checkInitSDL: ) {
233 _wind <- sdl createWindow: title pos: x y size: width height flags: 0u32 233 _wind <- sdl createWindow: title pos: x y size: width height flags: 0u32
234 _wind value: :window { 234 _wind value: :window {
235 _visibleWindows <- self | _visibleWindows
235 _renderer <- window createRenderer: -1 flags: ((window renderOpts) accelerated) 236 _renderer <- window createRenderer: -1 flags: ((window renderOpts) accelerated)
236 layout: 237 layout:
237 draw: 238 draw:
238 } none: { 239 } none: {
239 false 240 false
405 while: { continue? } do: { 406 while: { continue? } do: {
406 (sdl waitEvent) value: :event { 407 (sdl waitEvent) value: :event {
407 _handlers ifget: (event type) :handler { 408 _handlers ifget: (event type) :handler {
408 handler: event 409 handler: event
409 } else: { 410 } else: {
410 print: "Unhandled event type: " . (event type) . "\n" 411
412 if: (event type) = ((sdl eventTypes) mouseMotion) {
413 print: "Window ID: " . (event windowID) . ", x: " . (event x) . ", y: " . (event y) . "\n"
414 } else: {
415 print: "Unhandled event type: " . (event type) . "\n"
416 }
411 } 417 }
412 } none: {} 418 } none: {}
413 } 419 }
414 } 420 }
415 } 421 }