comparison Samples/Sdl/TrackerSampleApp.cpp @ 938:eaaa9b574e05 toa2019073101

Fixed the Stone samples wrt the recent API changes (SdlOpenGLViewport, ICompositor...)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 31 Jul 2019 10:58:16 +0200
parents f9ae731fdc25
children efc5b62b9539
comparison
equal deleted inserted replaced
937:86ac61a040c9 938:eaaa9b574e05
639 } 639 }
640 } 640 }
641 641
642 static bool g_stopApplication = false; 642 static bool g_stopApplication = false;
643 643
644 OpenGLCompositor& TrackerSampleApp::GetCompositor() 644 ICompositor& TrackerSampleApp::GetCompositor()
645 { 645 {
646 using namespace Orthanc; 646 using namespace Orthanc;
647 try 647 try
648 { 648 {
649 SdlViewport& viewport = dynamic_cast<SdlViewport&>(viewport_); 649 SdlViewport& viewport = dynamic_cast<SdlViewport&>(viewport_);
653 { 653 {
654 throw OrthancException(ErrorCode_InternalError, "Wrong viewport type!"); 654 throw OrthancException(ErrorCode_InternalError, "Wrong viewport type!");
655 } 655 }
656 } 656 }
657 657
658 const OpenGLCompositor& TrackerSampleApp::GetCompositor() const 658 const ICompositor& TrackerSampleApp::GetCompositor() const
659 { 659 {
660 using namespace Orthanc; 660 using namespace Orthanc;
661 try 661 try
662 { 662 {
663 SdlViewport& viewport = const_cast<SdlViewport&>(dynamic_cast<const SdlViewport&>(viewport_)); 663 SdlViewport& viewport = const_cast<SdlViewport&>(dynamic_cast<const SdlViewport&>(viewport_));
703 event.key.repeat == 0 /* Ignore key bounce */) 703 event.key.repeat == 0 /* Ignore key bounce */)
704 { 704 {
705 switch (event.key.keysym.sym) 705 switch (event.key.keysym.sym)
706 { 706 {
707 case SDLK_f: 707 case SDLK_f:
708 viewport_.GetContext().GetWindow().ToggleMaximize(); 708 viewport_.GetWindow().ToggleMaximize();
709 break; 709 break;
710 710
711 case SDLK_q: 711 case SDLK_q:
712 g_stopApplication = true; 712 g_stopApplication = true;
713 break; 713 break;