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
|
|
|
|
|
2023-06-25 21:15:14 +02:00
|
|
|
#pragma once
|
2022-05-21 15:19:57 +02:00
|
|
|
|
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
|
|
|
|
{
|
2024-03-20 19:35:52 +01:00
|
|
|
class CIrrDeviceSDL;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
|
|
|
namespace video
|
|
|
|
{
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
// Manager for SDL with OpenGL
|
|
|
|
class CSDLManager : public IContextManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSDLManager(CIrrDeviceSDL *device);
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
virtual ~CSDLManager() {}
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
bool initialize(const SIrrlichtCreationParameters ¶ms, const SExposedVideoData &data) override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2024-03-20 19:35:52 +01: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
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
const SExposedVideoData &getContext() const override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
bool activateContext(const SExposedVideoData &videoData, bool restorePrimaryOnZero = false) override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
void *getProcAddress(const std::string &procName) override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
bool swapBuffers() override;
|
2022-05-21 15:19:57 +02:00
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
private:
|
|
|
|
SExposedVideoData Data;
|
|
|
|
CIrrDeviceSDL *SDLDevice;
|
|
|
|
};
|
2022-05-21 15:19:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|