Add scancode and virtual key and fix some sdl stuff on Windows
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
#if defined(NAZARA_PLATFORM_SDL2)
|
||||
#include <Nazara/Renderer/SDL2/ContextImpl.hpp>
|
||||
#define CALLBACK
|
||||
#elif defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Renderer/Win32/ContextImpl.hpp>
|
||||
#elif defined(NAZARA_PLATFORM_GLX)
|
||||
|
||||
@@ -1045,8 +1045,7 @@ namespace Nz
|
||||
glInvalidateBufferData = reinterpret_cast<PFNGLINVALIDATEBUFFERDATAPROC>(LoadEntry("glInvalidateBufferData", false));
|
||||
glVertexAttribLPointer = reinterpret_cast<PFNGLVERTEXATTRIBLPOINTERPROC>(LoadEntry("glVertexAttribLPointer", false));
|
||||
|
||||
#if defined(NAZARA_PLATFORM_SDL2)
|
||||
#elif defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
wglGetExtensionsStringARB = reinterpret_cast<PFNWGLGETEXTENSIONSSTRINGARBPROC>(LoadEntry("wglGetExtensionsStringARB", false));
|
||||
wglGetExtensionsStringEXT = reinterpret_cast<PFNWGLGETEXTENSIONSSTRINGEXTPROC>(LoadEntry("wglGetExtensionsStringEXT", false));
|
||||
wglSwapInterval = reinterpret_cast<PFNWGLSWAPINTERVALEXTPROC>(LoadEntry("wglSwapIntervalEXT", false));
|
||||
@@ -1064,7 +1063,7 @@ namespace Nz
|
||||
NazaraWarning("Failed to load extension system");
|
||||
}
|
||||
|
||||
#ifdef NAZARA_PLATFORM_WINDOWS
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS) && !defined(NAZARA_PLATFORM_SDL2)
|
||||
{
|
||||
bool loaded;
|
||||
if (wglGetExtensionsStringARB)
|
||||
@@ -1247,7 +1246,11 @@ namespace Nz
|
||||
|
||||
bool OpenGL::IsSupported(const String& string)
|
||||
{
|
||||
#ifdef NAZARA_PLATFORM_SDL2
|
||||
return SDL_GL_ExtensionSupported(string.GetConstBuffer());
|
||||
#else
|
||||
return s_openGLextensionSet.find(string) != s_openGLextensionSet.end();
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenGL::SetBuffer(BufferType type, GLuint id)
|
||||
@@ -2302,8 +2305,7 @@ namespace Nz
|
||||
PFNGLVERTEXATTRIBLPOINTERPROC glVertexAttribLPointer = nullptr;
|
||||
PFNGLVIEWPORTPROC glViewport = nullptr;
|
||||
|
||||
#if defined(NAZARA_PLATFORM_SDL2)
|
||||
#elif defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormat = nullptr;
|
||||
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribs = nullptr;
|
||||
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = nullptr;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
// Code inspiré de NeHe (Lesson1) et de la SFML par Laurent Gomila
|
||||
|
||||
#include <cstring>
|
||||
#include <Nazara/Core/CallOnExit.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Core/LockGuard.hpp>
|
||||
@@ -13,6 +12,9 @@
|
||||
#include <Nazara/Renderer/Debug.hpp>
|
||||
#include <Nazara/Renderer/OpenGL.hpp>
|
||||
#include <Nazara/Renderer/SDL2/ContextImpl.hpp>
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
ContextImpl::ContextImpl()
|
||||
|
||||
Reference in New Issue
Block a user