Atlas - SDL_render_ngage.cpp

Home / ext / SDL / src / render / ngage Lines: 1 | Size: 19724 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#ifdef __cplusplus 22extern "C" { 23#endif 24 25#include "../../events/SDL_keyboard_c.h" 26#include "../SDL_sysrender.h" 27#include "SDL_internal.h" 28#include "SDL_render_ngage_c.h" 29 30#ifdef __cplusplus 31} 32#endif 33 34#ifdef SDL_VIDEO_RENDER_NGAGE 35 36#include "SDL_render_ngage_c.hpp" 37#include "SDL_render_ops.hpp" 38 39const TUint32 WindowClientHandle = 0x571D0A; 40 41extern CRenderer *gRenderer; 42 43#ifdef __cplusplus 44extern "C" { 45#endif 46 47void NGAGE_Clear(const Uint32 color) 48{ 49 gRenderer->Clear(color); 50} 51 52bool NGAGE_Copy(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Rect *srcrect, SDL_Rect *dstrect) 53{ 54 return gRenderer->Copy(renderer, texture, srcrect, dstrect); 55} 56 57bool NGAGE_CopyEx(SDL_Renderer *renderer, SDL_Texture *texture, NGAGE_CopyExData *copydata) 58{ 59 return gRenderer->CopyEx(renderer, texture, copydata); 60} 61 62bool NGAGE_CreateTextureData(NGAGE_TextureData *data, const int width, const int height) 63{ 64 return gRenderer->CreateTextureData(data, width, height); 65} 66 67void NGAGE_DestroyTextureData(NGAGE_TextureData *data) 68{ 69 if (data) { 70 delete data->bitmap; 71 data->bitmap = NULL; 72 } 73} 74 75void NGAGE_DrawLines(NGAGE_Vertex *verts, const int count) 76{ 77 gRenderer->DrawLines(verts, count); 78} 79 80void NGAGE_DrawPoints(NGAGE_Vertex *verts, const int count) 81{ 82 gRenderer->DrawPoints(verts, count); 83} 84 85void NGAGE_FillRects(NGAGE_Vertex *verts, const int count) 86{ 87 gRenderer->FillRects(verts, count); 88} 89 90void NGAGE_Flip() 91{ 92 gRenderer->Flip(); 93} 94 95void NGAGE_SetClipRect(const SDL_Rect *rect) 96{ 97 gRenderer->SetClipRect(rect->x, rect->y, rect->w, rect->h); 98} 99 100void NGAGE_SetDrawColor(const Uint32 color) 101{ 102 if (gRenderer) { 103 gRenderer->SetDrawColor(color); 104 } 105} 106 107void NGAGE_PumpEventsInternal() 108{ 109 gRenderer->PumpEvents(); 110} 111 112void NGAGE_SuspendScreenSaverInternal(bool suspend) 113{ 114 gRenderer->SuspendScreenSaver(suspend); 115} 116 117#ifdef __cplusplus 118} 119#endif 120 121CRenderer *CRenderer::NewL() 122{ 123 CRenderer *self = new (ELeave) CRenderer(); 124 CleanupStack::PushL(self); 125 self->ConstructL(); 126 CleanupStack::Pop(self); 127 return self; 128} 129 130CRenderer::CRenderer() : iRenderer(0), iDirectScreen(0), iScreenGc(0), iWsSession(), iWsWindowGroup(), iWsWindowGroupID(0), iWsWindow(), iWsScreen(0), iWsEventStatus(), iWsEvent(), iShowFPS(EFalse), iFPS(0), iFont(0) {} 131 132CRenderer::~CRenderer() 133{ 134 delete iRenderer; 135 iRenderer = 0; 136} 137 138void CRenderer::ConstructL() 139{ 140 TInt error = KErrNone; 141 142 error = iWsSession.Connect(); 143 if (error != KErrNone) { 144 SDL_Log("Failed to connect to window server: %d", error); 145 User::Leave(error); 146 } 147 148 iWsScreen = new (ELeave) CWsScreenDevice(iWsSession); 149 error = iWsScreen->Construct(); 150 if (error != KErrNone) { 151 SDL_Log("Failed to construct screen device: %d", error); 152 User::Leave(error); 153 } 154 155 iWsWindowGroup = RWindowGroup(iWsSession); 156 error = iWsWindowGroup.Construct(WindowClientHandle); 157 if (error != KErrNone) { 158 SDL_Log("Failed to construct window group: %d", error); 159 User::Leave(error); 160 } 161 iWsWindowGroup.SetOrdinalPosition(0); 162 163 RProcess thisProcess; 164 TParse exeName; 165 exeName.Set(thisProcess.FileName(), NULL, NULL); 166 TBuf<32> winGroupName; 167 winGroupName.Append(0); 168 winGroupName.Append(0); 169 winGroupName.Append(0); // UID 170 winGroupName.Append(0); 171 winGroupName.Append(exeName.Name()); // Caption 172 winGroupName.Append(0); 173 winGroupName.Append(0); // DOC name 174 iWsWindowGroup.SetName(winGroupName); 175 176 iWsWindow = RWindow(iWsSession); 177 error = iWsWindow.Construct(iWsWindowGroup, WindowClientHandle - 1); 178 if (error != KErrNone) { 179 SDL_Log("Failed to construct window: %d", error); 180 User::Leave(error); 181 } 182 iWsWindow.SetBackgroundColor(KRgbWhite); 183 iWsWindow.SetRequiredDisplayMode(EColor4K); 184 iWsWindow.Activate(); 185 iWsWindow.SetSize(iWsScreen->SizeInPixels()); 186 iWsWindow.SetVisible(ETrue); 187 188 iWsWindowGroupID = iWsWindowGroup.Identifier(); 189 190 TRAPD(errc, iRenderer = iRenderer->NewL()); 191 if (errc != KErrNone) { 192 SDL_Log("Failed to create renderer: %d", errc); 193 return; 194 } 195 196 iDirectScreen = CDirectScreenAccess::NewL( 197 iWsSession, 198 *(iWsScreen), 199 iWsWindow, *this); 200 201 // Select font. 202 TFontSpec fontSpec(_L("LatinBold12"), 12); 203 TInt errd = iWsScreen->GetNearestFontInTwips((CFont *&)iFont, fontSpec); 204 if (errd != KErrNone) { 205 SDL_Log("Failed to get font: %d", errd); 206 return; 207 } 208 209 // Activate events. 210 iWsEventStatus = KRequestPending; 211 iWsSession.EventReady(&iWsEventStatus); 212 213 DisableKeyBlocking(); 214 215 iIsFocused = ETrue; 216 iShowFPS = EFalse; 217 iSuspendScreenSaver = EFalse; 218 219 if (!iDirectScreen->IsActive()) { 220 TRAPD(err, iDirectScreen->StartL()); 221 if (KErrNone != err) { 222 return; 223 } 224 iDirectScreen->ScreenDevice()->SetAutoUpdate(ETrue); 225 } 226} 227 228void CRenderer::Restart(RDirectScreenAccess::TTerminationReasons aReason) 229{ 230 if (!iDirectScreen->IsActive()) { 231 TRAPD(err, iDirectScreen->StartL()); 232 if (KErrNone != err) { 233 return; 234 } 235 iDirectScreen->ScreenDevice()->SetAutoUpdate(ETrue); 236 } 237} 238 239void CRenderer::AbortNow(RDirectScreenAccess::TTerminationReasons aReason) 240{ 241 if (iDirectScreen->IsActive()) { 242 iDirectScreen->Cancel(); 243 } 244} 245 246void CRenderer::Clear(TUint32 iColor) 247{ 248 if (iRenderer && iRenderer->Gc()) { 249 iRenderer->Gc()->SetBrushColor(iColor); 250 iRenderer->Gc()->Clear(); 251 } 252} 253 254#ifdef __cplusplus 255extern "C" { 256#endif 257 258Uint32 NGAGE_ConvertColor(float r, float g, float b, float a, float color_scale) 259{ 260 TFixed ff = 255 << 16; // 255.f 261 262 TFixed scalef = Real2Fix(color_scale); 263 TFixed rf = Real2Fix(r); 264 TFixed gf = Real2Fix(g); 265 TFixed bf = Real2Fix(b); 266 TFixed af = Real2Fix(a); 267 268 rf = FixMul(rf, scalef); 269 gf = FixMul(gf, scalef); 270 bf = FixMul(bf, scalef); 271 272 rf = SDL_clamp(rf, 0, ff); 273 gf = SDL_clamp(gf, 0, ff); 274 bf = SDL_clamp(bf, 0, ff); 275 af = SDL_clamp(af, 0, ff); 276 277 rf = FixMul(rf, ff) >> 16; 278 gf = FixMul(gf, ff) >> 16; 279 bf = FixMul(bf, ff) >> 16; 280 af = FixMul(af, ff) >> 16; 281 282 return (af << 24) | (bf << 16) | (gf << 8) | rf; 283} 284 285#ifdef __cplusplus 286} 287#endif 288 289bool CRenderer::Copy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect) 290{ 291 if (!texture) { 292 return false; 293 } 294 295 NGAGE_TextureData *phdata = (NGAGE_TextureData *)texture->internal; 296 if (!phdata) { 297 return false; 298 } 299 300 SDL_FColor *c = &texture->color; 301 int w = phdata->surface->w; 302 int h = phdata->surface->h; 303 int pitch = phdata->surface->pitch; 304 void *source = phdata->surface->pixels; 305 void *dest; 306 307 if (!source) { 308 return false; 309 } 310 311 void *pixel_buffer_a = SDL_calloc(1, pitch * h); 312 if (!pixel_buffer_a) { 313 return false; 314 } 315 dest = pixel_buffer_a; 316 317 void *pixel_buffer_b = SDL_calloc(1, pitch * h); 318 if (!pixel_buffer_b) { 319 SDL_free(pixel_buffer_a); 320 return false; 321 } 322 323 if (c->a != 1.f || c->r != 1.f || c->g != 1.f || c->b != 1.f) { 324 ApplyColorMod(dest, source, pitch, w, h, texture->color); 325 326 source = dest; 327 } 328 329 float sx; 330 float sy; 331 SDL_GetRenderScale(renderer, &sx, &sy); 332 333 if (sx != 1.f || sy != 1.f) { 334 TFixed scale_x = Real2Fix(sx); 335 TFixed scale_y = Real2Fix(sy); 336 TFixed center_x = Int2Fix(w / 2); 337 TFixed center_y = Int2Fix(h / 2); 338 339 dest == pixel_buffer_a ? dest = pixel_buffer_b : dest = pixel_buffer_a; 340 341 ApplyScale(dest, source, pitch, w, h, center_x, center_y, scale_x, scale_y); 342 343 source = dest; 344 } 345 346 Mem::Copy(phdata->bitmap->DataAddress(), source, pitch * h); 347 SDL_free(pixel_buffer_a); 348 SDL_free(pixel_buffer_b); 349 350 if (phdata->bitmap) { 351 TRect aSource(TPoint(srcrect->x, srcrect->y), TSize(srcrect->w, srcrect->h)); 352 TPoint aDest(dstrect->x, dstrect->y); 353 iRenderer->Gc()->BitBlt(aDest, phdata->bitmap, aSource); 354 } 355 356 return true; 357} 358 359bool CRenderer::CopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const NGAGE_CopyExData *copydata) 360{ 361 NGAGE_TextureData *phdata = (NGAGE_TextureData *)texture->internal; 362 if (!phdata) { 363 return false; 364 } 365 366 SDL_FColor *c = &texture->color; 367 int w = phdata->surface->w; 368 int h = phdata->surface->h; 369 int pitch = phdata->surface->pitch; 370 void *source = phdata->surface->pixels; 371 void *dest; 372 373 if (!source) { 374 return false; 375 } 376 377 void *pixel_buffer_a = SDL_calloc(1, pitch * h); 378 if (!pixel_buffer_a) { 379 return false; 380 } 381 dest = pixel_buffer_a; 382 383 void *pixel_buffer_b = SDL_calloc(1, pitch * h); 384 if (!pixel_buffer_a) { 385 SDL_free(pixel_buffer_a); 386 return false; 387 } 388 389 if (copydata->flip) { 390 ApplyFlip(dest, source, pitch, w, h, copydata->flip); 391 source = dest; 392 } 393 394 if (copydata->scale_x != 1.f || copydata->scale_y != 1.f) { 395 dest == pixel_buffer_a ? dest = pixel_buffer_b : dest = pixel_buffer_a; 396 ApplyScale(dest, source, pitch, w, h, copydata->center.x, copydata->center.y, copydata->scale_x, copydata->scale_y); 397 source = dest; 398 } 399 400 if (copydata->angle) { 401 dest == pixel_buffer_a ? dest = pixel_buffer_b : dest = pixel_buffer_a; 402 ApplyRotation(dest, source, pitch, w, h, copydata->center.x, copydata->center.y, copydata->angle); 403 source = dest; 404 } 405 406 if (c->a != 1.f || c->r != 1.f || c->g != 1.f || c->b != 1.f) { 407 dest == pixel_buffer_a ? dest = pixel_buffer_b : dest = pixel_buffer_a; 408 ApplyColorMod(dest, source, pitch, w, h, texture->color); 409 source = dest; 410 } 411 412 Mem::Copy(phdata->bitmap->DataAddress(), source, pitch * h); 413 SDL_free(pixel_buffer_a); 414 SDL_free(pixel_buffer_b); 415 416 if (phdata->bitmap) { 417 TRect aSource(TPoint(copydata->srcrect.x, copydata->srcrect.y), TSize(copydata->srcrect.w, copydata->srcrect.h)); 418 TPoint aDest(copydata->dstrect.x, copydata->dstrect.y); 419 iRenderer->Gc()->BitBlt(aDest, phdata->bitmap, aSource); 420 } 421 422 return true; 423} 424 425bool CRenderer::CreateTextureData(NGAGE_TextureData *aTextureData, const TInt aWidth, const TInt aHeight) 426{ 427 if (!aTextureData) { 428 return false; 429 } 430 431 aTextureData->bitmap = new CFbsBitmap(); 432 if (!aTextureData->bitmap) { 433 return false; 434 } 435 436 TInt error = aTextureData->bitmap->Create(TSize(aWidth, aHeight), EColor4K); 437 if (error != KErrNone) { 438 delete aTextureData->bitmap; 439 aTextureData->bitmap = NULL; 440 return false; 441 } 442 443 return true; 444} 445 446void CRenderer::DrawLines(NGAGE_Vertex *aVerts, const TInt aCount) 447{ 448 if (iRenderer && iRenderer->Gc()) { 449 TPoint *aPoints = new TPoint[aCount]; 450 451 for (TInt i = 0; i < aCount; i++) { 452 aPoints[i] = TPoint(aVerts[i].x, aVerts[i].y); 453 } 454 455 TUint32 aColor = (((TUint8)aVerts->color.a << 24) | 456 ((TUint8)aVerts->color.b << 16) | 457 ((TUint8)aVerts->color.g << 8) | 458 (TUint8)aVerts->color.r); 459 460 iRenderer->Gc()->SetPenColor(aColor); 461 iRenderer->Gc()->DrawPolyLineNoEndPoint(aPoints, aCount); 462 463 delete[] aPoints; 464 } 465} 466 467void CRenderer::DrawPoints(NGAGE_Vertex *aVerts, const TInt aCount) 468{ 469 if (iRenderer && iRenderer->Gc()) { 470 for (TInt i = 0; i < aCount; i++, aVerts++) { 471 TUint32 aColor = (((TUint8)aVerts->color.a << 24) | 472 ((TUint8)aVerts->color.b << 16) | 473 ((TUint8)aVerts->color.g << 8) | 474 (TUint8)aVerts->color.r); 475 476 iRenderer->Gc()->SetPenColor(aColor); 477 iRenderer->Gc()->Plot(TPoint(aVerts->x, aVerts->y)); 478 } 479 } 480} 481 482void CRenderer::FillRects(NGAGE_Vertex *aVerts, const TInt aCount) 483{ 484 if (iRenderer && iRenderer->Gc()) { 485 for (TInt i = 0; i < aCount; i++, aVerts++) { 486 TPoint pos(aVerts[i].x, aVerts[i].y); 487 TSize size( 488 aVerts[i + 1].x, 489 aVerts[i + 1].y); 490 TRect rect(pos, size); 491 492 TUint32 aColor = (((TUint8)aVerts->color.a << 24) | 493 ((TUint8)aVerts->color.b << 16) | 494 ((TUint8)aVerts->color.g << 8) | 495 (TUint8)aVerts->color.r); 496 497 iRenderer->Gc()->SetPenColor(aColor); 498 iRenderer->Gc()->SetBrushColor(aColor); 499 iRenderer->Gc()->DrawRect(rect); 500 } 501 } 502} 503 504void CRenderer::Flip() 505{ 506 if (!iRenderer) { 507 SDL_Log("iRenderer is NULL."); 508 return; 509 } 510 511 if (!iIsFocused) { 512 return; 513 } 514 515 iRenderer->Gc()->UseFont(iFont); 516 517 if (iShowFPS && iRenderer->Gc()) { 518 UpdateFPS(); 519 520 TBuf<64> info; 521 522 iRenderer->Gc()->SetPenStyle(CGraphicsContext::ESolidPen); 523 iRenderer->Gc()->SetBrushStyle(CGraphicsContext::ENullBrush); 524 iRenderer->Gc()->SetPenColor(KRgbCyan); 525 526 TRect aTextRect(TPoint(3, 203 - iFont->HeightInPixels()), TSize(45, iFont->HeightInPixels() + 2)); 527 iRenderer->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush); 528 iRenderer->Gc()->SetBrushColor(KRgbBlack); 529 iRenderer->Gc()->DrawRect(aTextRect); 530 531 // Draw messages. 532 info.Format(_L("FPS: %d"), iFPS); 533 iRenderer->Gc()->DrawText(info, TPoint(5, 203)); 534 } else { 535 // This is a workaround that helps regulating the FPS. 536 iRenderer->Gc()->DrawText(_L(""), TPoint(0, 0)); 537 } 538 iRenderer->Gc()->DiscardFont(); 539 iRenderer->Flip(iDirectScreen); 540 541 // Keep the backlight on. 542 if (iSuspendScreenSaver) { 543 User::ResetInactivityTime(); 544 } 545 // Suspend the current thread for a short while. 546 // Give some time to other threads and active objects. 547 User::After(0); 548} 549 550void CRenderer::SetDrawColor(TUint32 iColor) 551{ 552 if (iRenderer && iRenderer->Gc()) { 553 iRenderer->Gc()->SetPenColor(iColor); 554 iRenderer->Gc()->SetBrushColor(iColor); 555 iRenderer->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush); 556 557 TRAPD(err, iRenderer->SetCurrentColor(iColor)); 558 if (err != KErrNone) { 559 return; 560 } 561 } 562} 563 564void CRenderer::SetClipRect(TInt aX, TInt aY, TInt aWidth, TInt aHeight) 565{ 566 if (iRenderer && iRenderer->Gc()) { 567 TRect viewportRect(aX, aY, aX + aWidth, aY + aHeight); 568 iRenderer->Gc()->SetClippingRect(viewportRect); 569 } 570} 571 572void CRenderer::UpdateFPS() 573{ 574 static TTime lastTime; 575 static TInt frameCount = 0; 576 TTime currentTime; 577 const TUint KOneSecond = 1000000; // 1s in ms. 578 579 currentTime.HomeTime(); 580 ++frameCount; 581 582 TTimeIntervalMicroSeconds timeDiff = currentTime.MicroSecondsFrom(lastTime); 583 584 if (timeDiff.Int64() >= KOneSecond) { 585 // Calculate FPS. 586 iFPS = frameCount; 587 588 // Reset frame count and last time. 589 frameCount = 0; 590 lastTime = currentTime; 591 } 592} 593 594void CRenderer::SuspendScreenSaver(TBool aSuspend) 595{ 596 iSuspendScreenSaver = aSuspend; 597} 598 599static SDL_Scancode ConvertScancode(int key) 600{ 601 SDL_Keycode keycode; 602 603 switch (key) { 604 case EStdKeyBackspace: // Clear key 605 keycode = SDLK_BACKSPACE; 606 break; 607 case 0x31: // 1 608 keycode = SDLK_1; 609 break; 610 case 0x32: // 2 611 keycode = SDLK_2; 612 break; 613 case 0x33: // 3 614 keycode = SDLK_3; 615 break; 616 case 0x34: // 4 617 keycode = SDLK_4; 618 break; 619 case 0x35: // 5 620 keycode = SDLK_5; 621 break; 622 case 0x36: // 6 623 keycode = SDLK_6; 624 break; 625 case 0x37: // 7 626 keycode = SDLK_7; 627 break; 628 case 0x38: // 8 629 keycode = SDLK_8; 630 break; 631 case 0x39: // 9 632 keycode = SDLK_9; 633 break; 634 case 0x30: // 0 635 keycode = SDLK_0; 636 break; 637 case 0x2a: // Asterisk 638 keycode = SDLK_ASTERISK; 639 break; 640 case EStdKeyHash: // Hash 641 keycode = SDLK_HASH; 642 break; 643 case EStdKeyDevice0: // Left softkey 644 keycode = SDLK_SOFTLEFT; 645 break; 646 case EStdKeyDevice1: // Right softkey 647 keycode = SDLK_SOFTRIGHT; 648 break; 649 case EStdKeyApplication0: // Call softkey 650 keycode = SDLK_CALL; 651 break; 652 case EStdKeyApplication1: // End call softkey 653 keycode = SDLK_ENDCALL; 654 break; 655 case EStdKeyDevice3: // Middle softkey 656 keycode = SDLK_SELECT; 657 break; 658 case EStdKeyUpArrow: // Up arrow 659 keycode = SDLK_UP; 660 break; 661 case EStdKeyDownArrow: // Down arrow 662 keycode = SDLK_DOWN; 663 break; 664 case EStdKeyLeftArrow: // Left arrow 665 keycode = SDLK_LEFT; 666 break; 667 case EStdKeyRightArrow: // Right arrow 668 keycode = SDLK_RIGHT; 669 break; 670 default: 671 keycode = SDLK_UNKNOWN; 672 break; 673 } 674 675 return SDL_GetScancodeFromKey(keycode, NULL); 676} 677 678void CRenderer::HandleEvent(const TWsEvent &aWsEvent) 679{ 680 Uint64 timestamp; 681 682 switch (aWsEvent.Type()) { 683 case EEventKeyDown: /* Key events */ 684 timestamp = SDL_GetPerformanceCounter(); 685 SDL_SendKeyboardKey(timestamp, 1, aWsEvent.Key()->iCode, ConvertScancode(aWsEvent.Key()->iScanCode), true); 686 687 if (aWsEvent.Key()->iScanCode == EStdKeyHash) { 688 if (iShowFPS) { 689 iShowFPS = EFalse; 690 } else { 691 iShowFPS = ETrue; 692 } 693 } 694 695 break; 696 case EEventKeyUp: /* Key events */ 697 timestamp = SDL_GetPerformanceCounter(); 698 SDL_SendKeyboardKey(timestamp, 1, aWsEvent.Key()->iCode, ConvertScancode(aWsEvent.Key()->iScanCode), false); 699 700 case EEventFocusGained: 701 DisableKeyBlocking(); 702 if (!iDirectScreen->IsActive()) { 703 TRAPD(err, iDirectScreen->StartL()); 704 if (KErrNone != err) { 705 return; 706 } 707 iDirectScreen->ScreenDevice()->SetAutoUpdate(ETrue); 708 iIsFocused = ETrue; 709 } 710 Flip(); 711 break; 712 case EEventFocusLost: 713 { 714 if (iDirectScreen->IsActive()) { 715 iDirectScreen->Cancel(); 716 } 717 718 iIsFocused = EFalse; 719 break; 720 } 721 default: 722 break; 723 } 724} 725 726void CRenderer::DisableKeyBlocking() 727{ 728 TRawEvent aEvent; 729 730 aEvent.Set((TRawEvent::TType) /*EDisableKeyBlock*/ 51); 731 iWsSession.SimulateRawEvent(aEvent); 732} 733 734void CRenderer::PumpEvents() 735{ 736 while (iWsEventStatus != KRequestPending) { 737 iWsSession.GetEvent(iWsEvent); 738 HandleEvent(iWsEvent); 739 iWsEventStatus = KRequestPending; 740 iWsSession.EventReady(&iWsEventStatus); 741 } 742} 743 744#endif // SDL_VIDEO_RENDER_NGAGE 745
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.