New module: Platform - Split window management from Utility module (#128)

* New module: Platform - Split window management from Utility module

Final touch

* NDK/SDK: Bring back initialization of Utility
This commit is contained in:
Gawaboumga 2017-08-30 10:22:50 +02:00 committed by Jérôme Leclercq
parent 41a1b5d493
commit 5aa072cee3
126 changed files with 1068 additions and 801 deletions

View File

@ -27,17 +27,17 @@
#ifndef NAZARA_CONFIG_MODULENAME_HPP
#define NAZARA_CONFIG_MODULENAME_HPP
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
/// Each modification of a parameter needs a recompilation of the module
// Utilise le MemoryManager pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
// Use the MemoryManager to manage dynamic allocations (can detect memory leak but allocations/frees are slower)
#define NAZARA_MODULENAME_MANAGE_MEMORY 0
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
// Activate the security tests based on the code (Advised for development)
#define NAZARA_MODULENAME_SAFE 1
/// Chaque modification d'un paramètre ci-dessous implique une modification (souvent mineure) du code
/// Each modification of a parameter following implies a modification (often minor) of the code
/// Vérification des valeurs et types de certaines constantes
/// Checking the values and types of certain constants
#include <Nazara/ModuleName/ConfigCheck.hpp>
#if !defined(NAZARA_STATIC)

View File

@ -7,13 +7,13 @@
#ifndef NAZARA_CONFIG_CHECK_MODULENAME_HPP
#define NAZARA_CONFIG_CHECK_MODULENAME_HPP
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
/// This file is used to check the constant values defined in Config.hpp
#include <type_traits>
#define CheckType(name, type, err) static_assert(std::is_ ##type <decltype(name)>::value, #type err)
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
// On force la valeur de MANAGE_MEMORY en mode debug
// We force the value of MANAGE_MEMORY in debug
#if defined(NAZARA_DEBUG) && !NAZARA_MODULENAME_MANAGE_MEMORY
#undef NAZARA_MODULENAME_MANAGE_MEMORY
#define NAZARA_MODULENAME_MANAGE_MEMORY 0

View File

@ -2,7 +2,7 @@
// This file is part of the "Nazara Engine - Module name"
// For conditions of distribution and use, see copyright notice in Config.hpp
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
// We suppose that Debug.hpp is already included, same goes for Config.hpp
#if NAZARA_MODULENAME_MANAGE_MEMORY
#undef delete
#undef new

View File

@ -22,7 +22,7 @@
#include <Nazara/Lua/LuaInstance.hpp>
#include <Nazara/Graphics/TextSprite.hpp>
#include <Nazara/Renderer/RenderTarget.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Platform/Window.hpp>
#endif
namespace Ndk

View File

@ -12,9 +12,9 @@
#include <NDK/EntityOwner.hpp>
#include <NDK/World.hpp>
#include <Nazara/Graphics/Sprite.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Utility/Event.hpp>
#include <Nazara/Utility/Mouse.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/Event.hpp>
#include <Nazara/Platform/Mouse.hpp>
#include <Nazara/Utility/Node.hpp>
#include <limits>

View File

@ -9,8 +9,8 @@
#include <NDK/Prerequesites.hpp>
#include <NDK/BaseWidget.hpp>
#include <Nazara/Utility/CursorController.hpp>
#include <Nazara/Utility/EventHandler.hpp>
#include <Nazara/Platform/CursorController.hpp>
#include <Nazara/Platform/EventHandler.hpp>
namespace Ndk
{

View File

@ -3,7 +3,7 @@
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#include <NDK/Canvas.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Platform/Cursor.hpp>
namespace Ndk
{

View File

@ -12,7 +12,7 @@
#include <Nazara/Core/ObjectHandle.hpp>
#include <Nazara/Graphics/Sprite.hpp>
#include <Nazara/Graphics/TextSprite.hpp>
#include <Nazara/Utility/Event.hpp>
#include <Nazara/Platform/Event.hpp>
#include <Nazara/Utility/Node.hpp>
#include <Nazara/Utility/SimpleTextDrawer.hpp>
#include <NDK/EntityOwner.hpp>

View File

@ -36,6 +36,7 @@ namespace Ndk
std::unique_ptr<LuaBinding_Base> audio;
std::unique_ptr<LuaBinding_Base> graphics;
std::unique_ptr<LuaBinding_Base> renderer;
std::unique_ptr<LuaBinding_Base> platform;
#endif
private:

View File

@ -23,6 +23,7 @@ namespace Ndk
class LuaBinding_Renderer;
class LuaBinding_SDK;
class LuaBinding_Utility;
class LuaBinding_Platform;
class NDK_API LuaBinding_Base
{
@ -43,6 +44,7 @@ namespace Ndk
static std::unique_ptr<LuaBinding_Base> BindAudio(LuaBinding& binding);
static std::unique_ptr<LuaBinding_Base> BindGraphics(LuaBinding& binding);
static std::unique_ptr<LuaBinding_Base> BindRenderer(LuaBinding& binding);
static std::unique_ptr<LuaBinding_Base> BindPlatform(LuaBinding& binding);
#endif
protected:

View File

@ -0,0 +1,28 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Development Kit"
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#pragma once
#ifndef NDK_LUABINDING_SYSTEM_HPP
#define NDK_LUABINDING_SYSTEM_HPP
#include <Nazara/Platform/Keyboard.hpp>
#include <NDK/Lua/LuaBinding_Base.hpp>
namespace Ndk
{
class NDK_API LuaBinding_Platform : public LuaBinding_Base
{
public:
LuaBinding_Platform(LuaBinding& binding);
~LuaBinding_Platform() = default;
void Register(Nz::LuaState& state) override;
// Platform
Nz::LuaClass<Nz::Keyboard> keyboard;
};
}
#endif // NDK_LUABINDING_SYSTEM_HPP

View File

@ -9,7 +9,6 @@
#include <Nazara/Utility/AbstractImage.hpp>
#include <Nazara/Utility/Font.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/Node.hpp>
#include <NDK/Lua/LuaBinding_Base.hpp>
@ -26,7 +25,6 @@ namespace Ndk
// Utility
Nz::LuaClass<Nz::AbstractImageRef> abstractImage;
Nz::LuaClass<Nz::FontRef> font;
Nz::LuaClass<Nz::Keyboard> keyboard;
Nz::LuaClass<Nz::Node> node;
};
}

View File

@ -25,6 +25,7 @@ namespace Ndk
audio = LuaBinding_Base::BindAudio(*this);
renderer = LuaBinding_Base::BindRenderer(*this);
graphics = LuaBinding_Base::BindGraphics(*this);
platform = LuaBinding_Base::BindPlatform(*this);
#endif
sdk = LuaBinding_Base::BindSDK(*this);
@ -48,6 +49,7 @@ namespace Ndk
audio->Register(state);
graphics->Register(state);
renderer->Register(state);
platform->Register(state);
#endif
// ComponentType (fake enumeration to expose component indexes)

View File

@ -0,0 +1,133 @@
// This file is part of the "Nazara Development Kit"
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#include <NDK/Lua/LuaBinding_Platform.hpp>
#include <NDK/LuaAPI.hpp>
namespace Ndk
{
std::unique_ptr<LuaBinding_Base> LuaBinding_Base::BindPlatform(LuaBinding& binding)
{
return std::make_unique<LuaBinding_Platform>(binding);
}
LuaBinding_Platform::LuaBinding_Platform(LuaBinding& binding) :
LuaBinding_Base(binding)
{
/*********************************** Nz::Keyboard **********************************/
keyboard.Reset("Keyboard");
{
keyboard.BindStaticMethod("GetKeyName", &Nz::Keyboard::GetKeyName);
keyboard.BindStaticMethod("IsKeyPressed", &Nz::Keyboard::IsKeyPressed);
}
}
/*!
* \brief Registers the classes that will be used by the Lua instance
*
* \param instance Lua instance that will interact with the Utility classes
*/
void LuaBinding_Platform::Register(Nz::LuaState& state)
{
keyboard.Register(state);
keyboard.PushGlobalTable(state);
{
static_assert(Nz::Keyboard::Count == 121, "Nz::Keyboard::Key has been updated but change was not reflected to Lua binding");
state.PushField("Undefined", Nz::Keyboard::Undefined);
// A-Z
for (std::size_t i = 0; i < 26; ++i)
state.PushField(Nz::String('A' + char(i)), Nz::Keyboard::A + i);
// Numerical
for (std::size_t i = 0; i < 10; ++i)
{
state.PushField("Num" + Nz::String::Number(i), Nz::Keyboard::Num0 + i);
state.PushField("Numpad" + Nz::String::Number(i), Nz::Keyboard::Numpad0 + i);
}
// F1-F15
for (std::size_t i = 0; i < 15; ++i)
state.PushField('F' + Nz::String::Number(i+1), Nz::Keyboard::F1 + i);
// And all the others...
state.PushField("Down", Nz::Keyboard::Down);
state.PushField("Left", Nz::Keyboard::Left);
state.PushField("Right", Nz::Keyboard::Right);
state.PushField("Up", Nz::Keyboard::Up);
state.PushField("Add", Nz::Keyboard::Add);
state.PushField("Decimal", Nz::Keyboard::Decimal);
state.PushField("Divide", Nz::Keyboard::Divide);
state.PushField("Multiply", Nz::Keyboard::Multiply);
state.PushField("Subtract", Nz::Keyboard::Subtract);
state.PushField("Backslash", Nz::Keyboard::Backslash);
state.PushField("Backspace", Nz::Keyboard::Backspace);
state.PushField("Clear", Nz::Keyboard::Clear);
state.PushField("Comma", Nz::Keyboard::Comma);
state.PushField("Dash", Nz::Keyboard::Dash);
state.PushField("Delete", Nz::Keyboard::Delete);
state.PushField("End", Nz::Keyboard::End);
state.PushField("Equal", Nz::Keyboard::Equal);
state.PushField("Escape", Nz::Keyboard::Escape);
state.PushField("Home", Nz::Keyboard::Home);
state.PushField("Insert", Nz::Keyboard::Insert);
state.PushField("LAlt", Nz::Keyboard::LAlt);
state.PushField("LBracket", Nz::Keyboard::LBracket);
state.PushField("LControl", Nz::Keyboard::LControl);
state.PushField("LShift", Nz::Keyboard::LShift);
state.PushField("LSystem", Nz::Keyboard::LSystem);
state.PushField("PageDown", Nz::Keyboard::PageDown);
state.PushField("PageUp", Nz::Keyboard::PageUp);
state.PushField("Pause", Nz::Keyboard::Pause);
state.PushField("Period", Nz::Keyboard::Period);
state.PushField("Print", Nz::Keyboard::Print);
state.PushField("PrintScreen", Nz::Keyboard::PrintScreen);
state.PushField("Quote", Nz::Keyboard::Quote);
state.PushField("RAlt", Nz::Keyboard::RAlt);
state.PushField("RBracket", Nz::Keyboard::RBracket);
state.PushField("RControl", Nz::Keyboard::RControl);
state.PushField("Return", Nz::Keyboard::Return);
state.PushField("RShift", Nz::Keyboard::RShift);
state.PushField("RSystem", Nz::Keyboard::RSystem);
state.PushField("Semicolon", Nz::Keyboard::Semicolon);
state.PushField("Slash", Nz::Keyboard::Slash);
state.PushField("Space", Nz::Keyboard::Space);
state.PushField("Tab", Nz::Keyboard::Tab);
state.PushField("Tilde", Nz::Keyboard::Tilde);
state.PushField("Browser_Back", Nz::Keyboard::Browser_Back);
state.PushField("Browser_Favorites", Nz::Keyboard::Browser_Favorites);
state.PushField("Browser_Forward", Nz::Keyboard::Browser_Forward);
state.PushField("Browser_Home", Nz::Keyboard::Browser_Home);
state.PushField("Browser_Refresh", Nz::Keyboard::Browser_Refresh);
state.PushField("Browser_Search", Nz::Keyboard::Browser_Search);
state.PushField("Browser_Stop", Nz::Keyboard::Browser_Stop);
state.PushField("Media_Next", Nz::Keyboard::Media_Next);
state.PushField("Media_Play", Nz::Keyboard::Media_Play);
state.PushField("Media_Previous", Nz::Keyboard::Media_Previous);
state.PushField("Media_Stop", Nz::Keyboard::Media_Stop);
state.PushField("Volume_Down", Nz::Keyboard::Volume_Down);
state.PushField("Volume_Mute", Nz::Keyboard::Volume_Mute);
state.PushField("Volume_Up", Nz::Keyboard::Volume_Up);
state.PushField("CapsLock", Nz::Keyboard::CapsLock);
state.PushField("NumLock", Nz::Keyboard::NumLock);
state.PushField("ScrollLock", Nz::Keyboard::ScrollLock);
}
state.Pop();
static_assert(Nz::WindowStyle_Max + 1 == 6, "Nz::WindowStyle has been updated but change was not reflected to Lua binding");
state.PushTable(0, Nz::WindowStyle_Max + 1);
{
state.PushField("None", Nz::WindowStyle_None);
state.PushField("Fullscreen", Nz::WindowStyle_Fullscreen);
state.PushField("Closable", Nz::WindowStyle_Closable);
state.PushField("Resizable", Nz::WindowStyle_Resizable);
state.PushField("Titlebar", Nz::WindowStyle_Titlebar);
state.PushField("Threaded", Nz::WindowStyle_Threaded);
}
state.SetGlobal("WindowStyle");
}
}

View File

@ -161,13 +161,6 @@ namespace Ndk
font.BindStaticMethod("SetDefaultMinimumStepSize", &Nz::Font::SetDefaultMinimumStepSize);
}
/*********************************** Nz::Keyboard **********************************/
keyboard.Reset("Keyboard");
{
keyboard.BindStaticMethod("GetKeyName", &Nz::Keyboard::GetKeyName);
keyboard.BindStaticMethod("IsKeyPressed", &Nz::Keyboard::IsKeyPressed);
}
/*********************************** Nz::Node **********************************/
node.Reset("Node");
{
@ -339,106 +332,6 @@ namespace Ndk
{
abstractImage.Register(state);
font.Register(state);
keyboard.Register(state);
node.Register(state);
keyboard.PushGlobalTable(state);
{
static_assert(Nz::Keyboard::Count == 121, "Nz::Keyboard::Key has been updated but change was not reflected to Lua binding");
state.PushField("Undefined", Nz::Keyboard::Undefined);
// A-Z
for (std::size_t i = 0; i < 26; ++i)
state.PushField(Nz::String('A' + char(i)), Nz::Keyboard::A + i);
// Numerical
for (std::size_t i = 0; i < 10; ++i)
{
state.PushField("Num" + Nz::String::Number(i), Nz::Keyboard::Num0 + i);
state.PushField("Numpad" + Nz::String::Number(i), Nz::Keyboard::Numpad0 + i);
}
// F1-F15
for (std::size_t i = 0; i < 15; ++i)
state.PushField('F' + Nz::String::Number(i+1), Nz::Keyboard::F1 + i);
// And all the others...
state.PushField("Down", Nz::Keyboard::Down);
state.PushField("Left", Nz::Keyboard::Left);
state.PushField("Right", Nz::Keyboard::Right);
state.PushField("Up", Nz::Keyboard::Up);
state.PushField("Add", Nz::Keyboard::Add);
state.PushField("Decimal", Nz::Keyboard::Decimal);
state.PushField("Divide", Nz::Keyboard::Divide);
state.PushField("Multiply", Nz::Keyboard::Multiply);
state.PushField("Subtract", Nz::Keyboard::Subtract);
state.PushField("Backslash", Nz::Keyboard::Backslash);
state.PushField("Backspace", Nz::Keyboard::Backspace);
state.PushField("Clear", Nz::Keyboard::Clear);
state.PushField("Comma", Nz::Keyboard::Comma);
state.PushField("Dash", Nz::Keyboard::Dash);
state.PushField("Delete", Nz::Keyboard::Delete);
state.PushField("End", Nz::Keyboard::End);
state.PushField("Equal", Nz::Keyboard::Equal);
state.PushField("Escape", Nz::Keyboard::Escape);
state.PushField("Home", Nz::Keyboard::Home);
state.PushField("Insert", Nz::Keyboard::Insert);
state.PushField("LAlt", Nz::Keyboard::LAlt);
state.PushField("LBracket", Nz::Keyboard::LBracket);
state.PushField("LControl", Nz::Keyboard::LControl);
state.PushField("LShift", Nz::Keyboard::LShift);
state.PushField("LSystem", Nz::Keyboard::LSystem);
state.PushField("PageDown", Nz::Keyboard::PageDown);
state.PushField("PageUp", Nz::Keyboard::PageUp);
state.PushField("Pause", Nz::Keyboard::Pause);
state.PushField("Period", Nz::Keyboard::Period);
state.PushField("Print", Nz::Keyboard::Print);
state.PushField("PrintScreen", Nz::Keyboard::PrintScreen);
state.PushField("Quote", Nz::Keyboard::Quote);
state.PushField("RAlt", Nz::Keyboard::RAlt);
state.PushField("RBracket", Nz::Keyboard::RBracket);
state.PushField("RControl", Nz::Keyboard::RControl);
state.PushField("Return", Nz::Keyboard::Return);
state.PushField("RShift", Nz::Keyboard::RShift);
state.PushField("RSystem", Nz::Keyboard::RSystem);
state.PushField("Semicolon", Nz::Keyboard::Semicolon);
state.PushField("Slash", Nz::Keyboard::Slash);
state.PushField("Space", Nz::Keyboard::Space);
state.PushField("Tab", Nz::Keyboard::Tab);
state.PushField("Tilde", Nz::Keyboard::Tilde);
state.PushField("Browser_Back", Nz::Keyboard::Browser_Back);
state.PushField("Browser_Favorites", Nz::Keyboard::Browser_Favorites);
state.PushField("Browser_Forward", Nz::Keyboard::Browser_Forward);
state.PushField("Browser_Home", Nz::Keyboard::Browser_Home);
state.PushField("Browser_Refresh", Nz::Keyboard::Browser_Refresh);
state.PushField("Browser_Search", Nz::Keyboard::Browser_Search);
state.PushField("Browser_Stop", Nz::Keyboard::Browser_Stop);
state.PushField("Media_Next", Nz::Keyboard::Media_Next);
state.PushField("Media_Play", Nz::Keyboard::Media_Play);
state.PushField("Media_Previous", Nz::Keyboard::Media_Previous);
state.PushField("Media_Stop", Nz::Keyboard::Media_Stop);
state.PushField("Volume_Down", Nz::Keyboard::Volume_Down);
state.PushField("Volume_Mute", Nz::Keyboard::Volume_Mute);
state.PushField("Volume_Up", Nz::Keyboard::Volume_Up);
state.PushField("CapsLock", Nz::Keyboard::CapsLock);
state.PushField("NumLock", Nz::Keyboard::NumLock);
state.PushField("ScrollLock", Nz::Keyboard::ScrollLock);
}
state.Pop();
static_assert(Nz::WindowStyle_Max + 1 == 6, "Nz::WindowStyle has been updated but change was not reflected to Lua binding");
state.PushTable(0, Nz::WindowStyle_Max + 1);
{
state.PushField("None", Nz::WindowStyle_None);
state.PushField("Fullscreen", Nz::WindowStyle_Fullscreen);
state.PushField("Closable", Nz::WindowStyle_Closable);
state.PushField("Resizable", Nz::WindowStyle_Resizable);
state.PushField("Titlebar", Nz::WindowStyle_Titlebar);
state.PushField("Threaded", Nz::WindowStyle_Threaded);
}
state.SetGlobal("WindowStyle");
}
}

View File

@ -6,11 +6,13 @@
#include <Nazara/Audio/Audio.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/ParameterList.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Lua/Lua.hpp>
#include <Nazara/Noise/Noise.hpp>
#include <Nazara/Physics2D/Physics2D.hpp>
#include <Nazara/Physics3D/Physics3D.hpp>
#include <Nazara/Platform/Platform.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <NDK/Algorithm.hpp>
#include <NDK/BaseSystem.hpp>
@ -63,13 +65,6 @@ namespace Ndk
// Initialize the engine first
// Shared modules
#ifdef NDK_SERVER
Nz::ParameterList parameters;
parameters.SetParameter("NoWindowSystem", true);
Nz::Utility::SetParameters(parameters);
#endif
Nz::Lua::Initialize();
Nz::Noise::Initialize();
Nz::Physics2D::Initialize();

View File

@ -3,5 +3,6 @@ MODULE.Name = "Graphics"
MODULE.Libraries = {
"NazaraCore",
"NazaraUtility",
"NazaraPlatform",
"NazaraRenderer"
}

View File

@ -0,0 +1,31 @@
MODULE.Name = "Platform"
MODULE.Libraries = {
"NazaraCore",
"NazaraUtility"
}
MODULE.OsFiles.Windows = {
"../src/Nazara/Platform/Win32/**.hpp",
"../src/Nazara/Platform/Win32/**.cpp"
}
MODULE.OsFiles.Posix = {
"../src/Nazara/Platform/X11/**.hpp",
"../src/Nazara/Platform/X11/**.cpp"
}
MODULE.OsLibraries.Windows = {
"gdi32"
}
MODULE.OsLibraries.Posix = {
"X11",
"xcb",
"xcb-cursor",
"xcb-ewmh",
"xcb-icccm",
"xcb-keysyms",
"xcb-randr"
}

View File

@ -8,7 +8,8 @@ MODULE.Defines = {
MODULE.Libraries = {
"NazaraCore",
"NazaraUtility"
"NazaraUtility",
"NazaraPlatform"
}
MODULE.OsFiles.Windows = {

View File

@ -5,29 +5,11 @@ MODULE.Libraries = {
"stb_image"
}
MODULE.OsFiles.Windows = {
"../src/Nazara/Utility/Win32/**.hpp",
"../src/Nazara/Utility/Win32/**.cpp"
}
MODULE.OsFiles.Posix = {
"../src/Nazara/Utility/X11/**.hpp",
"../src/Nazara/Utility/X11/**.cpp"
}
MODULE.OsLibraries.Windows = {
"freetype-s",
"gdi32"
"freetype-s"
}
MODULE.OsLibraries.Posix = {
"freetype",
"X11",
"xcb",
"xcb-cursor",
"xcb-ewmh",
"xcb-icccm",
"xcb-keysyms",
"xcb-randr"
"freetype"
}

View File

@ -37,7 +37,8 @@ TOOL.FilesExcluded = {
"../SDK/**/*Widget*.*",
"../SDK/**/LuaBinding_Audio.*",
"../SDK/**/LuaBinding_Graphics.*",
"../SDK/**/LuaBinding_Renderer.*"
"../SDK/**/LuaBinding_Renderer.*",
"../SDK/**/LuaBinding_Platform.*"
}

View File

@ -25,7 +25,7 @@ TOOL.Files = {
TOOL.FilesExcluded = {
"../tests/Engine/Audio/**",
"../tests/Engine/Graphics/**",
"../tests/Engine/Utility/**",
"../tests/Engine/Platform/**",
"../tests/SDK/NDK/Application.cpp",
"../tests/SDK/NDK/Systems/ListenerSystem.cpp",
"../tests/SDK/NDK/Systems/RenderSystem.cpp"

View File

@ -9,5 +9,6 @@ EXAMPLE.Files = {
EXAMPLE.Libraries = {
"NazaraAudio",
"NazaraCore",
"NazaraPlatform",
"NazaraUtility"
}
}

View File

@ -12,14 +12,14 @@
#include <Nazara/Core/Clock.hpp>
#include <Nazara/Core/Thread.hpp> // Thread::Sleep
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#include <Nazara/Platform/Platform.hpp>
#include <iostream>
int main()
{
// NzKeyboard nécessite l'initialisation du module Utilitaire
Nz::Initializer<Nz::Audio, Nz::Utility> audio;
Nz::Initializer<Nz::Audio, Nz::Platform> audio;
if (!audio)
{
std::cout << "Failed to initialize audio module" << std::endl;

View File

@ -12,6 +12,7 @@ EXAMPLE.Files = {
EXAMPLE.Libraries = {
"NazaraCore",
"NazaraPlatform",
"NazaraRenderer",
"NazaraUtility"
}

View File

@ -8,6 +8,7 @@ EXAMPLE.Files = {
EXAMPLE.Libraries = {
"NazaraCore",
"NazaraPlatform",
"NazaraUtility"
}

View File

@ -2,6 +2,7 @@
#include <Nazara/Audio/Sound.hpp>
#include <Nazara/Core/OffsetOf.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform.hpp>
#include <Nazara/Utility.hpp>
#include <NDK/Components.hpp>
#include <NDK/Systems.hpp>

View File

@ -10,7 +10,7 @@
#include <Nazara/Graphics/ParticleStruct.hpp>
#include <Nazara/Graphics/SkyboxBackground.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/EventHandler.hpp>
#include <Nazara/Platform/EventHandler.hpp>
#include <NDK/Entity.hpp>
#include <NDK/State.hpp>
#include <vector>

View File

@ -15,6 +15,7 @@ EXAMPLE.Libraries = {
"NazaraNoise",
"NazaraPhysics2D",
"NazaraPhysics3D",
"NazaraPlatform",
"NazaraRenderer",
"NazaraUtility",
"NazaraSDK"

View File

@ -12,7 +12,7 @@
#include <type_traits>
#define NazaraCheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
// We fore the value of MANAGE_MEMORY in debug
// We force the value of MANAGE_MEMORY in debug
#if defined(NAZARA_DEBUG) && !NAZARA_GRAPHICS_MANAGE_MEMORY
#undef NAZARA_GRAPHICS_MANAGE_MEMORY
#define NAZARA_GRAPHICS_MANAGE_MEMORY 0

View File

@ -0,0 +1,48 @@
// This file was automatically generated
/*
Nazara Engine - Platform module
Copyright (C) 2015 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#ifndef NAZARA_GLOBAL_PLATFORM_HPP
#define NAZARA_GLOBAL_PLATFORM_HPP
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/CursorController.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <Nazara/Platform/Event.hpp>
#include <Nazara/Platform/EventHandler.hpp>
#include <Nazara/Platform/Icon.hpp>
#include <Nazara/Platform/Joystick.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#include <Nazara/Platform/Mouse.hpp>
#include <Nazara/Platform/Platform.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <Nazara/Platform/Window.hpp>
#include <Nazara/Platform/WindowHandle.hpp>
#endif // NAZARA_GLOBAL_PLATFORM_HPP

View File

@ -0,0 +1,54 @@
/*
Nazara Engine - Platform module
Copyright (C) 2015 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#ifndef NAZARA_CONFIG_PLATFORM_HPP
#define NAZARA_CONFIG_PLATFORM_HPP
/// Each modification of a parameter needs a recompilation of the module
// Use the MemoryManager to manage dynamic allocations (can detect memory leak but allocations/frees are slower)
#define NAZARA_PLATFORM_MANAGE_MEMORY 0
// Activate the security tests based on the code (Advised for development)
#define NAZARA_PLATFORM_SAFE 1
// Protect the classes against data race
//#define NAZARA_PLATFORM_THREADSAFE 1
// On Windows, ALT and F10 keys do not activate the window menu
#define NAZARA_PLATFORM_WINDOWS_DISABLE_MENU_KEYS 1
#if defined(NAZARA_STATIC)
#define NAZARA_PLATFORM_API
#else
#ifdef NAZARA_PLATFORM_BUILD
#define NAZARA_PLATFORM_API NAZARA_EXPORT
#else
#define NAZARA_PLATFORM_API NAZARA_IMPORT
#endif
#endif
#endif // NAZARA_CONFIG_PLATFORM_HPP

View File

@ -0,0 +1,23 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_CONFIG_CHECK_PLATFORM_HPP
#define NAZARA_CONFIG_CHECK_PLATFORM_HPP
/// This file is used to check the constant values defined in Config.hpp
#include <type_traits>
#define NazaraCheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
// We force the value of MANAGE_MEMORY in debug
#if defined(NAZARA_DEBUG) && !NAZARA_PLATFORM_MANAGE_MEMORY
#undef NAZARA_PLATFORM_MANAGE_MEMORY
#define NAZARA_PLATFORM_MANAGE_MEMORY 0
#endif
#undef NazaraCheckTypeAndVal
#endif // NAZARA_CONFIG_CHECK_PLATFORM_HPP

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -10,7 +10,8 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/ObjectRef.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <Nazara/Utility/Image.hpp>
#include <array>
@ -23,9 +24,9 @@ namespace Nz
using CursorConstRef = ObjectRef<const Cursor>;
using CursorRef = ObjectRef<Cursor>;
class NAZARA_UTILITY_API Cursor : public RefCounted
class NAZARA_PLATFORM_API Cursor : public RefCounted
{
friend class Utility;
friend class Platform;
friend class WindowImpl;
public:
@ -66,6 +67,6 @@ namespace Nz
};
}
#include <Nazara/Utility/Cursor.inl>
#include <Nazara/Platform/Cursor.inl>
#endif // NAZARA_CURSOR_HPP

View File

@ -1,10 +1,10 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
@ -66,4 +66,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Platform/DebugOff.hpp>

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -11,8 +11,8 @@
#include <Nazara/Core/HandledObject.hpp>
#include <Nazara/Core/ObjectHandle.hpp>
#include <Nazara/Core/Signal.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/Enums.hpp>
namespace Nz
{
@ -37,6 +37,6 @@ namespace Nz
};
}
#include <Nazara/Utility/CursorController.inl>
#include <Nazara/Platform/CursorController.inl>
#endif // NAZARA_CURSORCONTROLLER_HPP

View File

@ -1,9 +1,9 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/CursorController.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/CursorController.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
@ -13,4 +13,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Platform/DebugOff.hpp>

View File

@ -0,0 +1,8 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Platform/Config.hpp>
#if NAZARA_PLATFORM_MANAGE_MEMORY
#include <Nazara/Core/Debug/NewRedefinition.hpp>
#endif

View File

@ -0,0 +1,9 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// We suppose that Debug.hpp is already included, same goes for Config.hpp
#if NAZARA_PLATFORM_MANAGE_MEMORY
#undef delete
#undef new
#endif

View File

@ -0,0 +1,85 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_ENUMS_PLATFORM_HPP
#define NAZARA_ENUMS_PLATFORM_HPP
#include <Nazara/Core/Flags.hpp>
namespace Nz
{
enum SystemCursor
{
SystemCursor_Crosshair,
SystemCursor_Default,
SystemCursor_Hand,
SystemCursor_Help,
SystemCursor_Move,
SystemCursor_None,
SystemCursor_Pointer,
SystemCursor_Progress,
SystemCursor_ResizeE,
SystemCursor_ResizeN,
SystemCursor_ResizeNE,
SystemCursor_ResizeNW,
SystemCursor_ResizeS,
SystemCursor_ResizeSE,
SystemCursor_ResizeSW,
SystemCursor_ResizeW,
SystemCursor_Text,
SystemCursor_Wait,
SystemCursor_Max = SystemCursor_Wait
};
enum WindowEventType
{
WindowEventType_GainedFocus,
WindowEventType_LostFocus,
WindowEventType_KeyPressed,
WindowEventType_KeyReleased,
WindowEventType_MouseButtonDoubleClicked,
WindowEventType_MouseButtonPressed,
WindowEventType_MouseButtonReleased,
WindowEventType_MouseEntered,
WindowEventType_MouseLeft,
WindowEventType_MouseMoved,
WindowEventType_MouseWheelMoved,
WindowEventType_Moved,
WindowEventType_Quit,
WindowEventType_Resized,
WindowEventType_TextEntered,
WindowEventType_Max = WindowEventType_TextEntered
};
enum WindowStyle
{
WindowStyle_None, ///< Window has no border nor titlebar.
WindowStyle_Fullscreen, ///< At the window creation, the OS tries to set it in fullscreen.
WindowStyle_Closable, ///< Allows the window to be closed by a button in the titlebar, generating a Quit event.
WindowStyle_Resizable, ///< Allows the window to be resized by dragging its corners or by a button of the titlebar.
WindowStyle_Titlebar, ///< Adds a titlebar to the window, this option is automatically enabled if buttons of the titlebar are enabled.
WindowStyle_Threaded, ///< Runs the window into a thread, allowing the application to keep updating while resizing/dragging the window.
WindowStyle_Max = WindowStyle_Threaded
};
template<>
struct EnumAsFlags<WindowStyle>
{
static constexpr bool value = true;
static constexpr int max = WindowStyle_Max;
};
using WindowStyleFlags = Flags<WindowStyle>;
constexpr WindowStyleFlags WindowStyle_Default = WindowStyle_Closable | WindowStyle_Resizable | WindowStyle_Titlebar;
}
#endif // NAZARA_ENUMS_PLATFORM_HPP

View File

@ -1,23 +1,23 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
// Interface inspired by the SFML of Laurent Gomila (and its team)
#pragma once
#ifndef NAZARA_EVENT_HPP
#define NAZARA_EVENT_HPP
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/Mouse.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#include <Nazara/Platform/Mouse.hpp>
namespace Nz
{
struct WindowEvent
{
// Utilisé par:
// Used by:
// -WindowEventType_KeyPressed
// -WindowEventType_KeyReleased
struct KeyEvent
@ -30,7 +30,7 @@ namespace Nz
bool system;
};
// Utilisé par:
// Used by:
// -WindowEventType_MouseButtonDoubleClicked
// -WindowEventType_MouseButtonPressed
struct MouseButtonEvent
@ -40,7 +40,7 @@ namespace Nz
unsigned int y;
};
// Utilisé par:
// Used by:
// -WindowEventType_MouseMoved
struct MouseMoveEvent
{
@ -50,14 +50,14 @@ namespace Nz
unsigned int y;
};
// Utilisé par:
// Used by:
// -WindowEventType_MouseWheelMoved
struct MouseWheelEvent
{
float delta;
};
// Utilisé par:
// Used by:
// -WindowEventType_Moved
struct PositionEvent
{
@ -65,7 +65,7 @@ namespace Nz
int y;
};
// Utilisé par:
// Used by:
// -WindowEventType_Resized
struct SizeEvent
{
@ -73,7 +73,7 @@ namespace Nz
unsigned int width;
};
// Utilisé par:
// Used by:
// -WindowEventType_TextEntered
struct TextEvent
{
@ -85,33 +85,33 @@ namespace Nz
union
{
// Utilisé par:
// Used by:
// -WindowEventType_KeyPressed
// -WindowEventType_KeyReleased
KeyEvent key;
// Utilisé par:
// Used by:
// -WindowEventType_MouseButtonDoubleClicked
// -WindowEventType_MouseButtonPressed
MouseButtonEvent mouseButton;
// Utilisé par:
// Used by:
// -WindowEventType_MouseMoved
MouseMoveEvent mouseMove;
// Utilisé par:
// Used by:
// -WindowEventType_MouseWheelMoved
MouseWheelEvent mouseWheel;
// Utilisé par:
// Used by:
// -WindowEventType_Moved
PositionEvent position;
// Utilisé par:
// Used by:
// -WindowEventType_Resized
SizeEvent size;
// Utilisé par:
// Used by:
// -WindowEventType_TextEntered
TextEvent text;
};

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -11,8 +11,8 @@
#include <Nazara/Core/HandledObject.hpp>
#include <Nazara/Core/ObjectHandle.hpp>
#include <Nazara/Core/Signal.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Event.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Event.hpp>
namespace Nz
{
@ -52,6 +52,6 @@ namespace Nz
};
}
#include <Nazara/Utility/EventHandler.inl>
#include <Nazara/Platform/EventHandler.inl>
#endif // NAZARA_EVENTHANDLER_HPP

View File

@ -1,10 +1,10 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/EventHandler.hpp>
#include <Nazara/Platform/EventHandler.hpp>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
@ -82,4 +82,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Platform/DebugOff.hpp>

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -10,7 +10,7 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/ObjectRef.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Platform/Config.hpp>
namespace Nz
{
@ -21,7 +21,7 @@ namespace Nz
using IconRef = ObjectRef<Icon>;
class NAZARA_UTILITY_API Icon : public RefCounted
class NAZARA_PLATFORM_API Icon : public RefCounted
{
friend class WindowImpl;
@ -42,6 +42,6 @@ namespace Nz
};
}
#include <Nazara/Utility/Icon.inl>
#include <Nazara/Platform/Icon.inl>
#endif // NAZARA_ICON_HPP

View File

@ -1,10 +1,10 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
@ -39,4 +39,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Platform/DebugOff.hpp>

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -12,7 +12,7 @@
namespace Nz
{
class NAZARA_UTILITY_API Joystick
class NAZARA_PLATFORM_API Joystick
{
public:
Joystick() = delete;

View File

@ -1,8 +1,8 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
// Interface inspired by the SFML of Laurent Gomila (and its team)
#pragma once
@ -11,11 +11,11 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Platform/Config.hpp>
namespace Nz
{
class NAZARA_UTILITY_API Keyboard
class NAZARA_PLATFORM_API Keyboard
{
public:
enum Key
@ -50,7 +50,7 @@ namespace Nz
Y,
Z,
// Touches de fonction
// Functional keys
F1,
F2,
F3,
@ -67,13 +67,13 @@ namespace Nz
F14,
F15,
// Flèches directionnelles
// Directional keys
Down,
Left,
Right,
Up,
// Pavé numérique
// Numerical pad
Add,
Decimal,
Divide,
@ -90,7 +90,7 @@ namespace Nz
Numpad9,
Subtract,
// Divers
// Various
Backslash,
Backspace,
Clear,
@ -136,7 +136,7 @@ namespace Nz
Tab,
Tilde,
// Touches navigateur
// Navigator keys
Browser_Back,
Browser_Favorites,
Browser_Forward,
@ -145,18 +145,18 @@ namespace Nz
Browser_Search,
Browser_Stop,
// Touches de contrôle de lecture
// Lecture control keys
Media_Next,
Media_Play,
Media_Previous,
Media_Stop,
// Touches de contrôle du volume
// Volume control keys
Volume_Down,
Volume_Mute,
Volume_Up,
// Touches à verrouillage
// Locking keys
CapsLock,
NumLock,
ScrollLock,

View File

@ -1,8 +1,8 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
// Interface inspired by the SFML of Laurent Gomila (and its team)
#pragma once
@ -11,13 +11,13 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Platform/Config.hpp>
namespace Nz
{
class Window;
class NAZARA_UTILITY_API Mouse
class NAZARA_PLATFORM_API Mouse
{
public:
enum Button

View File

@ -0,0 +1,33 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_PLATFORM_HPP
#define NAZARA_PLATFORM_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/Initializer.hpp>
#include <Nazara/Platform/Config.hpp>
namespace Nz
{
class NAZARA_PLATFORM_API Platform
{
public:
Platform() = delete;
~Platform() = delete;
static bool Initialize();
static bool IsInitialized();
static void Uninitialize();
private:
static unsigned int s_moduleReferenceCounter;
};
}
#endif // NAZARA_PLATFORM_HPP

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
@ -10,12 +10,12 @@
#define NAZARA_VIDEOMODE_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Platform/Config.hpp>
#include <vector>
namespace Nz
{
class NAZARA_UTILITY_API VideoMode
class NAZARA_PLATFORM_API VideoMode
{
public:
VideoMode();

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
@ -14,14 +14,14 @@
#include <Nazara/Core/Mutex.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Utility/CursorController.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/EventHandler.hpp>
#include <Nazara/Utility/Icon.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/WindowHandle.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/CursorController.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <Nazara/Platform/EventHandler.hpp>
#include <Nazara/Platform/Icon.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <Nazara/Platform/WindowHandle.hpp>
#include <queue>
namespace Nz
@ -29,11 +29,11 @@ namespace Nz
class Image;
class WindowImpl;
class NAZARA_UTILITY_API Window
class NAZARA_PLATFORM_API Window
{
friend WindowImpl;
friend class Mouse;
friend class Utility;
friend class Platform;
public:
Window();
@ -138,6 +138,6 @@ namespace Nz
};
}
#include <Nazara/Utility/Window.inl>
#include <Nazara/Platform/Window.inl>
#endif // NAZARA_WINDOW_HPP

View File

@ -1,11 +1,11 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Platform/Window.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/LockGuard.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
@ -173,4 +173,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Platform/DebugOff.hpp>

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@ -9,8 +9,8 @@
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/RenderTargetParameters.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/WindowHandle.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <Nazara/Platform/WindowHandle.hpp>
namespace Nz
{

View File

@ -16,7 +16,7 @@
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/ContextParameters.hpp>
#include <Nazara/Renderer/RenderTarget.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Platform/Window.hpp>
#include <vector>
namespace Nz

View File

@ -39,27 +39,19 @@
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/CubemapParams.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Utility/CursorController.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/Event.hpp>
#include <Nazara/Utility/EventHandler.hpp>
#include <Nazara/Utility/Font.hpp>
#include <Nazara/Utility/FontData.hpp>
#include <Nazara/Utility/FontGlyph.hpp>
#include <Nazara/Utility/GuillotineImageAtlas.hpp>
#include <Nazara/Utility/Icon.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/IndexBuffer.hpp>
#include <Nazara/Utility/IndexIterator.hpp>
#include <Nazara/Utility/IndexMapper.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/Joystick.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/MeshData.hpp>
#include <Nazara/Utility/Mouse.hpp>
#include <Nazara/Utility/Node.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/Sequence.hpp>
@ -75,8 +67,5 @@
#include <Nazara/Utility/VertexDeclaration.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Utility/VertexStruct.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Utility/WindowHandle.hpp>
#endif // NAZARA_GLOBAL_UTILITY_HPP

View File

@ -27,32 +27,29 @@
#ifndef NAZARA_CONFIG_UTILITY_HPP
#define NAZARA_CONFIG_UTILITY_HPP
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
/// Each modification of a parameter needs a recompilation of the module
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
// Use the MemoryManager to manage dynamic allocations (can detect memory leak but allocations/frees are slower)
#define NAZARA_UTILITY_MANAGE_MEMORY 0
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
// Activate the security tests based on the code (Advised for development)
#define NAZARA_UTILITY_SAFE 1
// Lors du parsage d'une ressource, déclenche un avertissement si une erreur non-critique est repérée dans une ressource (Plus lent)
// When a resource is being parsed, it triggers a warning if a non-critical error is found in the resource (Slower)
#define NAZARA_UTILITY_STRICT_RESOURCE_PARSING 1
// Protège les classes des accès concurrentiels
// Protect the classes against data race
//#define NAZARA_UTILITY_THREADSAFE 1
// Force les buffers à posséder un stride multiple de 32 bytes (Gain de performances sur certaines cartes/plus de consommation mémoire)
#define NAZARA_UTILITY_VERTEX_DECLARATION_FORCE_STRIDE_MULTIPLE_OF_32 0 ///FIXME: Ne peut pas être utilisé pour l'instant
// Force the buffers to have a stride which is a multiple of 32 bytes (Gain of performances on certain cards/more memory consumption)
#define NAZARA_UTILITY_VERTEX_DECLARATION_FORCE_STRIDE_MULTIPLE_OF_32 0 ///FIXME: Can not be used for the moment
// Sous Windows, fait en sorte que les touches ALT et F10 n'activent pas le menu de la fenêtre
#define NAZARA_UTILITY_WINDOWS_DISABLE_MENU_KEYS 1
/// Each modification of a parameter following implies a modification (often minor) of the code
/// Chaque modification d'un paramètre ci-dessous implique une modification (souvent mineure) du code
// Le nombre maximum de poids affectant un sommet (En cas de dépassement, les poids supplémentaires seront ignorés et les autres renormalisés)
// The maximal number of weights acting on a vertex (In case of overflow, the surnumerous weights would be ignored and the others renormalized)
#define NAZARA_UTILITY_SKINNING_MAX_WEIGHTS 4
/// Vérification des valeurs et types de certaines constantes
/// Checking the values and types of certain constants
#include <Nazara/Utility/ConfigCheck.hpp>
#if defined(NAZARA_STATIC)

View File

@ -7,12 +7,12 @@
#ifndef NAZARA_CONFIG_CHECK_UTILITY_HPP
#define NAZARA_CONFIG_CHECK_UTILITY_HPP
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
/// This file is used to check the constant values defined in Config.hpp
#include <type_traits>
#define NazaraCheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
// On force la valeur de MANAGE_MEMORY en mode debug
// We force the value of MANAGE_MEMORY in debug
#if defined(NAZARA_DEBUG) && !NAZARA_UTILITY_MANAGE_MEMORY
#undef NAZARA_UTILITY_MANAGE_MEMORY
#define NAZARA_UTILITY_MANAGE_MEMORY 0

View File

@ -92,8 +92,8 @@ namespace Nz
enum CubemapFace
{
// Cette énumération est prévue pour remplacer l'argument "z" des méthodes de Image contenant un cubemap
// L'ordre est X, -X, Y, -Y, Z, -Z
// This enumeration is intended to replace the "z" argument of Image's methods containing cubemap
// The order is X, -X, Y, -Y, Z, -Z
CubemapFace_PositiveX = 0,
CubemapFace_PositiveY = 2,
CubemapFace_PositiveZ = 4,
@ -307,30 +307,6 @@ namespace Nz
SamplerWrap_Max = SamplerWrap_Repeat
};
enum SystemCursor
{
SystemCursor_Crosshair,
SystemCursor_Default,
SystemCursor_Hand,
SystemCursor_Help,
SystemCursor_Move,
SystemCursor_None,
SystemCursor_Pointer,
SystemCursor_Progress,
SystemCursor_ResizeE,
SystemCursor_ResizeN,
SystemCursor_ResizeNE,
SystemCursor_ResizeNW,
SystemCursor_ResizeS,
SystemCursor_ResizeSE,
SystemCursor_ResizeSW,
SystemCursor_ResizeW,
SystemCursor_Text,
SystemCursor_Wait,
SystemCursor_Max = SystemCursor_Wait
};
enum StencilOperation
{
StencilOperation_Decrement,
@ -370,7 +346,7 @@ namespace Nz
{
VertexComponent_Unused = -1,
// Nous nous limitons à 16 composants de sommets car c'est le minimum supporté par le GPU
// We limit to 16 components by vertex since it's the minimal number supported by the GPU
VertexComponent_InstanceData0,
VertexComponent_InstanceData1,
VertexComponent_InstanceData2,
@ -398,7 +374,7 @@ namespace Nz
enum VertexLayout
{
// Déclarations destinées au rendu
// Declarations meant for the rendering
VertexLayout_XY,
VertexLayout_XY_Color,
VertexLayout_XY_UV,
@ -411,57 +387,11 @@ namespace Nz
VertexLayout_XYZ_Normal_UV_Tangent_Skinning,
VertexLayout_XYZ_UV,
// Déclarations destinées à l'instancing
// Declarations meant for the instancing
VertexLayout_Matrix4,
VertexLayout_Max = VertexLayout_Matrix4
};
enum WindowEventType
{
WindowEventType_GainedFocus,
WindowEventType_LostFocus,
WindowEventType_KeyPressed,
WindowEventType_KeyReleased,
WindowEventType_MouseButtonDoubleClicked,
WindowEventType_MouseButtonPressed,
WindowEventType_MouseButtonReleased,
WindowEventType_MouseEntered,
WindowEventType_MouseLeft,
WindowEventType_MouseMoved,
WindowEventType_MouseWheelMoved,
WindowEventType_Moved,
WindowEventType_Quit,
WindowEventType_Resized,
WindowEventType_TextEntered,
WindowEventType_Max = WindowEventType_TextEntered
};
enum WindowStyle
{
WindowStyle_None, ///< Window has no border nor titlebar.
WindowStyle_Fullscreen, ///< At the window creation, the OS tries to set it in fullscreen.
WindowStyle_Closable, ///< Allows the window to be closed by a button in the titlebar, generating a Quit event.
WindowStyle_Resizable, ///< Allows the window to be resized by dragging its corners or by a button of the titlebar.
WindowStyle_Titlebar, ///< Adds a titlebar to the window, this option is automatically enabled if buttons of the titlebar are enabled.
WindowStyle_Threaded, ///< Runs the window into a thread, allowing the application to keep updating while resizing/dragging the window.
WindowStyle_Max = WindowStyle_Threaded
};
template<>
struct EnumAsFlags<WindowStyle>
{
static constexpr bool value = true;
static constexpr int max = WindowStyle_Max;
};
using WindowStyleFlags = Flags<WindowStyle>;
constexpr WindowStyleFlags WindowStyle_Default = WindowStyle_Closable | WindowStyle_Resizable | WindowStyle_Titlebar;
}
#endif // NAZARA_ENUMS_UTILITY_HPP

View File

@ -9,7 +9,6 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/Initializer.hpp>
#include <Nazara/Core/ParameterList.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
@ -25,15 +24,12 @@ namespace Nz
static bool IsInitialized();
static void SetParameters(const ParameterList& parameters);
static void Uninitialize();
static unsigned int ComponentCount[ComponentType_Max+1];
static std::size_t ComponentStride[ComponentType_Max+1];
private:
static ParameterList s_initializationParameters;
static unsigned int s_moduleReferenceCounter;
};
}

View File

@ -173,7 +173,7 @@ namespace Nz
}
/*!
* \brief Uninitializes the Core module
* \brief Uninitializes the Graphics module
*
* \remark Produces a NazaraNotice
*/

View File

@ -1,18 +1,18 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Platform/Cursor.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Utility/Win32/CursorImpl.hpp>
#include <Nazara/Platform/Win32/CursorImpl.hpp>
#elif defined(NAZARA_PLATFORM_X11)
#include <Nazara/Utility/X11/CursorImpl.hpp>
#include <Nazara/Platform/X11/CursorImpl.hpp>
#else
#error Lack of implementation: Cursor
#endif
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -0,0 +1,31 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Platform/Config.hpp>
#if NAZARA_PLATFORM_MANAGE_MEMORY
#include <Nazara/Core/MemoryManager.hpp>
#include <new> // Needed ?
void* operator new(std::size_t size)
{
return Nz::MemoryManager::Allocate(size, false);
}
void* operator new[](std::size_t size)
{
return Nz::MemoryManager::Allocate(size, true);
}
void operator delete(void* pointer) noexcept
{
Nz::MemoryManager::Free(pointer, false);
}
void operator delete[](void* pointer) noexcept
{
Nz::MemoryManager::Free(pointer, true);
}
#endif // NAZARA_PLATFORM_MANAGE_MEMORY

View File

@ -1,18 +1,18 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Icon.hpp>
#include <Nazara/Platform/Icon.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Utility/Win32/IconImpl.hpp>
#include <Nazara/Platform/Win32/IconImpl.hpp>
#elif defined(NAZARA_PLATFORM_X11)
#include <Nazara/Utility/X11/IconImpl.hpp>
#include <Nazara/Platform/X11/IconImpl.hpp>
#else
#error Lack of implementation: Icon
#endif
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,18 +1,18 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Utility/Win32/InputImpl.hpp>
#include <Nazara/Platform/Win32/InputImpl.hpp>
#elif defined(NAZARA_PLATFORM_X11)
#include <Nazara/Utility/X11/InputImpl.hpp>
#include <Nazara/Platform/X11/InputImpl.hpp>
#else
#error Lack of implementation: Keyboard
#endif
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,19 +1,19 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Mouse.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Platform/Mouse.hpp>
#include <Nazara/Platform/Window.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Utility/Win32/InputImpl.hpp>
#include <Nazara/Platform/Win32/InputImpl.hpp>
#elif defined(NAZARA_PLATFORM_X11)
#include <Nazara/Utility/X11/InputImpl.hpp>
#include <Nazara/Platform/X11/InputImpl.hpp>
#else
#error Lack of implementation: Mouse
#endif
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -0,0 +1,108 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Platform/Platform.hpp>
#include <Nazara/Core/CallOnExit.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/Window.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
/*!
* \ingroup system
* \class Nz::Platform
* \brief Platform class that represents the module initializer of Platform
*/
/*!
* \brief Initializes the Platform module
* \return true if initialization is successful
*
* \remark Produces a NazaraNotice
* \remark Produces a NazaraError if one submodule failed
*/
bool Platform::Initialize()
{
if (s_moduleReferenceCounter > 0)
{
s_moduleReferenceCounter++;
return true; // Already initialized
}
// Initialize module dependencies
if (!Utility::Initialize())
{
NazaraError("Failed to initialize utility module");
return false;
}
s_moduleReferenceCounter++;
// Initialisation of the module
CallOnExit onExit(Platform::Uninitialize);
if (!Window::Initialize())
{
NazaraError("Failed to initialize window's system");
return false;
}
// Must be initialized after Window
if (!Cursor::Initialize())
{
NazaraError("Failed to initialize cursors");
return false;
}
onExit.Reset();
NazaraNotice("Initialized: Platform module");
return true;
}
/*!
* \brief Checks whether the module is initialized
* \return true if module is initialized
*/
bool Platform::IsInitialized()
{
return s_moduleReferenceCounter != 0;
}
/*!
* \brief Uninitializes the Platform module
*
* \remark Produces a NazaraNotice
*/
void Platform::Uninitialize()
{
if (s_moduleReferenceCounter != 1)
{
// The module is still in use, or can not be uninitialized
if (s_moduleReferenceCounter > 1)
s_moduleReferenceCounter--;
return;
}
// Free of module
s_moduleReferenceCounter = 0;
Cursor::Uninitialize(); //< Must be done before Window
Window::Uninitialize();
NazaraNotice("Uninitialized: Platform module");
// Free of dependances
Utility::Uninitialize();
}
unsigned int Platform::s_moduleReferenceCounter = 0;
}

View File

@ -1,20 +1,20 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <algorithm>
#include <functional>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Utility/Win32/VideoModeImpl.hpp>
#include <Nazara/Platform/Win32/VideoModeImpl.hpp>
#elif defined(NAZARA_PLATFORM_X11)
#include <Nazara/Utility/X11/VideoModeImpl.hpp>
#include <Nazara/Platform/X11/VideoModeImpl.hpp>
#else
#error Lack of implementation: Window
#endif
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@ -1,12 +1,12 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Win32/CursorImpl.hpp>
#include <Nazara/Platform/Win32/CursorImpl.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -8,7 +8,7 @@
#define NAZARA_CURSORIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <array>
#include <windows.h>

View File

@ -1,11 +1,11 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Win32/IconImpl.hpp>
#include <Nazara/Platform/Win32/IconImpl.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@ -1,12 +1,12 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Win32/InputImpl.hpp>
#include <Nazara/Platform/Win32/InputImpl.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Platform/Window.hpp>
#include <windows.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -9,8 +9,8 @@
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/Mouse.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#include <Nazara/Platform/Mouse.hpp>
namespace Nz
{

View File

@ -1,12 +1,12 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Win32/VideoModeImpl.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Platform/Win32/VideoModeImpl.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <algorithm>
#include <windows.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -7,7 +7,7 @@
#ifndef NAZARA_VIDEOMODEIMPL_HPP
#define NAZARA_VIDEOMODEIMPL_HPP
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Platform/VideoMode.hpp>
namespace Nz
{

View File

@ -1,24 +1,24 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Un grand merci à Laurent Gomila pour la SFML qui m'aura bien aidé à réaliser cette implémentation
#include <Nazara/Utility/Win32/WindowImpl.hpp>
#include <Nazara/Platform/Win32/WindowImpl.hpp>
#include <Nazara/Core/ConditionVariable.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Mutex.hpp>
#include <Nazara/Core/Thread.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/Icon.hpp>
#include <Nazara/Platform/Win32/CursorImpl.hpp>
#include <Nazara/Platform/Win32/IconImpl.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/Icon.hpp>
#include <Nazara/Utility/Win32/CursorImpl.hpp>
#include <Nazara/Utility/Win32/IconImpl.hpp>
#include <cstdio>
#include <memory>
#include <windowsx.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
#ifdef _WIN64
#define GCL_HCURSOR GCLP_HCURSOR
@ -907,7 +907,7 @@ namespace Nz
}
}
#if NAZARA_UTILITY_WINDOWS_DISABLE_MENU_KEYS
#if NAZARA_PLATFORM_WINDOWS_DISABLE_MENU_KEYS
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx
if (message == WM_SYSCOMMAND && wParam == SC_KEYMENU)
return true;

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
@ -14,11 +14,11 @@
#include <Nazara/Core/Thread.hpp>
#include <Nazara/Math/Rect.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/Mouse.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#include <Nazara/Platform/Mouse.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <Nazara/Platform/Window.hpp>
#include <windows.h>
namespace Nz

View File

@ -1,26 +1,26 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Platform/Window.hpp>
#include <Nazara/Core/CallOnExit.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/LockGuard.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/Icon.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/Icon.hpp>
#include <stdexcept>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Utility/Win32/WindowImpl.hpp>
#include <Nazara/Platform/Win32/WindowImpl.hpp>
#elif defined(NAZARA_PLATFORM_X11)
#include <Nazara/Utility/X11/WindowImpl.hpp>
#include <Nazara/Platform/X11/WindowImpl.hpp>
#else
#error Lack of implementation: Window
#endif
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
@ -50,7 +50,7 @@ namespace Nz
bool Window::Create(VideoMode mode, const String& title, WindowStyleFlags style)
{
// Si la fenêtre est déjà ouverte, nous conservons sa position
// If the window is already open, we keep its position
bool opened = IsOpen();
Vector2i position;
if (opened)
@ -58,7 +58,7 @@ namespace Nz
Destroy();
// Inspiré du code de la SFML par Laurent Gomila
// Inspired by the code of the SFML by Laurent Gomila (and its team)
if (style & WindowStyle_Fullscreen)
{
if (fullscreenWindow)
@ -101,7 +101,7 @@ namespace Nz
return false;
}
// Paramètres par défaut
// Default parameters
m_impl->EnableKeyRepeat(true);
m_impl->EnableSmoothScrolling(false);
m_impl->SetMaximumSize(-1, -1);
@ -169,7 +169,7 @@ namespace Nz
void Window::EnableKeyRepeat(bool enable)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -182,7 +182,7 @@ namespace Nz
void Window::EnableSmoothScrolling(bool enable)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -195,7 +195,7 @@ namespace Nz
WindowHandle Window::GetHandle() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -208,7 +208,7 @@ namespace Nz
unsigned int Window::GetHeight() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -221,7 +221,7 @@ namespace Nz
Vector2i Window::GetPosition() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -234,7 +234,7 @@ namespace Nz
Vector2ui Window::GetSize() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -247,7 +247,7 @@ namespace Nz
WindowStyleFlags Window::GetStyle() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -260,7 +260,7 @@ namespace Nz
String Window::GetTitle() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -273,7 +273,7 @@ namespace Nz
unsigned int Window::GetWidth() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -286,7 +286,7 @@ namespace Nz
bool Window::HasFocus() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -299,7 +299,7 @@ namespace Nz
bool Window::IsMinimized() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -312,7 +312,7 @@ namespace Nz
bool Window::IsVisible() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -325,7 +325,7 @@ namespace Nz
bool Window::PollEvent(WindowEvent* event)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -378,7 +378,7 @@ namespace Nz
void Window::SetEventListener(bool listener)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -397,7 +397,7 @@ namespace Nz
void Window::SetFocus()
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -419,7 +419,7 @@ namespace Nz
void Window::SetMaximumSize(const Vector2i& maxSize)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -432,7 +432,7 @@ namespace Nz
void Window::SetMaximumSize(int width, int height)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -445,7 +445,7 @@ namespace Nz
void Window::SetMinimumSize(const Vector2i& minSize)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -458,7 +458,7 @@ namespace Nz
void Window::SetMinimumSize(int width, int height)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -471,7 +471,7 @@ namespace Nz
void Window::SetPosition(const Vector2i& position)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -484,7 +484,7 @@ namespace Nz
void Window::SetPosition(int x, int y)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -497,7 +497,7 @@ namespace Nz
void Window::SetSize(const Vector2i& size)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -510,7 +510,7 @@ namespace Nz
void Window::SetSize(unsigned int width, unsigned int height)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -523,7 +523,7 @@ namespace Nz
void Window::SetStayOnTop(bool stayOnTop)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -536,7 +536,7 @@ namespace Nz
void Window::SetTitle(const String& title)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -549,7 +549,7 @@ namespace Nz
void Window::SetVisible(bool visible)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -562,7 +562,7 @@ namespace Nz
bool Window::WaitEvent(WindowEvent* event)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");
@ -626,7 +626,7 @@ namespace Nz
void Window::IgnoreNextMouseEvent(int mouseX, int mouseY) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_PLATFORM_SAFE
if (!m_impl)
{
NazaraError("Window not created");

View File

@ -1,13 +1,13 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/X11/CursorImpl.hpp>
#include <Nazara/Platform/X11/CursorImpl.hpp>
#include <Nazara/Core/CallOnExit.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#include <xcb/xcb_image.h>
// Some older versions of xcb/util-renderutil (notably the one available on Travis CI) use `template` as an argument name
@ -20,7 +20,7 @@ extern "C"
}
#undef template
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -8,7 +8,7 @@
#define NAZARA_CURSORIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <xcb/xcb_cursor.h>
#include <array>

View File

@ -1,14 +1,14 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/String.hpp>
#include <xcb/xcb_keysyms.h>
#include <map>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -8,8 +8,8 @@
#define NAZARA_X11DISPLAY_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Utility/WindowHandle.hpp>
#include <Nazara/Utility/X11/ScopedXCB.hpp>
#include <Nazara/Platform/WindowHandle.hpp>
#include <Nazara/Platform/X11/ScopedXCB.hpp>
typedef struct _XCBKeySymbols xcb_key_symbols_t;
@ -17,7 +17,7 @@ namespace Nz
{
class String;
class NAZARA_UTILITY_API X11
class NAZARA_PLATFORM_API X11
{
public:
X11() = delete;

View File

@ -1,14 +1,14 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/X11/IconImpl.hpp>
#include <Nazara/Platform/X11/IconImpl.hpp>
#include <Nazara/Core/CallOnExit.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -8,7 +8,7 @@
#define NAZARA_ICONIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Utility/X11/ScopedXCB.hpp>
#include <Nazara/Platform/X11/ScopedXCB.hpp>
namespace Nz
{

View File

@ -1,16 +1,16 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/X11/InputImpl.hpp>
#include <Nazara/Platform/X11/InputImpl.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Platform/Window.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#include <X11/keysym.h>
#include <X11/XF86keysym.h>
#include <X11/Xlib.h>
#include <xcb/xcb_keysyms.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -10,8 +10,8 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/String.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/Mouse.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#include <Nazara/Platform/Mouse.hpp>
namespace Nz
{

View File

@ -1,12 +1,12 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/X11/ScopedXCB.hpp>
#include <Nazara/Platform/X11/ScopedXCB.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#include <xcb/xcb_image.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -95,6 +95,6 @@ namespace Nz
};
}
#include <Nazara/Utility/X11/ScopedXCB.inl>
#include <Nazara/Platform/X11/ScopedXCB.inl>
#endif // NAZARA_SCOPEDXCB_HPP

View File

@ -1,9 +1,9 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{
@ -44,4 +44,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Platform/DebugOff.hpp>

View File

@ -1,14 +1,14 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/X11/VideoModeImpl.hpp>
#include <Nazara/Platform/X11/VideoModeImpl.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#include <xcb/randr.h>
#include <algorithm>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz
{

View File

@ -1,5 +1,5 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
@ -8,7 +8,7 @@
#define NAZARA_VIDEOMODEIMPL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Platform/VideoMode.hpp>
namespace Nz
{

View File

@ -1,26 +1,26 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Un grand merci à Laurent Gomila pour la SFML qui m'aura bien aidé à réaliser cette implémentation
#include <Nazara/Utility/X11/WindowImpl.hpp>
#include <Nazara/Platform/X11/WindowImpl.hpp>
#include <Nazara/Core/CallOnExit.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Utility/Event.hpp>
#include <Nazara/Utility/Icon.hpp>
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Utility/X11/CursorImpl.hpp>
#include <Nazara/Utility/X11/IconImpl.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/Event.hpp>
#include <Nazara/Platform/Icon.hpp>
#include <Nazara/Platform/VideoMode.hpp>
#include <Nazara/Platform/Window.hpp>
#include <Nazara/Platform/X11/CursorImpl.hpp>
#include <Nazara/Platform/X11/IconImpl.hpp>
#include <X11/keysym.h>
#include <X11/XF86keysym.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <xcb/xcb_cursor.h>
#include <xcb/xcb_keysyms.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Platform/Debug.hpp>
/*
Things to do left:

View File

@ -1,5 +1,5 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Platform module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
@ -12,9 +12,9 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/Thread.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/Keyboard.hpp>
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <Nazara/Platform/Keyboard.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#include <xcb/randr.h>
#include <xcb/xcb_icccm.h>

View File

@ -10,7 +10,7 @@
#include <Nazara/Renderer/Context.hpp>
#include <Nazara/Renderer/RenderTarget.hpp>
#if defined(NAZARA_PLATFORM_GLX)
#include <Nazara/Utility/X11/Display.hpp>
#include <Nazara/Platform/X11/Display.hpp>
#endif // NAZARA_PLATFORM_GLX
#include <cstring>
#include <set>

View File

@ -25,6 +25,7 @@
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Utility/VertexBuffer.hpp>
#include <Nazara/Utility/VertexDeclaration.hpp>
#include <Nazara/Platform/Platform.hpp>
#include <map>
#include <memory>
#include <set>
@ -579,9 +580,9 @@ namespace Nz
}
// Initialisation des dépendances
if (!Utility::Initialize())
if (!Platform::Initialize())
{
NazaraError("Failed to initialize Utility module");
NazaraError("Failed to initialize Platform module");
return false;
}
@ -1402,7 +1403,7 @@ namespace Nz
NazaraNotice("Uninitialized: Renderer module");
// Libération des dépendances
Utility::Uninitialize();
Platform::Uninitialize();
}
void Renderer::EnableInstancing(bool instancing)

View File

@ -6,21 +6,15 @@
#include <Nazara/Core/CallOnExit.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/HardwareInfo.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/TaskScheduler.hpp>
#include <Nazara/Core/Thread.hpp>
#include <Nazara/Utility/Animation.hpp>
#include <Nazara/Utility/Buffer.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Cursor.hpp>
#include <Nazara/Utility/Font.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/VertexDeclaration.hpp>
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Utility/Formats/DDSLoader.hpp>
#include <Nazara/Utility/Formats/FreeTypeLoader.hpp>
#include <Nazara/Utility/Formats/MD2Loader.hpp>
@ -35,15 +29,29 @@
namespace Nz
{
/*!
* \ingroup utility
* \class Nz::Utility
* \brief Utility class that represents the module initializer of Utility
*/
/*!
* \brief Initializes the Utility module
* \return true if initialization is successful
*
* \remark Produces a NazaraNotice
* \remark Produces a NazaraError if one submodule failed
*/
bool Utility::Initialize()
{
if (s_moduleReferenceCounter > 0)
{
s_moduleReferenceCounter++;
return true; // Déjà initialisé
return true; // Already initialized
}
// Initialisation des dépendances
// Initialisation of dependencies
if (!Core::Initialize())
{
NazaraError("Failed to initialize core module");
@ -103,23 +111,6 @@ namespace Nz
return false;
}
bool bParam;
if (!s_initializationParameters.GetBooleanParameter("NoWindowSystem", &bParam) || !bParam)
{
if (!Window::Initialize())
{
NazaraError("Failed to initialize window's system");
return false;
}
// Must be initialized after Window
if (!Cursor::Initialize())
{
NazaraError("Failed to initialize cursors");
return false;
}
}
// On enregistre les loaders pour les extensions
// Il s'agit ici d'une liste LIFO, le dernier loader enregistré possède la priorité
@ -159,11 +150,6 @@ namespace Nz
return s_moduleReferenceCounter != 0;
}
void Utility::SetParameters(const ParameterList& parameters)
{
s_initializationParameters = parameters;
}
void Utility::Uninitialize()
{
if (s_moduleReferenceCounter != 1)
@ -188,9 +174,6 @@ namespace Nz
Loaders::UnregisterSTBLoader();
Loaders::UnregisterSTBSaver();
Cursor::Uninitialize(); //< Must be done before Window
Window::Uninitialize();
VertexDeclaration::Uninitialize();
Skeleton::Uninitialize();
PixelFormat::Uninitialize();
@ -246,6 +229,5 @@ namespace Nz
static_assert(ComponentType_Max+1 == 14, "Component stride array is incomplete");
ParameterList Utility::s_initializationParameters;
unsigned int Utility::s_moduleReferenceCounter = 0;
}

View File

@ -25,7 +25,7 @@ Ndk::EntityHandle AddCamera(Ndk::World& world, Nz::RenderWindow& window);
- Text entered is never repeated
*/
SCENARIO("EventHandler", "[UTILITY][EVENTHANDLER][INTERACTIVE][.]")
SCENARIO("EventHandler", "[PLATFORM][EVENTHANDLER][INTERACTIVE][.]")
{
GIVEN("An application")
{

View File

@ -0,0 +1,39 @@
#include "BaseState.hpp"
#include "StateContext.hpp"
#include "StateFactory.hpp"
#include <Nazara/Renderer/RenderWindow.hpp>
#include <NDK/StateMachine.hpp>
BaseState::BaseState(StateContext& context) :
State(),
m_context(context),
m_text(context)
{
}
BaseState::~BaseState()
{
}
void BaseState::Enter(Ndk::StateMachine& fsm)
{
m_text.SetVisible(true);
DrawMenu();
}
void BaseState::Leave(Ndk::StateMachine& /*fsm*/)
{
m_text.SetVisible(false);
}
bool BaseState::Update(Ndk::StateMachine& /*fsm*/, float /*elapsedTime*/)
{
return true;
}
void BaseState::DrawMenu()
{
m_text.SetContent("This shouldn't be visible\nM for Menu");
}

Some files were not shown because too many files have changed in this diff Show More