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
125 changed files with 1049 additions and 782 deletions

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;
};
}