Mercurial > hg > orthanc-stone
comparison Applications/Sdl/SdlOpenGLContext.h @ 1045:6a9300ecfa13
tests for context loss are now restricted to WebAssembly
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Oct 2019 17:17:56 +0200 |
parents | a7351ad54960 |
children |
comparison
equal
deleted
inserted
replaced
1044:b60d70e8b55c | 1045:6a9300ecfa13 |
---|---|
33 class SdlOpenGLContext : public OpenGL::IOpenGLContext | 33 class SdlOpenGLContext : public OpenGL::IOpenGLContext |
34 { | 34 { |
35 private: | 35 private: |
36 SdlWindow window_; | 36 SdlWindow window_; |
37 SDL_GLContext context_; | 37 SDL_GLContext context_; |
38 bool contextLost_; | |
39 | 38 |
40 public: | 39 public: |
41 SdlOpenGLContext(const char* title, | 40 SdlOpenGLContext(const char* title, |
42 unsigned int width, | 41 unsigned int width, |
43 unsigned int height, | 42 unsigned int height, |
48 SdlWindow& GetWindow() | 47 SdlWindow& GetWindow() |
49 { | 48 { |
50 return window_; | 49 return window_; |
51 } | 50 } |
52 | 51 |
53 virtual bool IsContextLost() ORTHANC_OVERRIDE; | 52 virtual bool IsContextLost() ORTHANC_OVERRIDE |
54 | 53 { |
55 virtual void SetLostContext() ORTHANC_OVERRIDE; | 54 // On desktop applications, an OpenGL context should never be lost |
56 virtual void RestoreLostContext() ORTHANC_OVERRIDE; | 55 return false; |
56 } | |
57 | 57 |
58 virtual void MakeCurrent() ORTHANC_OVERRIDE; | 58 virtual void MakeCurrent() ORTHANC_OVERRIDE; |
59 | 59 |
60 virtual void SwapBuffer() ORTHANC_OVERRIDE; | 60 virtual void SwapBuffer() ORTHANC_OVERRIDE; |
61 | 61 |
62 virtual unsigned int GetCanvasWidth() const ORTHANC_OVERRIDE; | 62 virtual unsigned int GetCanvasWidth() const ORTHANC_OVERRIDE; |
63 | 63 |
64 virtual unsigned int GetCanvasHeight() const ORTHANC_OVERRIDE; | 64 virtual unsigned int GetCanvasHeight() const ORTHANC_OVERRIDE; |
65 | |
66 virtual void* DebugGetInternalContext() const ORTHANC_OVERRIDE | |
67 { | |
68 return context_; | |
69 } | |
70 }; | 65 }; |
71 } | 66 } |
72 | 67 |
73 #endif | 68 #endif |