Merge branch 'master' into NDK

Conflicts:
	build/scripts/module/renderer.lua
	build/scripts/module/utility.lua
	include/Nazara/Renderer/OpenGL.hpp
	src/Nazara/Core/String.cpp

Former-commit-id: 0a8054be56f01b12c604c88b829cb10b490a9d6f
This commit is contained in:
Lynix
2015-09-20 23:41:21 +02:00
45 changed files with 3702 additions and 70 deletions

View File

@@ -13,13 +13,15 @@
#include <stdexcept>
#include <Nazara/Renderer/Debug.hpp>
NzRenderWindow::NzRenderWindow(NzVideoMode mode, const NzString& title, nzUInt32 style, const NzContextParameters& parameters)
NzRenderWindow::NzRenderWindow(NzVideoMode mode, const NzString& title, nzUInt32 style, const NzContextParameters& parameters) :
NzRenderTarget(), NzWindow()
{
NzErrorFlags flags(nzErrorFlag_ThrowException, true);
Create(mode, title, style, parameters);
}
NzRenderWindow::NzRenderWindow(NzWindowHandle handle, const NzContextParameters& parameters)
NzRenderWindow::NzRenderWindow(NzWindowHandle handle, const NzContextParameters& parameters) :
NzRenderTarget(), NzWindow()
{
NzErrorFlags flags(nzErrorFlag_ThrowException, true);
Create(handle, parameters);
@@ -149,30 +151,13 @@ void NzRenderWindow::EnableVerticalSync(bool enabled)
{
if (m_context)
{
#if defined(NAZARA_PLATFORM_WINDOWS)
if (!m_context->SetActive(true))
{
NazaraError("Failed to activate context");
return;
}
if (wglSwapInterval)
wglSwapInterval(enabled ? 1 : 0);
else
#elif defined(NAZARA_PLATFORM_LINUX)
if (!m_context->SetActive(true))
{
NazaraError("Failed to activate context");
return;
}
if (glXSwapInterval)
glXSwapInterval(enabled ? 1 : 0);
else
#else
#error Vertical Sync is not supported on this platform
#endif
NazaraError("Vertical Sync is not supported on this platform");
m_context->EnableVerticalSync(enabled);
}
else
NazaraError("No context");