Mercurial > hg > orthanc-stone
comparison Applications/Generic/GuiAdapter.cpp @ 937:86ac61a040c9
Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 31 Jul 2019 10:24:09 +0200 |
parents | 912cc77be3b4 |
children | 1091b2adeb5a |
comparison
equal
deleted
inserted
replaced
936:775ebd43bd3b | 937:86ac61a040c9 |
---|---|
49 "alt: " << event.altKey; | 49 "alt: " << event.altKey; |
50 return os; | 50 return os; |
51 } | 51 } |
52 | 52 |
53 #if ORTHANC_ENABLE_WASM == 1 | 53 #if ORTHANC_ENABLE_WASM == 1 |
54 void GuiAdapter::Run() | 54 void GuiAdapter::Run(GuiAdapterRunFunc /*func*/, void* /*cookie*/) |
55 { | 55 { |
56 } | 56 } |
57 | 57 |
58 void ConvertFromPlatform( | 58 void ConvertFromPlatform( |
59 GuiAdapterUiEvent& dest, | 59 GuiAdapterUiEvent& dest, |
721 } | 721 } |
722 } | 722 } |
723 # endif | 723 # endif |
724 | 724 |
725 // SDL ONLY | 725 // SDL ONLY |
726 void GuiAdapter::Run() | 726 void GuiAdapter::Run(GuiAdapterRunFunc func, void* cookie) |
727 { | 727 { |
728 #if 1 | 728 #if 1 |
729 // TODO: MAKE THIS DYNAMIC !!! See SdlOpenGLViewport vs Cairo in ViewportWrapper | 729 // TODO: MAKE THIS DYNAMIC !!! See SdlOpenGLViewport vs Cairo in ViewportWrapper |
730 # if ORTHANC_ENABLE_OPENGL == 1 && !defined(__APPLE__) | 730 # if ORTHANC_ENABLE_OPENGL == 1 && !defined(__APPLE__) |
731 glEnable(GL_DEBUG_OUTPUT); | 731 glEnable(GL_DEBUG_OUTPUT); |
739 bool stop = false; | 739 bool stop = false; |
740 while (!stop) | 740 while (!stop) |
741 { | 741 { |
742 { | 742 { |
743 LockingEmitter::WriterLock lock(lockingEmitter_); | 743 LockingEmitter::WriterLock lock(lockingEmitter_); |
744 if(func != NULL) | |
745 (*func)(cookie); | |
744 OnAnimationFrame(); // in SDL we must call it | 746 OnAnimationFrame(); // in SDL we must call it |
745 } | 747 } |
746 | 748 |
747 SDL_Event event; | 749 SDL_Event event; |
748 | 750 |