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
5 #ifndef __C_SDL_MANAGER_H_INCLUDED__
6 #define __C_SDL_MANAGER_H_INCLUDED__
8 #include "IrrCompileConfig.h"
10 #if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && defined(_IRR_COMPILE_WITH_OPENGL_)
12 #include "IContextManager.h"
21 // Manager for SDL with OpenGL
22 class CSDLManager : public IContextManager
25 CSDLManager(CIrrDeviceSDL* device);
27 virtual ~CSDLManager() {}
29 bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
31 void terminate() override {};
32 bool generateSurface() override { return true; };
33 void destroySurface() override {};
34 bool generateContext() override { return true; };
35 void destroyContext() override {};
37 const SExposedVideoData& getContext() const override;
39 bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero=false) override;
41 void* getProcAddress(const std::string &procName) override;
43 bool swapBuffers() override;
46 SExposedVideoData Data;
47 CIrrDeviceSDL *SDLDevice;