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
|
|
|
|
|
|
|
|
#include "CSDLManager.h"
|
|
|
|
|
2023-04-06 12:07:53 +02:00
|
|
|
#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
|
2022-05-21 15:19:57 +02:00
|
|
|
|
|
|
|
#include "CIrrDeviceSDL.h"
|
|
|
|
#include "COpenGLCommon.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace video
|
|
|
|
{
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
CSDLManager::CSDLManager(CIrrDeviceSDL *device) :
|
|
|
|
IContextManager(), SDLDevice(device)
|
2022-05-21 15:19:57 +02:00
|
|
|
{
|
2024-03-20 19:35:52 +01:00
|
|
|
#ifdef _DEBUG
|
2022-05-21 15:19:57 +02:00
|
|
|
setDebugName("CSDLManager");
|
2024-03-20 19:35:52 +01:00
|
|
|
#endif
|
2022-05-21 15:19:57 +02:00
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
bool CSDLManager::initialize(const SIrrlichtCreationParameters ¶ms, const SExposedVideoData &data)
|
2022-05-21 15:19:57 +02:00
|
|
|
{
|
|
|
|
Data = data;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
const SExposedVideoData &CSDLManager::getContext() const
|
2022-05-21 15:19:57 +02:00
|
|
|
{
|
|
|
|
return Data;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
bool CSDLManager::activateContext(const SExposedVideoData &videoData, bool restorePrimaryOnZero)
|
2022-05-21 15:19:57 +02:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
void *CSDLManager::getProcAddress(const std::string &procName)
|
2022-05-21 15:19:57 +02:00
|
|
|
{
|
|
|
|
return SDL_GL_GetProcAddress(procName.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CSDLManager::swapBuffers()
|
|
|
|
{
|
|
|
|
SDLDevice->SwapWindow();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|