Changeset 656 for abuse/trunk/src/imlib/event.cpp
- Timestamp:
- May 15, 2011, 6:22:13 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/imlib/event.cpp
r652 r656 35 35 { 36 36 CHECK(screen && pal); 37 last_keystat = get_key_flags();38 37 m_pending = 0; 39 38 … … 62 61 63 62 m_sprite = new sprite(screen, im, 100, 100); 64 m_pos = m_lastpos = screen->Size() / 2; 65 m_button = m_lastbutton = 0; 63 m_pos = screen->Size() / 2; 66 64 m_center = vec2i(0, 0); 65 m_button = 0; 67 66 68 67 // Platform-specific stuff … … 76 75 { 77 76 ; 77 } 78 79 void EventHandler::Get(Event &ev) 80 { 81 // Sleep until there are events available 82 while(!m_pending) 83 { 84 Timer tmp; 85 IsPending(); 86 87 if (!m_pending) 88 tmp.WaitMs(1); 89 } 90 91 // Return first queued event if applicable 92 Event *ep = (Event *)m_events.first(); 93 if(ep) 94 { 95 ev = *ep; 96 m_events.unlink(ep); 97 delete ep; 98 m_pending = m_events.first() != NULL; 99 return; 100 } 101 102 // Return an event from the platform-specific system 103 SysEvent(ev); 78 104 } 79 105
Note: See TracChangeset
for help on using the changeset viewer.