changeset 324:29a79b8c3d39 am-2

fix SDL build
author am@osimis.io
date Tue, 16 Oct 2018 08:59:23 +0200
parents dbfe2e9e5020
children 37ab9d83dc9b
files Applications/Samples/CMakeLists.txt Applications/Sdl/SdlCairoSurface.cpp
diffstat 2 files changed, 28 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/CMakeLists.txt	Mon Oct 15 23:36:43 2018 +0200
+++ b/Applications/Samples/CMakeLists.txt	Tue Oct 16 08:59:23 2018 +0200
@@ -130,32 +130,35 @@
 #BuildSingleFileSample(OrthancStoneLayoutPetCtFusion 7)
 BuildSingleFileSample(OrthancStoneSimpleViewerSingleFile SimpleViewerApplicationSingleFile.h 8)  # we keep that one just as a sample before we convert another sample to this pattern
 
-##### SimpleViewer sample #######
+##### SimpleViewer sample (Qt and WASM only) #######
+
+if (ENABLE_QT OR ENABLE_WASM)
 
-if (ENABLE_QT)
-  list(APPEND SIMPLE_VIEWER_APPLICATION_SOURCES
-    ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.cpp
-    ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.ui
-    ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/mainQt.cpp
-    )
-elseif (ENABLE_WASM)
-    list(APPEND SIMPLE_VIEWER_APPLICATION_SOURCES
-        ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Wasm/mainWasm.cpp
-        ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Wasm/SimpleViewerWasmApplicationAdapter.cpp
-        ${STONE_WASM_SOURCES}
+    if (ENABLE_QT)
+      list(APPEND SIMPLE_VIEWER_APPLICATION_SOURCES
+        ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.cpp
+        ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.ui
+        ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/mainQt.cpp
+        )
+    elseif (ENABLE_WASM)
+        list(APPEND SIMPLE_VIEWER_APPLICATION_SOURCES
+            ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Wasm/mainWasm.cpp
+            ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Wasm/SimpleViewerWasmApplicationAdapter.cpp
+            ${STONE_WASM_SOURCES}
+          )
+    endif()
+
+    add_executable(OrthancStoneSimpleViewer
+      ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp
+      ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/ThumbnailInteractor.cpp
+      ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/MainWidgetInteractor.cpp
+      ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/AppStatus.h
+      ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Messages.h
+      ${SIMPLE_VIEWER_APPLICATION_SOURCES}
       )
-endif()
+    target_link_libraries(OrthancStoneSimpleViewer OrthancStone)
 
-add_executable(OrthancStoneSimpleViewer
-  ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp
-  ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/ThumbnailInteractor.cpp
-  ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/MainWidgetInteractor.cpp
-  ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/AppStatus.h
-  ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Messages.h
-  ${SIMPLE_VIEWER_APPLICATION_SOURCES}
-  )
-target_link_libraries(OrthancStoneSimpleViewer OrthancStone)
-
+endif()
 
 #####################################################################
 ## Build the unit tests
--- a/Applications/Sdl/SdlCairoSurface.cpp	Mon Oct 15 23:36:43 2018 +0200
+++ b/Applications/Sdl/SdlCairoSurface.cpp	Tue Oct 16 08:59:23 2018 +0200
@@ -81,7 +81,8 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
     }
 
-    Orthanc::ImageAccessor target = cairoSurface_->GetAccessor();
+    Orthanc::ImageAccessor target;
+    cairoSurface_->GetAccessor(target);
 
     if (viewport.Render(target))
     {