Mercurial > hg > orthanc-stone
comparison Applications/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewer.cpp @ 1591:5887a4f8594b
moving platform-specific files out of the "OrthancStone" folder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 23 Oct 2020 13:15:03 +0200 |
parents | 4cfdaf4ef3fe |
children | 4fb8fdf03314 |
comparison
equal
deleted
inserted
replaced
1590:7b963bccafef | 1591:5887a4f8594b |
---|---|
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
22 #include "SingleFrameViewerApplication.h" | 22 #include "SingleFrameViewerApplication.h" |
23 | 23 |
24 #include "../../../../OrthancStone/Sources/Loaders/WebAssemblyLoadersContext.h" | |
25 #include "../../../../OrthancStone/Sources/StoneException.h" | 24 #include "../../../../OrthancStone/Sources/StoneException.h" |
26 #include "../../../../OrthancStone/Sources/StoneInitialization.h" | 25 #include "../../../../OrthancStone/Sources/StoneInitialization.h" |
26 #include "../../../Platforms/WebAssembly/WebGLViewport.h" | |
27 #include "../../../Platforms/WebAssembly/WebAssemblyLoadersContext.h" | |
28 #include "../../../Platforms/WebAssembly/WebGLViewportsRegistry.h" | |
27 | 29 |
28 #include <Compatibility.h> // For std::unique_ptr<> | 30 #include <Compatibility.h> // For std::unique_ptr<> |
29 #include <Toolbox.h> | 31 #include <Toolbox.h> |
30 | 32 |
31 #include <emscripten.h> | 33 #include <emscripten.h> |
112 { | 114 { |
113 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls, | 115 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls, |
114 "Only one single viewport is available for this application"); | 116 "Only one single viewport is available for this application"); |
115 } | 117 } |
116 | 118 |
117 boost::shared_ptr<OrthancStone::WebGLViewport> viewport(OrthancStone::GetWebGLViewportsRegistry().Add(canvasId)); | 119 boost::shared_ptr<OrthancStone::WebGLViewport> viewport( |
120 OrthancStone::WebGLViewportsRegistry::GetGlobalRegistry().Add(canvasId)); | |
118 application_ = OrthancStone::Application::Create(*context_, viewport); | 121 application_ = OrthancStone::Application::Create(*context_, viewport); |
119 | 122 |
120 { | 123 { |
121 OrthancStone::WebGLViewportsRegistry::Accessor accessor( | 124 OrthancStone::WebGLViewportsRegistry::Accessor accessor( |
122 OrthancStone::GetWebGLViewportsRegistry(), canvasId); | 125 OrthancStone::WebGLViewportsRegistry::GetGlobalRegistry(), canvasId); |
123 | 126 |
124 if (accessor.IsValid()) | 127 if (accessor.IsValid()) |
125 { | 128 { |
126 accessor.GetViewport().Invalidate(); | 129 accessor.GetViewport().Invalidate(); |
127 } | 130 } |