2022-05-21 15:19:57 +02:00
|
|
|
// Copyright (C) 2022 sfan5
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in Irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __C_SDL_MANAGER_H_INCLUDED__
|
|
|
|
#define __C_SDL_MANAGER_H_INCLUDED__
|
|
|
|
|
|
|
|
|
2023-04-06 12:07:53 +02:00
|
|
|
#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
|
2022-05-21 15:19:57 +02:00
|
|
|
|
|
|
|
#include "IContextManager.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
class CIrrDeviceSDL;
|
|
|
|
|
|
|
|
namespace video
|
|
|
|
{
|
|
|
|
|
|
|
|
// Manager for SDL with OpenGL
|
|
|
|
class CSDLManager : public IContextManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSDLManager(CIrrDeviceSDL* device);
|
|
|
|
|
|
|
|
virtual ~CSDLManager() {}
|
|
|
|
|
2022-10-09 20:57:28 +02:00
|
|
|
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2022-10-09 20:57:28 +02:00
|
|
|
void terminate() override {};
|
|
|
|
bool generateSurface() override { return true; };
|
|
|
|
void destroySurface() override {};
|
|
|
|
bool generateContext() override { return true; };
|
|
|
|
void destroyContext() override {};
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2022-10-09 20:57:28 +02:00
|
|
|
const SExposedVideoData& getContext() const override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2022-10-09 20:57:28 +02:00
|
|
|
bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero=false) override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2022-10-09 20:57:28 +02:00
|
|
|
void* getProcAddress(const std::string &procName) override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2022-10-09 20:57:28 +02:00
|
|
|
bool swapBuffers() override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
SExposedVideoData Data;
|
|
|
|
CIrrDeviceSDL *SDLDevice;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|