]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CSDLManager.cpp
Fix OpenGL3 driver to compile standalone
[irrlicht.git] / source / Irrlicht / CSDLManager.cpp
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 #include "CSDLManager.h"
6
7 #if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
8
9 #include "CIrrDeviceSDL.h"
10 #include "COpenGLCommon.h"
11
12 namespace irr
13 {
14 namespace video
15 {
16
17 CSDLManager::CSDLManager(CIrrDeviceSDL* device) : IContextManager(), SDLDevice(device)
18 {
19         #ifdef _DEBUG
20         setDebugName("CSDLManager");
21         #endif
22 }
23
24 bool CSDLManager::initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data)
25 {
26         Data = data;
27         return true;
28 }
29
30 const SExposedVideoData& CSDLManager::getContext() const
31 {
32         return Data;
33 }
34
35 bool CSDLManager::activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero)
36 {
37         return true;
38 }
39
40 void* CSDLManager::getProcAddress(const std::string &procName)
41 {
42         return SDL_GL_GetProcAddress(procName.c_str());
43 }
44
45 bool CSDLManager::swapBuffers()
46 {
47         SDLDevice->SwapWindow();
48         return true;
49 }
50
51 }
52 }
53
54 #endif