这篇教程C++ HandleEvent函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中HandleEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ HandleEvent函数的具体用法?C++ HandleEvent怎么用?C++ HandleEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了HandleEvent函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: onActivityEvent void onActivityEvent(int inVal) { __android_log_print(ANDROID_LOG_INFO, "NME", "Activity action %d", inVal); if (inVal==1 || inVal==2) { Event evt( inVal==1 ? etActivate : etDeactivate ); HandleEvent(evt); } }
开发者ID:bbeaulant,项目名称:NME,代码行数:9,
示例2: bool EdgeBarrierController::Impl::HandleEventCB(XEvent xevent, void* data){ auto edge_barrier_controller = static_cast<EdgeBarrierController::Impl*>(data); int const xi2_opcode = edge_barrier_controller->xi2_opcode_; if (xevent.type != GenericEvent || xevent.xcookie.extension != xi2_opcode) return false; return edge_barrier_controller->HandleEvent(xevent);}
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:10,
示例3: e// == OIS INPUT ==bool Client::mouseMoved(const OIS::MouseEvent &arg) { if(!mGameStateManager.GetCurrentState()->GetGUI()->injectMouseMove(arg.state.X.abs, arg.state.Y.abs, arg.state.Z.abs)) { Event e("input:mouse:moved"); e.WriteData(arg.state.buttonDown(OIS::MB_Left)); e.WriteData(arg.state.buttonDown(OIS::MB_Right)); e.WriteData(arg.state.X.rel); e.WriteData(arg.state.Y.rel); HandleEvent(e); }}
开发者ID:opatut,项目名称:chars,代码行数:11,
示例4: SDL_GetTicksvoid Client::MainLoop(void){ GLenum statusGL; SDL_Event event; Uint32 ticks0 = SDL_GetTicks(), ticks; float dt; char errorString[260]; while (!done) {#ifdef DEBUG // Check for openGL errors while ((statusGL = glGetError()) != GL_NO_ERROR) { GLErrorString(errorString, statusGL); fprintf (stderr, "GL Error during main loop: %s/n", errorString); }#endif // DEBUG // Handle all events in queue SDL_Event event; while (SDL_PollEvent (&event)) { HandleEvent (&event); } while(SDLNet_UDP_Recv(udp_socket, fromServer)) { if (fromServer->address.host == serverAddress.host && fromServer->address.port == serverAddress.port) { if(pScene) pScene->OnServerMessage (fromServer->data, fromServer->len); } } // determine how much time passed since last iteration: ticks = SDL_GetTicks(); dt = float(ticks - ticks0) / 1000; ticks0 = ticks; if (dt > 0.05f) dt = 0.05f; if (pScene) { pScene->Update (dt); pScene->Render (); } // Show whatever is rendered in the main window SDL_GL_SwapWindow (mainWindow); }}
开发者ID:cbaakman,项目名称:game-templates,代码行数:54,
示例5: whileboolX11EventQueue::OnFileEvent(FileDescriptor fd, unsigned mask){ while(XPending(display)) { XEvent event; XNextEvent(display, &event); HandleEvent(event); } return true;}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:11,
示例6: lockvoid AsyncRequests::PullEventsInternal(){ // This is only called if the queue isn't empty. // So just flush the pipeline to get accurate results. g_vertex_manager->Flush(); std::unique_lock<std::mutex> lock(m_mutex); m_empty.Set(); while (!m_queue.empty()) { Event e = m_queue.front(); // try to merge as many efb pokes as possible // it's a bit hacky, but some games render a complete frame in this way if ((e.type == Event::EFB_POKE_COLOR || e.type == Event::EFB_POKE_Z)) { m_merged_efb_pokes.clear(); Event first_event = m_queue.front(); const auto t = first_event.type == Event::EFB_POKE_COLOR ? EFBAccessType::PokeColor : EFBAccessType::PokeZ; do { e = m_queue.front(); EfbPokeData d; d.data = e.efb_poke.data; d.x = e.efb_poke.x; d.y = e.efb_poke.y; m_merged_efb_pokes.push_back(d); m_queue.pop(); } while (!m_queue.empty() && m_queue.front().type == first_event.type); lock.unlock(); g_renderer->PokeEFB(t, m_merged_efb_pokes.data(), m_merged_efb_pokes.size()); lock.lock(); continue; } lock.unlock(); HandleEvent(e); lock.lock(); m_queue.pop(); } if (m_wake_me_up_again) { m_wake_me_up_again = false; m_cond.notify_all(); }}
开发者ID:AdmiralCurtiss,项目名称:dolphin,代码行数:54,
示例7: whilevoid Demo::Loop() { while (Running) { // message processing loop while(SDL_PollEvent(&event)) { HandleEvent(&event); } Render(); }}
开发者ID:rusticmystic,项目名称:demo_sources,代码行数:12,
示例8: whileint CBPlatform::MessageLoop(){ bool done = false; while (!done) { SDL_Event event; while (SDL_PollEvent(&event)) { HandleEvent(&event); } if(Game && Game->m_Renderer->m_Active && Game->m_Renderer->m_Ready) { Game->DisplayContent(); Game->DisplayQuickMsg(); Game->DisplayDebugInfo(); Game->m_Renderer->SendRenderingHintSceneComplete(); // ***** flip if(!Game->m_SuspendedRendering) Game->m_Renderer->Flip(); if(Game->m_Loading) Game->LoadGame(Game->m_ScheduledLoadSlot); } if(Game->m_Quitting) break; } if(Game) { // remember previous window position /* if(Game->m_Renderer && Game->m_Renderer->m_Windowed) { if(!::IsIconic(Game->m_Renderer->m_Window)) { int PosX = Game->m_Renderer->m_WindowRect.left; int PosY = Game->m_Renderer->m_WindowRect.top; PosX -= Game->m_Renderer->m_MonitorRect.left; PosY -= Game->m_Renderer->m_MonitorRect.top; Game->m_Registry->WriteInt("Video", "WindowPosX", PosX); Game->m_Registry->WriteInt("Video", "WindowPosY", PosY); } } */ SAFE_DELETE(Game); } return 0;}
开发者ID:segafan,项目名称:wmelite_jankavan-julia-repo,代码行数:53,
示例9: SDL_IsTextInputActivebool InputEventController::OnKeyPressed(const SDL_KeyboardEvent& arg){ SDL_Keycode kc = arg.keysym.sym; auto textInputActive = SDL_IsTextInputActive(); if (textInputActive) { SDL_Keycode nkc = kc; // Map numpad enter to the "normal" enter so action subscribers don't need to // check for both. if (nkc == SDLK_KP_ENTER) nkc = SDLK_RETURN; switch (nkc) { case SDLK_BACKSPACE: case SDLK_RETURN: // For now, key_t values are mapped directly to SDL keycodes for // convenience. (*actions.ui.control)(static_cast<TextControl::key_t>(nkc)); break; } } // make left and right modifiers equal if (kc == SDLK_RSHIFT) kc = SDLK_LSHIFT; else if (kc == SDLK_RCTRL) kc = SDLK_LCTRL; else if (kc == SDLK_RGUI) kc = SDLK_LGUI; // Hotkeys are fired in addition to the normal bound action, but we don't // want to interfere with text input. if (!textInputActive) { auto iter = hotkeys.find(kc); if (iter != hotkeys.end()) { (*(iter->second))(1); } } auto hash = HashKeyboardEvent(kc); // Flip the meaning of menuNext if shift is held down. if (IsMapActive(ActionMapId::MENU) && hash == actions.ui.menuNext->GetPrimaryTrigger() && (SDL_GetModState() & KMOD_SHIFT)) { hash = actions.ui.menuPrev->GetPrimaryTrigger(); } HandleEvent(hash, 1); return true;}
开发者ID:HoverRace,项目名称:HoverRace,代码行数:53,
示例10: mainvoid main(){ FATFS fs; FIL file; InitMCU(); //VS_SinTest(0x74); VS_Init(); if(disk_initialize(0)) ConsoleWrite("Disk Initialization FAILED. :(/n"); else ConsoleWrite("Disk Initialization Complete./n"); if(f_mount(0,&fs)) ConsoleWrite("Mount FieSystem Failed/n"); else ConsoleWrite("Mount FileSystem Success!/n"); ConsoleWrite("Scaning Music Files.../n/n"); if(scan_files("/",&(Player.TotalSongNum))) ConsoleWrite("Scan Files Failed/n"); else{ ConsoleWrite("/nScan Files Accomplished./ntotal files: "); ConsolePutUInt (Player.TotalSongNum); ConsoleWrite ("/n/n");} if(scan_files_open (&file,"/",1)) // Start node to be scanned and opened ConsoleWrite("Open File Error/n"); //Playing mp3/track001.mp3 ... will apear in function Player.currFile = &file; Player.SongNum = 1; Player.Status = PS_PLAYING; Player.Mode = SM_SONG; Player.Volume = 170; Player.Bass = 7; Player.Treble = 0; VS_SetBassTreble(Player.Bass,Player.Treble); BufCnt = 0;// GenerateEvent(EV_BUFEMPTY); //Main loop while(1) { //Get system event Player.Event = GetEvent(); //Handle Events HandleEvent(); }}
开发者ID:solokacher,项目名称:iCandle,代码行数:53,
示例11: HandleEvent bool SDLApplication::Update () { SDL_Event event; event.type = -1; if (active && (firstTime || SDL_WaitEvent (&event))) { firstTime = false; HandleEvent (&event); event.type = -1; if (!active) return active; if (SDL_PollEvent (&event)) { HandleEvent (&event); event.type = -1; } currentUpdate = SDL_GetTicks (); if (currentUpdate >= nextUpdate) { SDL_RemoveTimer (timerID); OnTimer (0, 0); } else if (!timerActive) { timerActive = true; timerID = SDL_AddTimer (nextUpdate - currentUpdate, OnTimer, 0); } } return active; }
开发者ID:GumbertGumbert,项目名称:lime,代码行数:40,
示例12: EntryPointFuncDllExport PF_Err EntryPointFunc ( PF_Cmd cmd, PF_InData *in_data, PF_OutData *out_data, PF_ParamDef *params[], PF_LayerDef *output, void *extra){ PF_Err err = PF_Err_NONE; try { switch (cmd) { case PF_Cmd_ABOUT: err = About(in_data, out_data, params, output); break; case PF_Cmd_GLOBAL_SETUP: err = GlobalSetup( in_data, out_data, params, output); break; case PF_Cmd_PARAMS_SETUP: err = ParamsSetup( in_data, out_data, params, output); break; case PF_Cmd_RENDER: err = Render( in_data, out_data, params, output); break; case PF_Cmd_EVENT: err = HandleEvent( in_data, out_data, params, output, reinterpret_cast<PF_EventExtra*>(extra)); break; case PF_Cmd_ARBITRARY_CALLBACK: err = HandleArbitrary( in_data, out_data, params, output, reinterpret_cast<PF_ArbParamsExtra*>(extra)); break; case PF_Cmd_SMART_PRE_RENDER: err = PreRender(in_data, out_data, reinterpret_cast<PF_PreRenderExtra*>(extra)); break; case PF_Cmd_SMART_RENDER: err = SmartRender( in_data, out_data, reinterpret_cast<PF_SmartRenderExtra*>(extra)); break; } } catch (PF_Err &thrown_err) { err = thrown_err; } return err;}
开发者ID:KAndQ,项目名称:AEPlugins,代码行数:52,
示例13: whileint OPLMIDIDevice::PlayTick(){ DWORD delay = 0; while (delay == 0 && Events != NULL) { DWORD *event = (DWORD *)(Events->lpData + Position); if (MEVT_EVENTTYPE(event[2]) == MEVT_TEMPO) { SetTempo(MEVT_EVENTPARM(event[2])); } else if (MEVT_EVENTTYPE(event[2]) == MEVT_LONGMSG) { // Should I handle master volume changes? } else if (MEVT_EVENTTYPE(event[2]) == 0) { // Short MIDI event int status = event[2] & 0xff; int parm1 = (event[2] >> 8) & 0x7f; int parm2 = (event[2] >> 16) & 0x7f; HandleEvent(status, parm1, parm2); } // Advance to next event. if (event[2] < 0x80000000) { // Short message Position += 12; } else { // Long message Position += 12 + ((MEVT_EVENTPARM(event[2]) + 3) & ~3); } // Did we use up this buffer? if (Position >= Events->dwBytesRecorded) { Events = Events->lpNext; Position = 0; if (Callback != NULL) { Callback(MOM_DONE, CallbackData, 0, 0); } } if (Events == NULL) { // No more events. Just return something to keep the song playing // while we wait for more to be submitted. return int(Division); } delay = *(DWORD *)(Events->lpData + Position); }
开发者ID:Xeomuz,项目名称:Doom-Port-Source-Code,代码行数:52,
示例14: HandleEventvoid wxAppConsoleBase::CallEventHandler(wxEvtHandler *handler, wxEventFunctor& functor, wxEvent& event) const{ // If the functor holds a method then, for backward compatibility, call // HandleEvent(): wxEventFunction eventFunction = functor.GetMethod(); if ( eventFunction ) HandleEvent(handler, eventFunction, event); else functor(handler, event);}
开发者ID:jonntd,项目名称:dynamica,代码行数:13,
示例15: HandleEventGUI_Status Window::EventLoop( void ) { SDL_Event event; GUI_Status rc; do { rc = view->FetchEvent( event ); if ( (rc != GUI_QUIT) && (rc != GUI_ERROR) ) rc = HandleEvent( event ); } while ( rc == GUI_OK ); return rc;}
开发者ID:drodin,项目名称:Crimson,代码行数:13,
示例16: whilevoid GMApplication::Run(){ bool quit = false; SDL_Event e; FrameTimer.start(); int oldticks = 0; fps.start(); while( !quit ) { //Handle events on queue while( SDL_PollEvent( &e ) != 0 ) { if( e.type == SDL_QUIT ) { quit = true; } HandleEvent(e); } int tick = FrameTimer.getTicks(); Update((float)(tick - oldticks)/1000.f); SDL_SetRenderDrawColor( Renderer, 0x00, 0x00, 0x00, 0xff); SDL_RenderClear( Renderer ); Draw((float)(tick - oldticks)/1000.f); SDL_RenderPresent( Renderer ); framecount++; if (fps.getTicks() > 1000) { int FPS = framecount / (tick/1000.f); if (Settings::Debug) { std::stringstream _fpstitle; _fpstitle << Title << " FPS: " << FPS; SDL_SetWindowTitle(Window,_fpstitle.str().c_str()); } else SDL_SetWindowTitle(Window, Title.c_str()); fps.start(); } oldticks = tick; }}
开发者ID:GreenMist-Studios,项目名称:GreenMist,代码行数:51,
示例17: OnTouch void OnTouch(int inType,double inX, double inY, int inID, float sizeX, float sizeY) { if (mSingleTouchID==NO_TOUCH || inID==mSingleTouchID || mMultiTouch) { EventType type = (EventType)inType; if (!mMultiTouch) { switch(inType) { case etTouchBegin: type = etMouseDown; break; case etTouchEnd: type = etMouseUp; break; case etTouchMove : type = etMouseMove; break; case etTouchTap: return; break; } } Event mouse(type, inX, inY); if (mSingleTouchID==NO_TOUCH || inID==mSingleTouchID || !mMultiTouch) mouse.flags |= efPrimaryTouch; if (inType==etTouchBegin) { if (mSingleTouchID==NO_TOUCH) mSingleTouchID = inID; mouse.flags |= efLeftDown; mDownX = inX; mDownY = inY; } else if (inType==etTouchEnd) { if (mSingleTouchID==inID) mSingleTouchID = NO_TOUCH; } else if (inType==etTouchMove) { mouse.flags |= efLeftDown; } mouse.value = inID; mouse.sx = sizeX; mouse.sy = sizeY; //if (inType==etTouchBegin) //ELOG("DOWN %d %f,%f (%s) %f,%f", inID, inX, inY, (mouse.flags & efPrimaryTouch) ? "P":"S", sizeX, sizeY ); //if (inType==etTouchEnd) //ELOG("UP %d %f,%f (%s) %f,%f", inID, inX, inY, (mouse.flags & efPrimaryTouch) ? "P":"S", sizeX, sizeY ); HandleEvent(mouse); } }
开发者ID:madrazo,项目名称:openfl-native-p8,代码行数:51,
示例18: MyPrivateEventProcstatic pascal void MyPrivateEventProc( const NavEventCallbackMessage callbackSelector, NavCBRecPtr callbackParms, NavCallBackUserData callbackUD ){ switch ( callbackSelector ) { case kNavCBEvent: { switch (callbackParms->eventData.eventDataParms.event->what) { case updateEvt: case activateEvt: HandleEvent(callbackParms->eventData.eventDataParms.event); break; } } break; case kNavCBUserAction: { if ( callbackParms->userAction == kNavUserActionOpen ) { // This is an open files action, send an AppleEvent NavReplyRecord reply; OSStatus status; status = NavDialogGetReply( callbackParms->context, &reply ); if ( status == noErr ) { SendOpenAE( reply.selection ); NavDisposeReply( &reply ); } } } break; case kNavCBTerminate: { if ( callbackParms->context == gOpenFileDialog ) { NavDialogDispose( gOpenFileDialog ); gOpenFileDialog = NULL; } // if after dismissing the dialog SimpleText has no windows open (so Activate event will not be sent) - // call AdjustMenus ourselves to have at right menus enabled if (FrontWindow() == nil) AdjustMenus(nil, true, false); } break; }}
开发者ID:fruitsamples,项目名称:SimpleText,代码行数:51,
示例19: HandleEvent void GUIMgr::Update(a_uint64 t_diff) { /**/ if(m_veEvents.empty() || m_vwWidget.empty()) return; for(a_uint32 i = 0; i < m_veEvents.size(); i++) { HandleEvent(m_veEvents[i]); } m_veEvents.clear(); }
开发者ID:Agamand,项目名称:AgmdEngine,代码行数:14,
示例20: absbool InputEventController::OnMouseMoved(const SDL_MouseMotionEvent& evt){ int x = evt.xrel; int y = evt.yrel; int ax = abs(x); int ay = abs(y); if (ax > 0) HandleEvent(HashMouseAxisEvent(AXIS_X, (x > 0) ? 1 : 0), ax); if (ay > 0) HandleEvent(HashMouseAxisEvent(AXIS_Y, (y > 0) ? 1 : 0), ay); // For some events (e.g. mouse wheel), we want to pass the mouse position // but the SDL event doesn't pass it along. So, we just keep track of the // last recorded mouse position and use that. mousePos.x = evt.x; mousePos.y = evt.y; (*actions.ui.mouseMoved)(mousePos); return true;}
开发者ID:HoverRace,项目名称:HoverRace,代码行数:23,
示例21: whilevoid Arti3DApp::Run(){ while (m_bRunning) { SDL_Event event; while (SDL_PollEvent(&event)) HandleEvent(event, this); RenderScene(); CalculateFPS(); m_pWindow->UpdateSurface(); }}
开发者ID:silverXz,项目名称:ToyX,代码行数:14,
示例22: lockvoid AsyncRequests::PullEventsInternal(){ std::unique_lock<std::mutex> lock(m_mutex); m_empty.store(true); while (!m_queue.empty()) { Event e = m_queue.front(); // try to merge as many efb pokes as possible // it's a bit hacky, but some games render a complete frame in this way if ((e.type == Event::EFB_POKE_COLOR || e.type == Event::EFB_POKE_Z)) { m_merged_efb_pokes.clear(); Event first_event = m_queue.front(); EFBAccessType t = first_event.type == Event::EFB_POKE_COLOR ? POKE_COLOR : POKE_Z; do { e = m_queue.front(); EfbPokeData d; d.data = e.efb_poke.data; d.x = e.efb_poke.x; d.y = e.efb_poke.y; m_merged_efb_pokes.push_back(d); m_queue.pop(); } while(!m_queue.empty() && m_queue.front().type == first_event.type); lock.unlock(); g_renderer->PokeEFB(t, m_merged_efb_pokes.data(), m_merged_efb_pokes.size()); lock.lock(); continue; } lock.unlock(); HandleEvent(e); lock.lock(); m_queue.pop(); } if (m_wake_me_up_again) { m_wake_me_up_again = false; m_cond.notify_all(); }}
开发者ID:aerotog,项目名称:dolphin,代码行数:49,
示例23: THROW_IF_ERR HRESULT Player_::Invoke(IMFAsyncResult *pResult) { MediaEventType meType = MEUnknown; // Event type IMFMediaEventPtr pEvent; try { // Get the event from the event queue. THROW_IF_ERR(m_pSession->EndGetEvent(pResult, pEvent.GetAddressOf())); // Get the event type. THROW_IF_ERR(pEvent->GetType(&meType)); if (meType == MESessionClosed) { // The session was closed. // The application is waiting on the m_hCloseEvent event handle. SetEvent(m_hCloseEvent); } else { // For all other events, get the next event in the queue. THROW_IF_ERR(m_pSession->BeginGetEvent(this, NULL)); } // Check the application state. // If a call to IMFMediaSession::Close is pending, it means the // application is waiting on the m_hCloseEvent event and // the application's message loop is blocked. // Otherwise, post a private window message to the application. //if (m_state != Closing) //{ // // Leave a reference count on the event. // //PostMessage(m_hwndEvent, WM_APP_PLAYER_EVENT, // // (WPARAM) pEvent.Detach(), (LPARAM)meType); //} HandleEvent((UINT_PTR)pEvent.Detach()); return S_OK; } catch (win32_error_exception& e) { return e.hresult(); } }
开发者ID:sfpgmr,项目名称:2dx,代码行数:49,
示例24: CollectEventsvoid BOCTX::Sweep(SEGM2 * aSegms, UINT32 nSegms){ CollectEvents(aSegms, nSegms); while (not m_E.empty()) { // store the current state of main active list SAVE_LIST save_list; save_list.reserve(32); for (SEGM_LIST::iterator segm = m_S.begin(); segm != m_S.end(); ++segm) save_list.push_back(&*segm); // do Pass 1 EVENT e = m_E.top(); m_E.pop(); EVENTLIST elist; elist.reserve(8); assert(INT20_MIN <= e.x and e.x <= INT20_MAX); AddEvent(&elist, e); HandleEvent(e); while (not m_E.empty() and m_E.top().x == e.x) { e = m_E.top(); m_E.pop(); AddEvent(&elist, e); HandleEvent(e); } // do Pass 2 Pass2(&elist, &save_list); }} // Sweep
开发者ID:igorizyumin,项目名称:xpcb,代码行数:36,
示例25: ZoomPicturevoid ZoomPicture (SDL_Surface *screen, SDL_Surface *picture, int smooth) { SDL_Surface *rotozoom_picture; SDL_Rect dest; int framecount, framemax, frameinc; double zoomxf,zoomyf; fprintf(stderr, "%s/n", messageText); /* Zoom and display the picture */ framemax=4*360; frameinc=1; for (framecount=360; framecount<framemax; framecount += frameinc) { if ((framecount % 360)==0) frameinc++; HandleEvent(); ClearScreen(screen); zoomxf=(float)framecount/(float)framemax; zoomxf=1.5*zoomxf*zoomxf; zoomyf=0.5+fabs(1.0*sin((double)framecount/80.0)); if ((framecount % 120)==0) { printf (" Frame: %i Zoom: x=%.2f y=%.2f/n",framecount,zoomxf,zoomyf); } if ((rotozoom_picture=zoomSurface (picture, zoomxf, zoomyf, smooth))!=NULL) { dest.x = (screen->w - rotozoom_picture->w)/2;; dest.y = (screen->h - rotozoom_picture->h)/2; dest.w = rotozoom_picture->w; dest.h = rotozoom_picture->h; if ( SDL_BlitSurface(rotozoom_picture, NULL, screen, &dest) < 0 ) { fprintf(stderr, "Blit failed: %s/n", SDL_GetError()); break; } SDL_FreeSurface(rotozoom_picture); } stringRGBA(screen, 8, 8, messageText, 255, 255, 255, 255); /* Display by flipping screens */ SDL_Flip(screen); /* Maybe delay */ if (delay>0) { SDL_Delay(delay); } } /* Pause for a sec */ SDL_Delay(1000);}
开发者ID:totsubo,项目名称:Opencaching.jp,代码行数:47,
示例26: RotatePicture90Degreesvoid RotatePicture90Degrees (SDL_Surface *screen, SDL_Surface *picture) { SDL_Surface *rotozoom_picture; SDL_Rect dest; int framecount, framemax, frameinc; int numClockwiseTurns; fprintf(stderr, "%s/n", messageText); /* Rotate and display the picture */ framemax = 21; frameinc = 1; numClockwiseTurns = -4; for (framecount=0; framecount<framemax; framecount += frameinc) { HandleEvent(); ClearScreen(screen); printf (" Frame: %i Rotate90: %i clockwise turns/n",framecount,numClockwiseTurns+4); if ((rotozoom_picture=rotateSurface90Degrees(picture, numClockwiseTurns))!=NULL) { dest.x = (screen->w - rotozoom_picture->w)/2;; dest.y = (screen->h - rotozoom_picture->h)/2; dest.w = rotozoom_picture->w; dest.h = rotozoom_picture->h; if ( SDL_BlitSurface(rotozoom_picture, NULL, screen, &dest) < 0 ) { fprintf(stderr, "Blit failed: %s/n", SDL_GetError()); break; } SDL_FreeSurface(rotozoom_picture); } stringRGBA(screen, 8, 8, messageText, 255, 255, 255, 255); /* Display by flipping screens */ SDL_Flip(screen); /* Always delay */ SDL_Delay(333); if (delay>0) { SDL_Delay(delay); } numClockwiseTurns++; } /* Pause for a sec */ SDL_Delay(1000);}
开发者ID:totsubo,项目名称:Opencaching.jp,代码行数:46,
示例27: EmptyEventQueueEmptyEventQueue(){ XEvent event; emptying = TRUE; do { while (XPending()) { XPeekEvent(&event); if (event.type & (KeyPressed | KeyReleased | MouseMoved | ButtonPressed | ButtonReleased)) XNextEvent(&event); else HandleEvent(); } XSync(0); } while (XPending()); emptying = FALSE;}
开发者ID:scriptum,项目名称:cppcheck-libs,代码行数:17,
示例28: CALLED// protected:status_t AbstractFileInterfaceNode::HandleStart( const media_timed_event *event, bigtime_t lateness, bool realTimeEvent){ CALLED(); if (RunState() != B_STARTED) { // XXX: Either use the following line or the lines that are not commented. // There doesn't seem to be a practical difference that i can tell. // HandleBuffer(event,lateness,realTimeEvent); media_timed_event firstBufferEvent(event->event_time, BTimedEventQueue::B_HANDLE_BUFFER); HandleEvent(&firstBufferEvent, 0, false); EventQueue()->AddEvent(firstBufferEvent); } return B_OK;}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:18,
注:本文中的HandleEvent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ HandleEvents函数代码示例 C++ HandleError函数代码示例 |