Merge branch 'master' into vulkan
This commit is contained in:
@@ -136,6 +136,8 @@ namespace Nz
|
||||
{
|
||||
friend CullingList;
|
||||
|
||||
using ParentType = Entry<CullTest::Box>;
|
||||
|
||||
public:
|
||||
BoxEntry();
|
||||
BoxEntry(BoxEntry&&) = default;
|
||||
@@ -154,6 +156,8 @@ namespace Nz
|
||||
{
|
||||
friend CullingList;
|
||||
|
||||
using ParentType = Entry<CullTest::NoTest>;
|
||||
|
||||
public:
|
||||
NoTestEntry();
|
||||
NoTestEntry(NoTestEntry&&) = default;
|
||||
@@ -170,6 +174,8 @@ namespace Nz
|
||||
{
|
||||
friend CullingList;
|
||||
|
||||
using ParentType = Entry<CullTest::Sphere>;
|
||||
|
||||
public:
|
||||
SphereEntry();
|
||||
SphereEntry(SphereEntry&&) = default;
|
||||
@@ -188,6 +194,8 @@ namespace Nz
|
||||
{
|
||||
friend CullingList;
|
||||
|
||||
using ParentType = Entry<CullTest::Volume>;
|
||||
|
||||
public:
|
||||
VolumeEntry();
|
||||
VolumeEntry(VolumeEntry&&) = default;
|
||||
|
||||
@@ -424,13 +424,13 @@ namespace Nz
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::BoxEntry::BoxEntry() :
|
||||
Entry<CullTest::Box>()
|
||||
ParentType()
|
||||
{
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::BoxEntry::BoxEntry(CullingList* parent, std::size_t index) :
|
||||
Entry<CullTest::Box>(parent, index)
|
||||
ParentType(parent, index)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -444,13 +444,13 @@ namespace Nz
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::NoTestEntry::NoTestEntry() :
|
||||
Entry<CullTest::NoTest>()
|
||||
ParentType()
|
||||
{
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::NoTestEntry::NoTestEntry(CullingList* parent, std::size_t index) :
|
||||
Entry<CullTest::NoTest>(parent, index)
|
||||
ParentType(parent, index)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -458,13 +458,13 @@ namespace Nz
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::SphereEntry::SphereEntry() :
|
||||
Entry<CullTest::Sphere>()
|
||||
ParentType()
|
||||
{
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::SphereEntry::SphereEntry(CullingList* parent, std::size_t index) :
|
||||
Entry<CullTest::Sphere>(parent, index)
|
||||
ParentType(parent, index)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -478,13 +478,13 @@ namespace Nz
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::VolumeEntry::VolumeEntry() :
|
||||
Entry<CullTest::Volume>()
|
||||
ParentType()
|
||||
{
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
CullingList<T>::VolumeEntry::VolumeEntry(CullingList* parent, std::size_t index) :
|
||||
Entry<CullTest::Volume>(parent, index)
|
||||
ParentType(parent, index)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace Nz
|
||||
WindowEventType_Moved,
|
||||
WindowEventType_Quit,
|
||||
WindowEventType_Resized,
|
||||
WindowEventType_TextEdited,
|
||||
WindowEventType_TextEntered,
|
||||
|
||||
WindowEventType_Max = WindowEventType_TextEntered
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#ifndef NAZARA_EVENT_HPP
|
||||
#define NAZARA_EVENT_HPP
|
||||
|
||||
#include <array>
|
||||
|
||||
#include <Nazara/Platform/Enums.hpp>
|
||||
#include <Nazara/Platform/Keyboard.hpp>
|
||||
#include <Nazara/Platform/Mouse.hpp>
|
||||
@@ -22,7 +24,8 @@ namespace Nz
|
||||
// -WindowEventType_KeyReleased
|
||||
struct KeyEvent
|
||||
{
|
||||
Keyboard::Key code;
|
||||
Keyboard::Scancode scancode;
|
||||
Keyboard::VKey virtualKey;
|
||||
bool alt;
|
||||
bool control;
|
||||
bool repeated;
|
||||
@@ -83,6 +86,14 @@ namespace Nz
|
||||
char32_t character;
|
||||
};
|
||||
|
||||
// Used by:
|
||||
// -WindowEventType_TextEdited
|
||||
struct EditEvent
|
||||
{
|
||||
int length;
|
||||
std::array<char, 32> text;
|
||||
};
|
||||
|
||||
WindowEventType type;
|
||||
|
||||
union
|
||||
@@ -116,6 +127,10 @@ namespace Nz
|
||||
// Used by:
|
||||
// -WindowEventType_TextEntered
|
||||
TextEvent text;
|
||||
|
||||
// Used by:
|
||||
// -WindowEventType_TextEntered
|
||||
EditEvent edit;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace Nz
|
||||
NazaraSignal(OnQuit, const EventHandler* /*eventHandler*/);
|
||||
NazaraSignal(OnResized, const EventHandler* /*eventHandler*/, const WindowEvent::SizeEvent& /*event*/);
|
||||
NazaraSignal(OnTextEntered, const EventHandler* /*eventHandler*/, const WindowEvent::TextEvent& /*event*/);
|
||||
NazaraSignal(OnTextEdited, const EventHandler* /*eventHandler*/, const WindowEvent::EditEvent& /*event*/);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,10 @@ namespace Nz
|
||||
case WindowEventType_TextEntered:
|
||||
OnTextEntered(this, event.text);
|
||||
break;
|
||||
|
||||
case WindowEventType_TextEdited:
|
||||
OnTextEdited(this, event.edit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Nz
|
||||
class NAZARA_PLATFORM_API Keyboard
|
||||
{
|
||||
public:
|
||||
enum Key
|
||||
enum class Scancode
|
||||
{
|
||||
Undefined = -1,
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace Nz
|
||||
Decimal,
|
||||
Divide,
|
||||
Multiply,
|
||||
NumpadReturn,
|
||||
Numpad0,
|
||||
Numpad1,
|
||||
Numpad2,
|
||||
@@ -135,6 +136,8 @@ namespace Nz
|
||||
Space,
|
||||
Tab,
|
||||
Tilde,
|
||||
Menu,
|
||||
ISOBackslash102,
|
||||
|
||||
// Navigator keys
|
||||
Browser_Back,
|
||||
@@ -161,14 +164,169 @@ namespace Nz
|
||||
NumLock,
|
||||
ScrollLock,
|
||||
|
||||
Count
|
||||
Max = ScrollLock
|
||||
};
|
||||
|
||||
enum class VKey
|
||||
{
|
||||
Undefined = -1,
|
||||
|
||||
// Lettres
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
D,
|
||||
E,
|
||||
F,
|
||||
G,
|
||||
H,
|
||||
I,
|
||||
J,
|
||||
K,
|
||||
L,
|
||||
M,
|
||||
N,
|
||||
O,
|
||||
P,
|
||||
Q,
|
||||
R,
|
||||
S,
|
||||
T,
|
||||
U,
|
||||
V,
|
||||
W,
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
|
||||
// Functional keys
|
||||
F1,
|
||||
F2,
|
||||
F3,
|
||||
F4,
|
||||
F5,
|
||||
F6,
|
||||
F7,
|
||||
F8,
|
||||
F9,
|
||||
F10,
|
||||
F11,
|
||||
F12,
|
||||
F13,
|
||||
F14,
|
||||
F15,
|
||||
|
||||
// Directional keys
|
||||
Down,
|
||||
Left,
|
||||
Right,
|
||||
Up,
|
||||
|
||||
// Numerical pad
|
||||
Add,
|
||||
Decimal,
|
||||
Divide,
|
||||
Multiply,
|
||||
NumpadReturn,
|
||||
Numpad0,
|
||||
Numpad1,
|
||||
Numpad2,
|
||||
Numpad3,
|
||||
Numpad4,
|
||||
Numpad5,
|
||||
Numpad6,
|
||||
Numpad7,
|
||||
Numpad8,
|
||||
Numpad9,
|
||||
Subtract,
|
||||
|
||||
// Various
|
||||
Backslash,
|
||||
Backspace,
|
||||
Clear,
|
||||
Comma,
|
||||
Dash,
|
||||
Delete,
|
||||
End,
|
||||
Equal,
|
||||
Escape,
|
||||
Home,
|
||||
Insert,
|
||||
LAlt,
|
||||
LBracket,
|
||||
LControl,
|
||||
LShift,
|
||||
LSystem,
|
||||
Num0,
|
||||
Num1,
|
||||
Num2,
|
||||
Num3,
|
||||
Num4,
|
||||
Num5,
|
||||
Num6,
|
||||
Num7,
|
||||
Num8,
|
||||
Num9,
|
||||
PageDown,
|
||||
PageUp,
|
||||
Pause,
|
||||
Period,
|
||||
Print,
|
||||
PrintScreen,
|
||||
Quote,
|
||||
RAlt,
|
||||
RBracket,
|
||||
RControl,
|
||||
Return,
|
||||
RShift,
|
||||
RSystem,
|
||||
Semicolon,
|
||||
Slash,
|
||||
Space,
|
||||
Tab,
|
||||
Tilde,
|
||||
Menu,
|
||||
ISOBackslash102,
|
||||
|
||||
// Navigator keys
|
||||
Browser_Back,
|
||||
Browser_Favorites,
|
||||
Browser_Forward,
|
||||
Browser_Home,
|
||||
Browser_Refresh,
|
||||
Browser_Search,
|
||||
Browser_Stop,
|
||||
|
||||
// Lecture control keys
|
||||
Media_Next,
|
||||
Media_Play,
|
||||
Media_Previous,
|
||||
Media_Stop,
|
||||
|
||||
// Volume control keys
|
||||
Volume_Down,
|
||||
Volume_Mute,
|
||||
Volume_Up,
|
||||
|
||||
// Locking keys
|
||||
CapsLock,
|
||||
NumLock,
|
||||
ScrollLock,
|
||||
|
||||
Max = ScrollLock
|
||||
};
|
||||
|
||||
Keyboard() = delete;
|
||||
~Keyboard() = delete;
|
||||
|
||||
static String GetKeyName(Key key);
|
||||
static bool IsKeyPressed(Key key);
|
||||
static String GetKeyName(Scancode scancode);
|
||||
static String GetKeyName(VKey key);
|
||||
static bool IsKeyPressed(Scancode scancode);
|
||||
static bool IsKeyPressed(VKey key);
|
||||
static void StartTextInput();
|
||||
static void StopTextInput();
|
||||
static Scancode ToScanCode(VKey key);
|
||||
static VKey ToVirtualKey(Scancode key);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace Nz
|
||||
static Vector2i GetPosition();
|
||||
static Vector2i GetPosition(const Window& relativeTo);
|
||||
static bool IsButtonPressed(Button button);
|
||||
static bool SetRelativeMouseMode(bool relativeMouseMode);
|
||||
static void SetPosition(const Vector2i& position);
|
||||
static void SetPosition(const Vector2i& position, const Window& relativeTo, bool ignoreEvent = true);
|
||||
static void SetPosition(int x, int y);
|
||||
|
||||
@@ -32,12 +32,12 @@ namespace Nz
|
||||
static const std::vector<VideoMode>& GetFullscreenModes();
|
||||
};
|
||||
|
||||
bool operator==(const VideoMode& left, const VideoMode& right);
|
||||
bool operator!=(const VideoMode& left, const VideoMode& right);
|
||||
bool operator<(const VideoMode& left, const VideoMode& right);
|
||||
bool operator<=(const VideoMode& left, const VideoMode& right);
|
||||
bool operator>(const VideoMode& left, const VideoMode& right);
|
||||
bool operator>=(const VideoMode& left, const VideoMode& right);
|
||||
bool NAZARA_PLATFORM_API operator==(const VideoMode& left, const VideoMode& right);
|
||||
bool NAZARA_PLATFORM_API operator!=(const VideoMode& left, const VideoMode& right);
|
||||
bool NAZARA_PLATFORM_API operator<(const VideoMode& left, const VideoMode& right);
|
||||
bool NAZARA_PLATFORM_API operator<=(const VideoMode& left, const VideoMode& right);
|
||||
bool NAZARA_PLATFORM_API operator>(const VideoMode& left, const VideoMode& right);
|
||||
bool NAZARA_PLATFORM_API operator>=(const VideoMode& left, const VideoMode& right);
|
||||
}
|
||||
|
||||
#endif // NAZARA_VIDEOMODE_HPP
|
||||
|
||||
@@ -32,13 +32,14 @@ namespace Nz
|
||||
class NAZARA_PLATFORM_API Window
|
||||
{
|
||||
friend WindowImpl;
|
||||
friend class EventImpl;
|
||||
friend class Mouse;
|
||||
friend class Platform;
|
||||
|
||||
public:
|
||||
Window();
|
||||
inline Window(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default);
|
||||
inline explicit Window(WindowHandle handle);
|
||||
inline explicit Window(void* handle);
|
||||
Window(const Window&) = delete;
|
||||
Window(Window&& window);
|
||||
virtual ~Window();
|
||||
@@ -46,7 +47,7 @@ namespace Nz
|
||||
inline void Close();
|
||||
|
||||
bool Create(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default);
|
||||
bool Create(WindowHandle handle);
|
||||
bool Create(void* handle);
|
||||
|
||||
void Destroy();
|
||||
|
||||
@@ -61,10 +62,10 @@ namespace Nz
|
||||
inline const CursorRef& GetCursor() const;
|
||||
inline CursorController& GetCursorController();
|
||||
inline EventHandler& GetEventHandler();
|
||||
WindowHandle GetHandle() const;
|
||||
Vector2i GetPosition() const;
|
||||
Vector2ui GetSize() const;
|
||||
WindowStyleFlags GetStyle() const;
|
||||
WindowHandle GetSystemHandle() const;
|
||||
String GetTitle() const;
|
||||
|
||||
bool HasFocus() const;
|
||||
@@ -106,6 +107,8 @@ namespace Nz
|
||||
Window& operator=(Window&& window);
|
||||
|
||||
protected:
|
||||
void* GetHandle();
|
||||
|
||||
virtual bool OnWindowCreated();
|
||||
virtual void OnWindowDestroy();
|
||||
virtual void OnWindowResized();
|
||||
@@ -116,6 +119,9 @@ namespace Nz
|
||||
void ConnectSlots();
|
||||
void DisconnectSlots();
|
||||
|
||||
inline WindowImpl* GetImpl();
|
||||
inline const WindowImpl* GetImpl() const;
|
||||
|
||||
void IgnoreNextMouseEvent(int mouseX, int mouseY) const;
|
||||
void HandleEvent(const WindowEvent& event);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Nz
|
||||
Create(mode, title, style);
|
||||
}
|
||||
|
||||
inline Window::Window(WindowHandle handle) :
|
||||
inline Window::Window(void* handle) :
|
||||
Window()
|
||||
{
|
||||
ErrorFlags flags(ErrorFlag_ThrowException, true);
|
||||
@@ -109,6 +109,16 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline WindowImpl* Window::GetImpl()
|
||||
{
|
||||
return m_impl;
|
||||
}
|
||||
|
||||
inline const WindowImpl* Window::GetImpl() const
|
||||
{
|
||||
return m_impl;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Platform/DebugOff.hpp>
|
||||
|
||||
@@ -8,21 +8,44 @@
|
||||
#define NAZARA_WINDOWHANDLE_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#if defined(NAZARA_PLATFORM_X11)
|
||||
#include <xcb/xcb.h>
|
||||
#endif
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
// http://msdn.microsoft.com/en-us/library/aa383751(v=vs.85).aspx
|
||||
using WindowHandle = void*;
|
||||
#elif defined(NAZARA_PLATFORM_X11)
|
||||
// http://en.wikipedia.org/wiki/Xlib#Data_types
|
||||
using WindowHandle = xcb_window_t;
|
||||
#else
|
||||
#error Lack of implementation: WindowHandle
|
||||
#endif
|
||||
enum class WindowManager
|
||||
{
|
||||
None,
|
||||
|
||||
X11,
|
||||
Wayland,
|
||||
Windows
|
||||
};
|
||||
|
||||
struct WindowHandle
|
||||
{
|
||||
WindowManager type = WindowManager::None;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
void* display; //< Display*
|
||||
void* window; //< Window
|
||||
} x11;
|
||||
|
||||
struct
|
||||
{
|
||||
void* display; //< wl_display*
|
||||
void* surface; //< wl_surface*
|
||||
void* shellSurface; //< wl_shell_surface*
|
||||
} wayland;
|
||||
|
||||
struct
|
||||
{
|
||||
void* window; //< HWND
|
||||
} windows;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_WINDOWHANDLE_HPP
|
||||
|
||||
@@ -117,21 +117,17 @@
|
||||
#endif
|
||||
#elif defined(__linux__) || defined(__unix__)
|
||||
#define NAZARA_PLATFORM_LINUX
|
||||
#define NAZARA_PLATFORM_GLX
|
||||
#define NAZARA_PLATFORM_POSIX
|
||||
#define NAZARA_PLATFORM_X11
|
||||
|
||||
#define NAZARA_EXPORT __attribute__((visibility ("default")))
|
||||
#define NAZARA_IMPORT __attribute__((visibility ("default")))
|
||||
/*#elif defined(__APPLE__) && defined(__MACH__)
|
||||
#define NAZARA_CORE_API
|
||||
#define NAZARA_PLATFORM_MACOSX
|
||||
#define NAZARA_PLATFORM_POSIX*/
|
||||
#define NAZARA_PLATFORM_MACOSX
|
||||
#define NAZARA_PLATFORM_POSIX*/
|
||||
#else
|
||||
#error This operating system is not fully supported by the Nazara Engine
|
||||
|
||||
#define NAZARA_PLATFORM_UNKNOWN
|
||||
#define NAZARA_CORE_API
|
||||
#endif
|
||||
|
||||
// Detect 64 bits
|
||||
|
||||
@@ -25,26 +25,26 @@ namespace Nz
|
||||
{
|
||||
public:
|
||||
inline RenderWindow();
|
||||
inline RenderWindow(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default, const RenderWindowParameters& parameters = RenderWindowParameters());
|
||||
inline explicit RenderWindow(WindowHandle handle, const RenderWindowParameters& parameters = RenderWindowParameters());
|
||||
inline RenderWindow(VideoMode mode, const String &title, WindowStyleFlags style = WindowStyle_Default, const RenderWindowParameters ¶meters = RenderWindowParameters());
|
||||
inline explicit RenderWindow(void *handle, const RenderWindowParameters ¶meters = RenderWindowParameters());
|
||||
inline ~RenderWindow();
|
||||
|
||||
inline bool Create(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default, const RenderWindowParameters& parameters = RenderWindowParameters());
|
||||
inline bool Create(WindowHandle handle, const RenderWindowParameters& parameters = RenderWindowParameters());
|
||||
inline bool Create(VideoMode mode, const String &title, WindowStyleFlags style = WindowStyle_Default, const RenderWindowParameters ¶meters = RenderWindowParameters());
|
||||
inline bool Create(void *handle, const RenderWindowParameters ¶meters = RenderWindowParameters());
|
||||
|
||||
void Display();
|
||||
|
||||
void EnableVerticalSync(bool enabled);
|
||||
|
||||
inline RenderWindowImpl* GetImpl();
|
||||
inline RenderWindowImpl *GetImpl();
|
||||
std::shared_ptr<RenderDevice> GetRenderDevice();
|
||||
|
||||
inline bool IsValid() const;
|
||||
|
||||
inline void SetFramerateLimit(unsigned int limit);
|
||||
|
||||
RenderWindow& operator=(const RenderWindow&) = delete;
|
||||
RenderWindow& operator=(RenderWindow&&) = delete; ///TODO
|
||||
RenderWindow &operator=(const RenderWindow &) = delete;
|
||||
RenderWindow &operator=(RenderWindow &&) = delete; ///TODO
|
||||
|
||||
protected:
|
||||
bool OnWindowCreated() override;
|
||||
@@ -57,8 +57,8 @@ namespace Nz
|
||||
std::unique_ptr<RenderSurface> m_surface;
|
||||
RenderWindowParameters m_parameters;
|
||||
unsigned int m_framerateLimit;
|
||||
};
|
||||
}
|
||||
};
|
||||
} // namespace Nz
|
||||
|
||||
#include <Nazara/Renderer/RenderWindow.inl>
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ namespace Nz
|
||||
|
||||
inline SimpleTextDrawer::SimpleTextDrawer(const SimpleTextDrawer& drawer) :
|
||||
m_color(drawer.m_color),
|
||||
m_outlineColor(drawer.m_outlineColor),
|
||||
m_text(drawer.m_text),
|
||||
m_style(drawer.m_style),
|
||||
m_colorUpdated(false),
|
||||
m_glyphUpdated(false),
|
||||
m_outlineColor(drawer.m_outlineColor),
|
||||
m_characterSpacingOffset(drawer.m_characterSpacingOffset),
|
||||
m_lineSpacingOffset(drawer.m_lineSpacingOffset),
|
||||
m_maxLineWidth(drawer.m_maxLineWidth),
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace Ndk
|
||||
|
||||
bool HasFocus() const;
|
||||
|
||||
inline void Hide();
|
||||
inline bool IsVisible() const;
|
||||
|
||||
void Resize(const Nz::Vector2f& size);
|
||||
@@ -125,9 +126,12 @@ namespace Ndk
|
||||
virtual void OnMouseExit();
|
||||
virtual void OnParentResized(const Nz::Vector2f& newSize);
|
||||
virtual void OnTextEntered(char32_t character, bool repeated);
|
||||
virtual void OnTextEdited(const std::array<char, 32>& characters, int length);
|
||||
|
||||
inline void SetPreferredSize(const Nz::Vector2f& preferredSize);
|
||||
|
||||
virtual void ShowChildren(bool show);
|
||||
|
||||
private:
|
||||
inline BaseWidget();
|
||||
|
||||
|
||||
@@ -172,6 +172,11 @@ namespace Ndk
|
||||
return m_children.size();
|
||||
}
|
||||
|
||||
inline void BaseWidget::Hide()
|
||||
{
|
||||
return Show(false);
|
||||
}
|
||||
|
||||
inline bool BaseWidget::IsVisible() const
|
||||
{
|
||||
return m_visible;
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace Ndk
|
||||
void OnEventKeyPressed(const Nz::EventHandler* eventHandler, const Nz::WindowEvent::KeyEvent& event);
|
||||
void OnEventKeyReleased(const Nz::EventHandler* eventHandler, const Nz::WindowEvent::KeyEvent& event);
|
||||
void OnEventTextEntered(const Nz::EventHandler* eventHandler, const Nz::WindowEvent::TextEvent& event);
|
||||
void OnEventTextEdited(const Nz::EventHandler* eventHandler, const Nz::WindowEvent::EditEvent& event);
|
||||
|
||||
struct WidgetEntry
|
||||
{
|
||||
@@ -73,6 +74,7 @@ namespace Ndk
|
||||
NazaraSlot(Nz::EventHandler, OnMouseMoved, m_mouseMovedSlot);
|
||||
NazaraSlot(Nz::EventHandler, OnMouseWheelMoved, m_mouseWheelMovedSlot);
|
||||
NazaraSlot(Nz::EventHandler, OnTextEntered, m_textEnteredSlot);
|
||||
NazaraSlot(Nz::EventHandler, OnTextEdited, m_textEditedSlot);
|
||||
|
||||
std::size_t m_keyboardOwner;
|
||||
std::size_t m_hoveredWidget;
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Ndk
|
||||
m_mouseMovedSlot.Connect(eventHandler.OnMouseMoved, this, &Canvas::OnEventMouseMoved);
|
||||
m_mouseWheelMovedSlot.Connect(eventHandler.OnMouseWheelMoved, this, &Canvas::OnEventMouseWheelMoved);
|
||||
m_textEnteredSlot.Connect(eventHandler.OnTextEntered, this, &Canvas::OnEventTextEntered);
|
||||
m_textEditedSlot.Connect(eventHandler.OnTextEdited, this, &Canvas::OnEventTextEdited);
|
||||
}
|
||||
|
||||
inline Canvas::~Canvas()
|
||||
|
||||
@@ -20,7 +20,8 @@ namespace Ndk
|
||||
*
|
||||
* \param physics PhysicsComponent2D to copy
|
||||
*/
|
||||
inline PhysicsComponent2D::PhysicsComponent2D(const PhysicsComponent2D& physics)
|
||||
inline PhysicsComponent2D::PhysicsComponent2D(const PhysicsComponent2D& physics) :
|
||||
m_nodeSynchronizationEnabled(physics.m_nodeSynchronizationEnabled)
|
||||
{
|
||||
CopyPhysicsState(*physics.GetRigidBody());
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Ndk
|
||||
World* m_world;
|
||||
};
|
||||
|
||||
class NDK_API EntityList::iterator : public std::iterator<std::forward_iterator_tag, const EntityHandle>
|
||||
class NDK_API EntityList::iterator
|
||||
{
|
||||
friend EntityList;
|
||||
|
||||
@@ -73,6 +73,12 @@ namespace Ndk
|
||||
|
||||
friend inline void swap(iterator& lhs, iterator& rhs);
|
||||
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
using pointer = EntityHandle*;
|
||||
using reference = EntityHandle&;
|
||||
using value_type = EntityHandle;
|
||||
|
||||
private:
|
||||
inline iterator(const EntityList* world, std::size_t nextId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user