comparison Framework/OpenGL/WebAssemblyOpenGLContext.h @ 1051:7fad86d62135

removed unused abstraction IOpenGLContextLossMonitor
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Oct 2019 14:37:07 +0200
parents 6a9300ecfa13
children 2d8ab34c8c91
comparison
equal deleted inserted replaced
1050:d393ad9cf68c 1051:7fad86d62135
36 #if ORTHANC_ENABLE_OPENGL != 1 36 #if ORTHANC_ENABLE_OPENGL != 1
37 # error Support for OpenGL is disabled 37 # error Support for OpenGL is disabled
38 #endif 38 #endif
39 39
40 #include "IOpenGLContext.h" 40 #include "IOpenGLContext.h"
41 #include "IOpenGLContextLossMonitor.h"
42 41
43 #include <Core/Enumerations.h> 42 #include <Core/Enumerations.h>
44 43
45 #include <boost/shared_ptr.hpp> 44 #include <boost/shared_ptr.hpp>
46 45
47 namespace OrthancStone 46 namespace OrthancStone
48 { 47 {
49 namespace OpenGL 48 namespace OpenGL
50 { 49 {
51 class WebAssemblyOpenGLContext : 50 class WebAssemblyOpenGLContext : public OpenGL::IOpenGLContext
52 public OpenGL::IOpenGLContext,
53 public OpenGL::IOpenGLContextLossMonitor
54 { 51 {
55 private: 52 private:
56 class PImpl; 53 class PImpl;
57 boost::shared_ptr<PImpl> pimpl_; 54 boost::shared_ptr<PImpl> pimpl_;
58 55
59 public: 56 public:
60 WebAssemblyOpenGLContext(const std::string& canvas); 57 WebAssemblyOpenGLContext(const std::string& canvas);
61 58
62 virtual bool IsContextLost() ORTHANC_OVERRIDE; 59 virtual bool IsContextLost() ORTHANC_OVERRIDE;
63 60
64 virtual void SetLostContext() ORTHANC_OVERRIDE;
65 virtual void RestoreLostContext() ORTHANC_OVERRIDE;
66
67 virtual void MakeCurrent() ORTHANC_OVERRIDE; 61 virtual void MakeCurrent() ORTHANC_OVERRIDE;
68 62
69 virtual void SwapBuffer() ORTHANC_OVERRIDE; 63 virtual void SwapBuffer() ORTHANC_OVERRIDE;
70 64
71 virtual unsigned int GetCanvasWidth() const ORTHANC_OVERRIDE; 65 virtual unsigned int GetCanvasWidth() const ORTHANC_OVERRIDE;
72 66
73 virtual unsigned int GetCanvasHeight() const ORTHANC_OVERRIDE; 67 virtual unsigned int GetCanvasHeight() const ORTHANC_OVERRIDE;
74
75 virtual void* DebugGetInternalContext() const ORTHANC_OVERRIDE;
76 68
77 /** 69 /**
78 Returns true if the underlying context has been successfully recreated 70 Returns true if the underlying context has been successfully recreated
79 */ 71 */
80 //bool TryRecreate(); 72 //bool TryRecreate();
81 73
82 void UpdateSize(); 74 void UpdateSize();
83 75
84 const std::string& GetCanvasIdentifier() const; 76 const std::string& GetCanvasIdentifier() const;
77
78
79 /**
80 * This is for manual context loss (debug purposes)
81 **/
82 void* DebugGetInternalContext() const;
83 void SetLostContext();
85 }; 84 };
86 } 85 }
87 } 86 }