~ Initial SDL2 implementation

Limitation
- Dependent projects need to set NAZARA_PLATFORM_SDL2 if nazara has been build with SDL2 since OpenGL.hpp (and maybe some other headers) exposes platform details
- SDL2 window doesn't supports async window since the API isn't fitting for now
- Contexts parameters can't be changed until we close all the SDL windows (SDL limitation)
This commit is contained in:
REMqb
2019-04-03 21:17:06 +02:00
parent ffc58e9806
commit 848f05a420
42 changed files with 2943 additions and 1268 deletions

View File

@@ -78,6 +78,7 @@ namespace Nz
Decimal,
Divide,
Multiply,
NumpadReturn,
Numpad0,
Numpad1,
Numpad2,
@@ -135,6 +136,8 @@ namespace Nz
Space,
Tab,
Tilde,
Menu,
ISOBackslash102,
// Navigator keys
Browser_Back,

View File

@@ -32,12 +32,12 @@ namespace Nz
static const std::vector<VideoMode>& GetFullscreenModes();
};
bool operator==(const VideoMode& left, const VideoMode& right);
bool operator!=(const VideoMode& left, const VideoMode& right);
bool operator<(const VideoMode& left, const VideoMode& right);
bool operator<=(const VideoMode& left, const VideoMode& right);
bool operator>(const VideoMode& left, const VideoMode& right);
bool operator>=(const VideoMode& left, const VideoMode& right);
bool NAZARA_PLATFORM_API operator==(const VideoMode& left, const VideoMode& right);
bool NAZARA_PLATFORM_API operator!=(const VideoMode& left, const VideoMode& right);
bool NAZARA_PLATFORM_API operator<(const VideoMode& left, const VideoMode& right);
bool NAZARA_PLATFORM_API operator<=(const VideoMode& left, const VideoMode& right);
bool NAZARA_PLATFORM_API operator>(const VideoMode& left, const VideoMode& right);
bool NAZARA_PLATFORM_API operator>=(const VideoMode& left, const VideoMode& right);
}
#endif // NAZARA_VIDEOMODE_HPP

View File

@@ -8,13 +8,17 @@
#define NAZARA_WINDOWHANDLE_HPP
#include <Nazara/Prerequisites.hpp>
#if defined(NAZARA_PLATFORM_X11)
#if defined(NAZARA_PLATFORM_SDL2)
#elif defined(NAZARA_PLATFORM_X11)
#include <xcb/xcb.h>
#endif
namespace Nz
{
#if defined(NAZARA_PLATFORM_WINDOWS)
#if defined(NAZARA_PLATFORM_SDL2)
// Real type is SDL_Window
using WindowHandle = void*;
#elif defined(NAZARA_PLATFORM_WINDOWS)
// http://msdn.microsoft.com/en-us/library/aa383751(v=vs.85).aspx
using WindowHandle = void*;
#elif defined(NAZARA_PLATFORM_X11)