add: noncopyable.hpp
This commit is contained in:
parent
9bd216dc92
commit
18990c3ee6
|
|
@ -21,6 +21,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "base.hpp"
|
#include "base.hpp"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
|
#include "noncopyable.hpp"
|
||||||
#include "intrusive/List.hpp"
|
#include "intrusive/List.hpp"
|
||||||
|
|
||||||
namespace easy2d
|
namespace easy2d
|
||||||
|
|
@ -31,8 +32,6 @@ namespace easy2d
|
||||||
: public RefCounter
|
: public RefCounter
|
||||||
, protected intrusive::ListItem<spAction>
|
, protected intrusive::ListItem<spAction>
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Action);
|
|
||||||
|
|
||||||
friend class ActionManager;
|
friend class ActionManager;
|
||||||
friend class Loop;
|
friend class Loop;
|
||||||
friend class Sequence;
|
friend class Sequence;
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,6 @@ namespace easy2d
|
||||||
class Loop
|
class Loop
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Loop);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Loop(
|
explicit Loop(
|
||||||
spAction const& action, /* 执行循环的动作 */
|
spAction const& action, /* 执行循环的动作 */
|
||||||
|
|
@ -66,8 +64,6 @@ namespace easy2d
|
||||||
class Sequence
|
class Sequence
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Sequence);
|
|
||||||
|
|
||||||
using Actions = std::vector<spAction>;
|
using Actions = std::vector<spAction>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -115,8 +111,6 @@ namespace easy2d
|
||||||
class Spawn
|
class Spawn
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Spawn);
|
|
||||||
|
|
||||||
using Actions = std::vector<spAction>;
|
using Actions = std::vector<spAction>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@ namespace easy2d
|
||||||
class FiniteTimeAction
|
class FiniteTimeAction
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(FiniteTimeAction);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// 创建特定时长的持续动作
|
// 创建特定时长的持续动作
|
||||||
explicit FiniteTimeAction(
|
explicit FiniteTimeAction(
|
||||||
|
|
@ -56,8 +54,6 @@ namespace easy2d
|
||||||
class MoveBy
|
class MoveBy
|
||||||
: public FiniteTimeAction
|
: public FiniteTimeAction
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(MoveBy);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MoveBy(
|
explicit MoveBy(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -88,8 +84,6 @@ namespace easy2d
|
||||||
class MoveTo
|
class MoveTo
|
||||||
: public MoveBy
|
: public MoveBy
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(MoveTo);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MoveTo(
|
explicit MoveTo(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -119,8 +113,6 @@ namespace easy2d
|
||||||
class JumpBy
|
class JumpBy
|
||||||
: public FiniteTimeAction
|
: public FiniteTimeAction
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(JumpBy);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit JumpBy(
|
explicit JumpBy(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -155,8 +147,6 @@ namespace easy2d
|
||||||
class JumpTo
|
class JumpTo
|
||||||
: public JumpBy
|
: public JumpBy
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(JumpTo);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit JumpTo(
|
explicit JumpTo(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -188,8 +178,6 @@ namespace easy2d
|
||||||
class ScaleBy
|
class ScaleBy
|
||||||
: public FiniteTimeAction
|
: public FiniteTimeAction
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(ScaleBy);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ScaleBy(
|
explicit ScaleBy(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -227,8 +215,6 @@ namespace easy2d
|
||||||
class ScaleTo
|
class ScaleTo
|
||||||
: public ScaleBy
|
: public ScaleBy
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(ScaleTo);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ScaleTo(
|
explicit ScaleTo(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -265,8 +251,6 @@ namespace easy2d
|
||||||
class OpacityBy
|
class OpacityBy
|
||||||
: public FiniteTimeAction
|
: public FiniteTimeAction
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(OpacityBy);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit OpacityBy(
|
explicit OpacityBy(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -296,8 +280,6 @@ namespace easy2d
|
||||||
class OpacityTo
|
class OpacityTo
|
||||||
: public OpacityBy
|
: public OpacityBy
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(OpacityTo);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit OpacityTo(
|
explicit OpacityTo(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -327,8 +309,6 @@ namespace easy2d
|
||||||
class FadeIn
|
class FadeIn
|
||||||
: public OpacityTo
|
: public OpacityTo
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(FadeIn);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// 创建淡入动作
|
// 创建淡入动作
|
||||||
explicit FadeIn(
|
explicit FadeIn(
|
||||||
|
|
@ -341,8 +321,6 @@ namespace easy2d
|
||||||
class FadeOut
|
class FadeOut
|
||||||
: public OpacityTo
|
: public OpacityTo
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(FadeOut);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// 创建淡出动作
|
// 创建淡出动作
|
||||||
explicit FadeOut(
|
explicit FadeOut(
|
||||||
|
|
@ -355,8 +333,6 @@ namespace easy2d
|
||||||
class RotateBy
|
class RotateBy
|
||||||
: public FiniteTimeAction
|
: public FiniteTimeAction
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(RotateBy);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RotateBy(
|
explicit RotateBy(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -386,8 +362,6 @@ namespace easy2d
|
||||||
class RotateTo
|
class RotateTo
|
||||||
: public RotateBy
|
: public RotateBy
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(RotateTo);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RotateTo(
|
explicit RotateTo(
|
||||||
Duration const& duration, /* 持续时长 */
|
Duration const& duration, /* 持续时长 */
|
||||||
|
|
@ -417,8 +391,6 @@ namespace easy2d
|
||||||
class Delay
|
class Delay
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Delay);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Delay(
|
explicit Delay(
|
||||||
Duration const& duration /* 延迟时长(秒) */
|
Duration const& duration /* 延迟时长(秒) */
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,6 @@ namespace easy2d
|
||||||
class Animation
|
class Animation
|
||||||
: public RefCounter
|
: public RefCounter
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Animation);
|
|
||||||
|
|
||||||
using Images = std::vector< spImage >;
|
using Images = std::vector< spImage >;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -86,8 +84,6 @@ namespace easy2d
|
||||||
class Animate
|
class Animate
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Animate);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Animate();
|
Animate();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@ namespace easy2d
|
||||||
class CallFunc
|
class CallFunc
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(CallFunc);
|
|
||||||
|
|
||||||
typedef std::function<void()> Callback;
|
typedef std::function<void()> Callback;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ namespace easy2d
|
||||||
class CanvasBrush
|
class CanvasBrush
|
||||||
: public RefCounter
|
: public RefCounter
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(CanvasBrush);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CanvasBrush();
|
CanvasBrush();
|
||||||
|
|
||||||
|
|
@ -138,8 +136,6 @@ namespace easy2d
|
||||||
class Canvas
|
class Canvas
|
||||||
: public Node
|
: public Node
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Canvas);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Canvas();
|
Canvas();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,8 @@ namespace easy2d
|
||||||
|
|
||||||
|
|
||||||
class Game
|
class Game
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Game);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Game();
|
Game();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -191,4 +191,5 @@ namespace easy2d
|
||||||
{
|
{
|
||||||
return bitmap_;
|
return bitmap_;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -28,8 +28,6 @@ namespace easy2d
|
||||||
class Image
|
class Image
|
||||||
: public RefCounter
|
: public RefCounter
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Image);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Image();
|
Image();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,10 @@ namespace easy2d
|
||||||
namespace devices
|
namespace devices
|
||||||
{
|
{
|
||||||
class InputDevice
|
class InputDevice
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DECLARE_SINGLETON(InputDevice);
|
E2D_DECLARE_SINGLETON(InputDevice);
|
||||||
|
|
||||||
E2D_DISABLE_COPY(InputDevice);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Init(bool debug);
|
void Init(bool debug);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ namespace easy2d
|
||||||
class Music
|
class Music
|
||||||
: public RefCounter
|
: public RefCounter
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Music);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Music();
|
Music();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,6 @@ namespace easy2d
|
||||||
friend class Transition;
|
friend class Transition;
|
||||||
friend class intrusive::List<spNode>;
|
friend class intrusive::List<spNode>;
|
||||||
|
|
||||||
E2D_DISABLE_COPY(Node);
|
|
||||||
|
|
||||||
using Nodes = std::vector<spNode>;
|
using Nodes = std::vector<spNode>;
|
||||||
using Children = intrusive::List<spNode>;
|
using Children = intrusive::List<spNode>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,18 +20,14 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
#include "noncopyable.hpp"
|
||||||
|
|
||||||
namespace easy2d
|
namespace easy2d
|
||||||
{
|
{
|
||||||
class RefCounter
|
class RefCounter
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(RefCounter);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RefCounter() : ref_count_(0) {}
|
|
||||||
|
|
||||||
virtual ~RefCounter() {}
|
|
||||||
|
|
||||||
// 增加引用计数
|
// 增加引用计数
|
||||||
inline void Retain() { ++ref_count_; }
|
inline void Retain() { ++ref_count_; }
|
||||||
|
|
||||||
|
|
@ -45,7 +41,12 @@ namespace easy2d
|
||||||
// 获取引用计数
|
// 获取引用计数
|
||||||
inline long GetRefCount() const { return ref_count_; }
|
inline long GetRefCount() const { return ref_count_; }
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
RefCounter() : ref_count_(0) {}
|
||||||
|
|
||||||
|
~RefCounter() {}
|
||||||
|
|
||||||
|
protected:
|
||||||
long ref_count_;
|
long ref_count_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,6 @@ namespace easy2d
|
||||||
class Scene
|
class Scene
|
||||||
: public Node
|
: public Node
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Scene);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Scene();
|
Scene();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,34 +19,29 @@
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "noncopyable.hpp"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace easy2d
|
namespace easy2d
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class ISingleton
|
class ISingleton
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static inline T* Instance();
|
static inline T* Instance()
|
||||||
|
|
||||||
private:
|
|
||||||
ISingleton() {}
|
|
||||||
|
|
||||||
~ISingleton() {}
|
|
||||||
|
|
||||||
ISingleton(const ISingleton&) = delete;
|
|
||||||
|
|
||||||
ISingleton & operator= (const ISingleton &) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline T* easy2d::ISingleton<T>::Instance()
|
|
||||||
{
|
{
|
||||||
static std::unique_ptr<T> instance_;
|
static std::unique_ptr<T> instance_;
|
||||||
if (!instance_)
|
if (!instance_)
|
||||||
instance_.reset(new (std::nothrow) T);
|
instance_.reset(new (std::nothrow) T);
|
||||||
return instance_.get();
|
return instance_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ISingleton() = default;
|
||||||
|
|
||||||
|
~ISingleton() {}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Class that will implement the singleton mode,
|
// Class that will implement the singleton mode,
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace easy2d
|
||||||
{
|
{
|
||||||
if (!image_)
|
if (!image_)
|
||||||
{
|
{
|
||||||
image_ = new (std::nothrow) Image();
|
image_ = new (std::nothrow) Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image_)
|
if (image_)
|
||||||
|
|
@ -99,7 +99,7 @@ namespace easy2d
|
||||||
{
|
{
|
||||||
if (!image_)
|
if (!image_)
|
||||||
{
|
{
|
||||||
image_ = new (std::nothrow) Image();
|
image_ = new (std::nothrow) Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image_)
|
if (image_)
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@ namespace easy2d
|
||||||
class Sprite
|
class Sprite
|
||||||
: public Node
|
: public Node
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Sprite);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Sprite();
|
Sprite();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ namespace easy2d
|
||||||
class Text
|
class Text
|
||||||
: public Node
|
: public Node
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Text);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Text();
|
Text();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,14 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include "Singleton.hpp"
|
#include "Singleton.hpp"
|
||||||
|
#include "noncopyable.hpp"
|
||||||
#include <xaudio2.h>
|
#include <xaudio2.h>
|
||||||
|
|
||||||
namespace easy2d
|
namespace easy2d
|
||||||
{
|
{
|
||||||
class Voice
|
class Voice
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Voice);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Voice();
|
Voice();
|
||||||
|
|
||||||
|
|
@ -75,11 +75,10 @@ namespace easy2d
|
||||||
namespace devices
|
namespace devices
|
||||||
{
|
{
|
||||||
class AudioDevice
|
class AudioDevice
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DECLARE_SINGLETON(AudioDevice);
|
E2D_DECLARE_SINGLETON(AudioDevice);
|
||||||
|
|
||||||
E2D_DISABLE_COPY(AudioDevice);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Init(bool debug);
|
void Init(bool debug);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,9 +97,3 @@
|
||||||
# define E2D_NOEXCEPT throw()
|
# define E2D_NOEXCEPT throw()
|
||||||
# define E2D_CONSTEXPR const
|
# define E2D_CONSTEXPR const
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define E2D_DISABLE_COPY(Class) \
|
|
||||||
private: \
|
|
||||||
Class(const Class &) = delete; \
|
|
||||||
Class & operator= (const Class &) = delete
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
// Copyright (c) 2016-2018 Easy2D - Nomango
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
|
||||||
|
namespace easy2d
|
||||||
|
{
|
||||||
|
class Noncopyable
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
Noncopyable() = default;
|
||||||
|
|
||||||
|
~Noncopyable() {};
|
||||||
|
|
||||||
|
private:
|
||||||
|
Noncopyable(const Noncopyable&) = delete;
|
||||||
|
|
||||||
|
Noncopyable& operator=(const Noncopyable&) = delete;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -47,11 +47,10 @@ namespace easy2d
|
||||||
|
|
||||||
|
|
||||||
class GraphicsDevice
|
class GraphicsDevice
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DECLARE_SINGLETON(GraphicsDevice);
|
E2D_DECLARE_SINGLETON(GraphicsDevice);
|
||||||
|
|
||||||
E2D_DISABLE_COPY(GraphicsDevice);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Init(HWND hwnd, bool debug);
|
void Init(HWND hwnd, bool debug);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,10 @@ namespace easy2d
|
||||||
|
|
||||||
|
|
||||||
class WindowImpl
|
class WindowImpl
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DECLARE_SINGLETON(WindowImpl);
|
E2D_DECLARE_SINGLETON(WindowImpl);
|
||||||
|
|
||||||
E2D_DISABLE_COPY(WindowImpl);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Init(
|
void Init(
|
||||||
String title,
|
String title,
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
#include "base/Transform.hpp"
|
#include "base/Transform.hpp"
|
||||||
#include "base/TextStyle.hpp"
|
#include "base/TextStyle.hpp"
|
||||||
|
|
||||||
|
#include "base/noncopyable.hpp"
|
||||||
#include "base/intrusive/SmartPointer.hpp"
|
#include "base/intrusive/SmartPointer.hpp"
|
||||||
#include "base/intrusive/List.hpp"
|
#include "base/intrusive/List.hpp"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ namespace easy2d
|
||||||
class Button
|
class Button
|
||||||
: public Node
|
: public Node
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Button);
|
|
||||||
|
|
||||||
using Callback = std::function<void()>;
|
using Callback = std::function<void()>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ namespace easy2d
|
||||||
class Menu
|
class Menu
|
||||||
: public Node
|
: public Node
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Menu);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Menu();
|
Menu();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,8 @@ namespace easy2d
|
||||||
{
|
{
|
||||||
// 音乐播放器
|
// 音乐播放器
|
||||||
class Player
|
class Player
|
||||||
|
: protected Noncopyable
|
||||||
{
|
{
|
||||||
E2D_DISABLE_COPY(Player);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Player();
|
Player();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
<ClInclude Include="..\..\core\base\MouseEvent.h" />
|
<ClInclude Include="..\..\core\base\MouseEvent.h" />
|
||||||
<ClInclude Include="..\..\core\base\Music.h" />
|
<ClInclude Include="..\..\core\base\Music.h" />
|
||||||
<ClInclude Include="..\..\core\base\Node.h" />
|
<ClInclude Include="..\..\core\base\Node.h" />
|
||||||
|
<ClInclude Include="..\..\core\base\noncopyable.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\Point.hpp" />
|
<ClInclude Include="..\..\core\base\Point.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\Rect.hpp" />
|
<ClInclude Include="..\..\core\base\Rect.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\RefCounter.hpp" />
|
<ClInclude Include="..\..\core\base\RefCounter.hpp" />
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,9 @@
|
||||||
<ClInclude Include="..\..\core\base\d2dres.hpp">
|
<ClInclude Include="..\..\core\base\d2dres.hpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\core\base\noncopyable.hpp">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="base">
|
<Filter Include="base">
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
<ClInclude Include="..\..\core\base\MouseEvent.h" />
|
<ClInclude Include="..\..\core\base\MouseEvent.h" />
|
||||||
<ClInclude Include="..\..\core\base\Music.h" />
|
<ClInclude Include="..\..\core\base\Music.h" />
|
||||||
<ClInclude Include="..\..\core\base\Node.h" />
|
<ClInclude Include="..\..\core\base\Node.h" />
|
||||||
|
<ClInclude Include="..\..\core\base\noncopyable.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\Point.hpp" />
|
<ClInclude Include="..\..\core\base\Point.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\Rect.hpp" />
|
<ClInclude Include="..\..\core\base\Rect.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\RefCounter.hpp" />
|
<ClInclude Include="..\..\core\base\RefCounter.hpp" />
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,9 @@
|
||||||
<ClInclude Include="..\..\core\base\d2dres.hpp">
|
<ClInclude Include="..\..\core\base\d2dres.hpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\core\base\noncopyable.hpp">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="base">
|
<Filter Include="base">
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
<ClInclude Include="..\..\core\base\MouseEvent.h" />
|
<ClInclude Include="..\..\core\base\MouseEvent.h" />
|
||||||
<ClInclude Include="..\..\core\base\Music.h" />
|
<ClInclude Include="..\..\core\base\Music.h" />
|
||||||
<ClInclude Include="..\..\core\base\Node.h" />
|
<ClInclude Include="..\..\core\base\Node.h" />
|
||||||
|
<ClInclude Include="..\..\core\base\noncopyable.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\Point.hpp" />
|
<ClInclude Include="..\..\core\base\Point.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\Rect.hpp" />
|
<ClInclude Include="..\..\core\base\Rect.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\RefCounter.hpp" />
|
<ClInclude Include="..\..\core\base\RefCounter.hpp" />
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,9 @@
|
||||||
<ClInclude Include="..\..\core\base\d2dres.hpp">
|
<ClInclude Include="..\..\core\base\d2dres.hpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\core\base\noncopyable.hpp">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="base">
|
<Filter Include="base">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue