comparison Framework/Viewport/SdlViewport.cpp @ 1053:32b403a47b19

simplifying IViewport
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Oct 2019 15:24:48 +0200
parents 6a9300ecfa13
children af456106576c
comparison
equal deleted inserted replaced
1052:0cc62db7e61b 1053:32b403a47b19
47 compositor_.reset(new OpenGLCompositor(context_, GetScene())); 47 compositor_.reset(new OpenGLCompositor(context_, GetScene()));
48 } 48 }
49 49
50 void SdlOpenGLViewport::Refresh() 50 void SdlOpenGLViewport::Refresh()
51 { 51 {
52 if (GetCompositor()) 52 compositor_->Refresh();
53 {
54 GetCompositor()->Refresh();
55 }
56 } 53 }
57 54
58 55
59 SdlCairoViewport::SdlCairoViewport(const char* title, 56 SdlCairoViewport::SdlCairoViewport(const char* title,
60 unsigned int width, 57 unsigned int width,
75 } 72 }
76 } 73 }
77 74
78 void SdlCairoViewport::Refresh() 75 void SdlCairoViewport::Refresh()
79 { 76 {
80 GetCompositor()->Refresh(); 77 compositor_.Refresh();
81 window_.Render(sdlSurface_); 78 window_.Render(sdlSurface_);
82 } 79 }
83 80
84 void SdlCairoViewport::UpdateSize(unsigned int width, 81 void SdlCairoViewport::UpdateSize(unsigned int width,
85 unsigned int height) 82 unsigned int height)
102 { 99 {
103 LOG(ERROR) << "Cannot create a SDL surface from a Cairo surface"; 100 LOG(ERROR) << "Cannot create a SDL surface from a Cairo surface";
104 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 101 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
105 } 102 }
106 } 103 }
107
108 } 104 }