aboutsummaryrefslogtreecommitdiff
path: root/include/IContextManager.h
diff options
context:
space:
mode:
authorcutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>2020-01-03 19:05:16 +0000
committercutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>2020-01-03 19:05:16 +0000
commit2ae2a551a6290f46734307bbfdafea4b1a2cf2ba (patch)
treeba2f0b468640e44899fed3df2d4cc58795f4a003 /include/IContextManager.h
downloadirrlicht-2ae2a551a6290f46734307bbfdafea4b1a2cf2ba.tar.xz
Merging r5975 through r6036 from trunk to ogl-es branch.
GLES drivers adapted, but only did make compile-tests. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6038 dfc29bdd-3216-0410-991c-e03cc46cb475
Diffstat (limited to 'include/IContextManager.h')
-rw-r--r--include/IContextManager.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/include/IContextManager.h b/include/IContextManager.h
new file mode 100644
index 0000000..1937190
--- /dev/null
+++ b/include/IContextManager.h
@@ -0,0 +1,59 @@
+// Copyright (C) 2013-2015 Patryk Nadrowski
+// This file is part of the "Irrlicht Engine".
+// For conditions of distribution and use, see copyright notice in irrlicht.h
+
+#ifndef __IRR_I_CONTEXT_MANAGER_H_INCLUDED__
+#define __IRR_I_CONTEXT_MANAGER_H_INCLUDED__
+
+#include "SExposedVideoData.h"
+#include "SIrrCreationParameters.h"
+
+namespace irr
+{
+namespace video
+{
+ // For system specific window contexts (used for OpenGL)
+ class IContextManager : public virtual IReferenceCounted
+ {
+ public:
+ //! Initialize manager with device creation parameters and device window (passed as exposed video data)
+ virtual bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) =0;
+
+ //! Terminate manager, any cleanup that is left over. Manager needs a new initialize to be usable again
+ virtual void terminate() =0;
+
+ //! Create surface based on current window set
+ virtual bool generateSurface() =0;
+
+ //! Destroy current surface
+ virtual void destroySurface() =0;
+
+ //! Create context based on current surface
+ virtual bool generateContext() =0;
+
+ //! Destroy current context
+ virtual void destroyContext() =0;
+
+ //! Get current context
+ virtual const SExposedVideoData& getContext() const =0;
+
+ //! Change render context, disable old and activate new defined by videoData
+ //\param restorePrimaryOnZero When true: restore original driver context when videoData is set to 0 values.
+ // When false: resets the context when videoData is set to 0 values.
+ /** This is mostly used internally by IVideoDriver::beginScene().
+ But if you want to switch threads which access your OpenGL driver you will have to
+ call this function as follows:
+ Old thread gives up context with: activateContext(irr::video::SExposedVideoData());
+ New thread takes over context with: activateContext(videoDriver->getExposedVideoData());
+ Note that only 1 thread at a time may access an OpenGL context. */
+ virtual bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero=false) =0;
+
+ //! Swap buffers.
+ virtual bool swapBuffers() =0;
+ };
+
+} // end namespace video
+} // end namespace irr
+
+
+#endif