comparison Framework/OpenGL/WebAssemblyOpenGLContext.h @ 947:1091b2adeb5a toa2019081001

Fixed animation frame stopping when returning false + big work on the OpenGL objects to make them lost context-safe + debug code to forcefully tag a context as lost + debug macros
author Benjamin Golinvaux <bgo@osimis.io>
date Sat, 10 Aug 2019 13:07:31 +0200
parents 0aff28f15ea2
children a7351ad54960
comparison
equal deleted inserted replaced
946:dbe3e1e47019 947:1091b2adeb5a
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 41
42 #include <Core/Enumerations.h>
43
42 #include <boost/shared_ptr.hpp> 44 #include <boost/shared_ptr.hpp>
43 45
44 namespace OrthancStone 46 namespace OrthancStone
45 { 47 {
46 namespace OpenGL 48 namespace OpenGL
52 boost::shared_ptr<PImpl> pimpl_; 54 boost::shared_ptr<PImpl> pimpl_;
53 55
54 public: 56 public:
55 WebAssemblyOpenGLContext(const std::string& canvas); 57 WebAssemblyOpenGLContext(const std::string& canvas);
56 58
57 virtual void MakeCurrent(); 59 virtual bool IsContextLost() const ORTHANC_OVERRIDE;
58 60
59 virtual void SwapBuffer(); 61 virtual void SetLostContext() ORTHANC_OVERRIDE;
62 virtual void RestoreLostContext() ORTHANC_OVERRIDE;
60 63
61 virtual unsigned int GetCanvasWidth() const; 64 virtual void MakeCurrent() ORTHANC_OVERRIDE;
62 65
63 virtual unsigned int GetCanvasHeight() const; 66 virtual void SwapBuffer() ORTHANC_OVERRIDE;
67
68 virtual unsigned int GetCanvasWidth() const ORTHANC_OVERRIDE;
69
70 virtual unsigned int GetCanvasHeight() const ORTHANC_OVERRIDE;
71
72 virtual void* DebugGetInternalContext() const ORTHANC_OVERRIDE;
64 73
65 void UpdateSize(); 74 void UpdateSize();
66 75
67 const std::string& GetCanvasIdentifier() const; 76 const std::string& GetCanvasIdentifier() const;
68 }; 77 };