]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CSDLManager.h
6b0f254db59970f586a0a7a6d9985ab0a6c029ed
[irrlicht.git] / source / Irrlicht / CSDLManager.h
1 // Copyright (C) 2022 sfan5
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in Irrlicht.h
4
5 #ifndef __C_SDL_MANAGER_H_INCLUDED__
6 #define __C_SDL_MANAGER_H_INCLUDED__
7
8 #include "IrrCompileConfig.h"
9
10 #if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && defined(_IRR_COMPILE_WITH_OPENGL_)
11
12 #include "IContextManager.h"
13
14 namespace irr
15 {
16         class CIrrDeviceSDL;
17
18 namespace video
19 {
20
21         // Manager for SDL with OpenGL
22         class CSDLManager : public IContextManager
23         {
24         public:
25                 CSDLManager(CIrrDeviceSDL* device);
26
27                 virtual ~CSDLManager() {}
28
29                 bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
30
31                 void terminate() override {};
32                 bool generateSurface() override { return true; };
33                 void destroySurface() override {};
34                 bool generateContext() override { return true; };
35                 void destroyContext() override {};
36
37                 const SExposedVideoData& getContext() const override;
38
39                 bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero=false) override;
40
41                 void* getProcAddress(const std::string &procName) override;
42
43                 bool swapBuffers() override;
44
45         private:
46                 SExposedVideoData Data;
47                 CIrrDeviceSDL *SDLDevice;
48         };
49 }
50 }
51
52 #endif
53 #endif