diff options
Diffstat (limited to 'Source/Asura.Engine/Graphics')
40 files changed, 1043 insertions, 0 deletions
diff --git a/Source/Asura.Engine/Graphics/Animation.cpp b/Source/Asura.Engine/Graphics/Animation.cpp new file mode 100644 index 0000000..47643aa --- /dev/null +++ b/Source/Asura.Engine/Graphics/Animation.cpp @@ -0,0 +1,21 @@ +#include "Animation.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + void Animation::OnEnable() + { + mSpriteRenderer = mGameObject->GetComponent<SpriteRenderer*>(); + } + + void Animation::OnUpdate(uint32 milliseconds) + { + if (!mSpriteRenderer) + return; + mSpriteRenderer->SetSprite(NULL); + } + + } +} diff --git a/Source/Asura.Engine/Graphics/Animation.h b/Source/Asura.Engine/Graphics/Animation.h new file mode 100644 index 0000000..391da22 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Animation.h @@ -0,0 +1,128 @@ +#ifndef __AE_ANIMATION_H__ +#define __AE_ANIMATION_H__ + +#include "Sprite.h" +#include "Component.h" +#include "Manager.hpp" +#include "SpriteRenderer.h" +#include "Containers/Map.h" +#include "Containers/Vector.hpp" +#include "Containers/StringMap.hpp" +#include "Filesystem/Asset.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// ؼ֡ + /// + struct Frame + { + uint mask; // + float time; + Sprite* sprite; + }; + + /// + /// SpriteԸıspriteĴСתšimageAnimationͨanimatorġ + /// + class Animation final : public Filesystem::Asset + { + public: + + enum UpdateMask + { + Scale = 1, + Position = 1 << 1, + Rotation = 1 << 2, + Sprite = 1 << 3 + }; + + struct Definition + { + + }; + + /// + /// ʱһ֡ + /// + Frame GetFrame(float t); + + /// + /// ùؼ֡ + /// + uint GetKeyFrameCount(); + + /// + /// Ƿѭ + /// + uint GetLoop(); + + /// + /// ȡʱ + /// + uint GetDuration(); + + private: + + /// + /// ؼ֡ + /// + Containers::Vector<Frame> mFrames; + + /// + /// ʱ + /// + float mDuration; + + /// + /// Ƿѭ + /// + bool mLoop; + + /// + /// ID + /// + uint mID; + + UpdateMask mUpdateMask; + + }; + + class AnimationManager : public Manager + { + public: + + Containers::String GetAnimationName(uint ID); + + uint GetAnimationID(const Containers::String& name); + + Animation* GetAnimation(uint ID); + + Animation* GetAnimation(const Containers::String& name); + + /// + /// ӶID + /// + uint AddAnimation(Animation* animation); + + private: + + /// + /// ӳIDanimation + /// + Containers::StringMap<uint> mAnimationIDs; + + /// + /// ӳkeyanimation + /// + Containers::Map<uint, Animation*> mAnimations; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Animator.cpp b/Source/Asura.Engine/Graphics/Animator.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Animator.cpp diff --git a/Source/Asura.Engine/Graphics/Animator.h b/Source/Asura.Engine/Graphics/Animator.h new file mode 100644 index 0000000..4d3d269 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Animator.h @@ -0,0 +1,96 @@ +#ifndef __AE_ANIMATOR_H__ +#define __AE_ANIMATOR_H__ + +#include "Component.h" +#include "Animation.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// animationҪΪanimationĴ + /// + class Animator final : public Component + { + public: + + void OnEnable() override; + void OnUpdate(uint32 milliseconds) override; + + /// + /// animation + /// + void SetAnimation(uint ID); + + /// + /// animation + /// + void SetAnimation(Animation* animation); + + /// + /// animation״̬ + /// + void SetTime(float time); + + /// + /// IJٶ + /// + void SetSpeed(float speed); + + /// + /// Ƿѭ + /// + void SetLoop(bool isloop); + + /// + /// ݹؼ֡animation + /// + void SetKeyFrame(uint keyFrame); + + /// + /// õ + /// + void SetToBegin(); + + /// + /// õʼ + /// + void SetToEnd(); + + /// + /// ͣ + /// + void Pause(); + + private: + + /// + /// ǰanimation + /// + Animation* mAnimation; + + /// + /// AnimationҪһsprite renderer + /// + SpriteRenderer* mSpriteRenderer; + + /// + /// ٶȣĬΪ1dt = mSpeed * DELTA_TIME + /// + float mSpeed; + + /// + /// ǰִеʱ + /// + float mTime; + + bool mLoop; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Camera.cpp b/Source/Asura.Engine/Graphics/Camera.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Camera.cpp diff --git a/Source/Asura.Engine/Graphics/Camera.h b/Source/Asura.Engine/Graphics/Camera.h new file mode 100644 index 0000000..699d342 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Camera.h @@ -0,0 +1,42 @@ +#ifndef __AE_CAMERA_H__ +#define __AE_CAMERA_H__ + +#include "RenderTarget.h" +#include "Component.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// Orthographic Camera. + /// + class Camera : public Component + { + public: + + + private: + + /// + /// ȾĿ + /// + RenderTarget* mRenderTarget; + + /// + /// ǷȾĻ + /// + bool mIsOnScreen; + + /// + /// ü + /// + bool mIsCulling; + + }; + + } +} + +#endif diff --git a/Source/Asura.Engine/Graphics/Canvas.cpp b/Source/Asura.Engine/Graphics/Canvas.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Canvas.cpp diff --git a/Source/Asura.Engine/Graphics/Canvas.h b/Source/Asura.Engine/Graphics/Canvas.h new file mode 100644 index 0000000..cd78194 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Canvas.h @@ -0,0 +1,20 @@ +#ifndef __AE_Canvas_H__ +#define __AE_Canvas_H__ + +#include "Component.h" +#include "Texture.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + class Canvas : public Texture, public Component + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/CanvasRenderer.cpp b/Source/Asura.Engine/Graphics/CanvasRenderer.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/CanvasRenderer.cpp diff --git a/Source/Asura.Engine/Graphics/CanvasRenderer.h b/Source/Asura.Engine/Graphics/CanvasRenderer.h new file mode 100644 index 0000000..ef188a5 --- /dev/null +++ b/Source/Asura.Engine/Graphics/CanvasRenderer.h @@ -0,0 +1,30 @@ +#ifndef __AE_CANVAS_RENDERER_H__ +#define __AE_CANVAS_RENDERER_H__ + +#include "Canvas.h" +#include "Renderer.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + class CanvasRenderer : public Renderer + { + public: + + void SetCanvas(Canvas* canvas); + Canvas* GetCanvas(); + + void SetBlendMode(); + + private: + + Canvas * mCanvas; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Color.cpp b/Source/Asura.Engine/Graphics/Color.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Color.cpp diff --git a/Source/Asura.Engine/Graphics/Color.h b/Source/Asura.Engine/Graphics/Color.h new file mode 100644 index 0000000..f172156 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Color.h @@ -0,0 +1,30 @@ +#ifndef __AE_COLOR_H__ +#define __AE_COLOR_H__ + +#include "Type.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// 32bitsɫ + /// + class Color + { + public: + + Color(byte r, byte g, byte b, byte a); + ~Color(); + + private: + + byte mR, mG, mB, mA; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Image.cpp b/Source/Asura.Engine/Graphics/Image.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Image.cpp diff --git a/Source/Asura.Engine/Graphics/Image.h b/Source/Asura.Engine/Graphics/Image.h new file mode 100644 index 0000000..5b27079 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Image.h @@ -0,0 +1,119 @@ +#ifndef __AE_IMAGE_H__ +#define __AE_IMAGE_H__ + +#include "Math/Vector2.h" +#include "Manager.hpp" +#include "Texture.h" +#include "Color.h" +#include "Factory.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + class ImageFactory; + + /// + /// ImageͼƬڴȡϷĽһImageڴ桢ԴֻᱣһݣҪ + /// imageêλãźתǶȣʹspriteһֻࡣ + /// + class Image final : public Texture, public Filesystem::Asset + { + public: + + uint GetWidth(); + uint GetHeight(); + + /// + /// ijһλõ + /// + Color GetPixel(uint x, uint y); + + private: + + friend class ImageFactory; + + Image(Color* pixels, int width, int height); + ~Image(); + + /// + /// СΪλ + /// + uint mWidth, mHeight; + Color* mPixels; + + /// + /// ID + /// + uint mID; + + }; + + /// + /// + /// + class ImageManager : public Manager + { + public: + + /// + /// ͨIDȡ·dzͼƬString::Null + /// + Containers::String GetImagePath(uint ID); + + /// + /// ͨID·ȡIDûҵ0 + /// + uint GetImageID(const Containers::String& path); + + Image* GetImage(const Containers::String& path); + + Image* GetImage(const Containers::String& ID); + + uint AddImage(const Containers::String& path, Image* image); + + uint AddImage(Image* image); + + bool RemoveImage(uint ID); + + bool RemoveImage(Image* image); + + private: + + /// + /// еimage + /// + Containers::Map<uint, Image*> mImages; + + /// + /// image·IDӳ䡣Դ.asrimageͨ·õimageԲеimageڴmapС + /// ɳimageֻͨIDȡԳҪID + /// + Containers::StringMap<uint> mImageIDs; + + }; + + /// + /// + /// + class ImageFactory : public Factory + { + public: + + /// + /// image pixelйimage + /// + Image* ReadBuffer(Color* pixels, int width, int height); + + /// + /// image externݲ + /// + Image* Decode(); + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Material.cpp b/Source/Asura.Engine/Graphics/Material.cpp new file mode 100644 index 0000000..eaf9742 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Material.cpp @@ -0,0 +1,18 @@ +#include "Material.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + + + //-------------------------------------------------------------------------------------------------------- + + int Material::l_SetColor(lua_State* L) + { + + } + + } +} diff --git a/Source/Asura.Engine/Graphics/Material.h b/Source/Asura.Engine/Graphics/Material.h new file mode 100644 index 0000000..1cb3c88 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Material.h @@ -0,0 +1,189 @@ +#ifndef __AE_MATERIAL_H__ +#define __AE_MATERIAL_H__ + +#include "Containers/Vector.hpp" +#include "Containers/String.h" +#include "Math/Vector2.h" +#include "Math/Vector3.h" +#include "Math/Vector4.h" +#include "Math/Matrix44.h" +#include "Scripting/Luax.hpp" + +#include "Shader.h" +#include "Texture.h" +#include "Manager.hpp" + +namespace AsuraEngine +{ + namespace Graphics + { + + class MaterialFactory; + + /// + /// ͨʵShaderеuniformsShaderĵı¶materialÿʿԲ컯ͬɫ + /// ͬͨļ(.mat)ʵ֣ڴáAsuraУShaderֱӦõȾ̶һ + /// ʹɲshaderuniformsmaterial䵱shaderĴ + /// + class Material final : public Filesystem::Asset + { + public: + + enum class UniformsType + { + None = 0, + Float, + Int, + Vector2, + Vector3, + Vector4, + Matrix44, + Texture, + Color, + }; + + struct UniformsInfo + { + uint ID; // uniformID + UniformsType type; // uniform + union + { + float f; + int i; + Math::Vector2 v2; + Math::Vector3 v3; + Math::Vector4 v4; + Math::Matrix44 m44; + Texture* tex; + Color col; + }value; // uniformֵ + }; + + void SetShader(Shader* shader); + + // UniformڲУȾʱϴGPU + + /// + /// uniformIDIDnamemapshader乲uniformֵʱͨIDѯuniform + /// shaderҵuniform locationlocationֵ + /// + static int GetUniformID(const Containers::String& name); + + void SetTexture(uint ID, Texture* texture); + void SetVector2(uint ID, Math::Vector2* vector2); + void SetVector3(uint ID, Math::Vector3* vector3); + void SetVector4(uint ID, Math::Vector4* vector4); + void SetMatrix44(uint ID, Math::Matrix44* matrix44); + void SetFloat(uint ID, float value); + void SetInteger(uint ID, int value); + void SetColor(uint ID, Color color); + + UniformsInfo GetUniformInfo(uint ID); + float GetUniformInfof(uint ID); + int GetUniformInfoi(uint ID); + Math::Vector2 GetUniformInfov2(uint ID); + Math::Vector3 GetUniformInfov3(uint ID); + Math::Vector4 GetUniformInfov4(uint ID); + Math::Matrix44 GetUniformInfom44(uint ID); + Texture* GetUniformInfotex(uint ID); + Color GetUniformInfocol(uint ID); + + // ϴ + + void SetVertexAttributes(); + + private: + + friend class MaterialFactory; + + Material(); + Material(const Material& src); + ~Material(); + + /// + /// + /// + uint mID; + + /// + /// + /// + Shader* mShader; + + /// + /// UniformsֵӳIDֵ + /// + Containers::Map<int, UniformsInfo> mUniforms; + + /// + /// ǷǹIJ + /// + bool mIsShared; + + //---------------------------------------------------------------------------------------------------- + + LUAX_DECL_FACTORY(Material); + + LUAX_DECL_METHOD(l_Clone); + + LUAX_DECL_METHOD(l_SetShader); + + LUAX_DECL_METHOD(l_SetTexture); + LUAX_DECL_METHOD(l_SetVector2); + LUAX_DECL_METHOD(l_SetVector3); + LUAX_DECL_METHOD(l_SetVector4); + LUAX_DECL_METHOD(l_SetMatrix44); + LUAX_DECL_METHOD(l_SetFloat); + LUAX_DECL_METHOD(l_SetInteger); + LUAX_DECL_METHOD(l_SetColor); + + LUAX_DECL_METHOD(l_GetUniformInfo); + LUAX_DECL_METHOD(l_GetUniformInfof); + LUAX_DECL_METHOD(l_GetUniformInfoi); + LUAX_DECL_METHOD(l_GetUniformInfov2); + LUAX_DECL_METHOD(l_GetUniformInfov3); + LUAX_DECL_METHOD(l_GetUniformInfov4); + LUAX_DECL_METHOD(l_GetUniformInfom44); + LUAX_DECL_METHOD(l_GetUniformInfotex); + LUAX_DECL_METHOD(l_GetUniformInfocol); + + LUAX_DECL_METHOD(l_SetVertexAttributes); + + }; + + class MaterialManager : public Manager + { + public: + + private: + + /// + /// еimage + /// + Containers::Map<uint, Image*> mImages; + + /// + /// image·IDӳ䡣Դ.asrimageͨ·õimageԲеimageڴmapС + /// ɳimageֻͨIDȡԳҪID + /// + Containers::StringMap<uint> mImageIDs; + + }; + + class MaterialFactory : public Factory + { + public: + + /// + /// һmaterial + /// + Material* Clone(Material* src); + + Material* Create(); + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Mesh2D.cpp b/Source/Asura.Engine/Graphics/Mesh2D.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Mesh2D.cpp diff --git a/Source/Asura.Engine/Graphics/Mesh2D.h b/Source/Asura.Engine/Graphics/Mesh2D.h new file mode 100644 index 0000000..a113f4c --- /dev/null +++ b/Source/Asura.Engine/Graphics/Mesh2D.h @@ -0,0 +1,20 @@ +#ifndef __AE_MESH2D_H__ +#define __AE_MESH2D_H__ + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// 2D meshһЩUV + /// + class Mesh2D + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp b/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp diff --git a/Source/Asura.Engine/Graphics/Mesh2DRenderer.h b/Source/Asura.Engine/Graphics/Mesh2DRenderer.h new file mode 100644 index 0000000..fcbfd2c --- /dev/null +++ b/Source/Asura.Engine/Graphics/Mesh2DRenderer.h @@ -0,0 +1,19 @@ +#ifndef __AE_MESH2D_H__ +#define __AE_MESH2D_H__ + +#include "FileSystem/Asset.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + class Mesh2D : public Filesystem::Asset + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/OpenGL.cpp b/Source/Asura.Engine/Graphics/OpenGL.cpp new file mode 100644 index 0000000..ec23f52 --- /dev/null +++ b/Source/Asura.Engine/Graphics/OpenGL.cpp @@ -0,0 +1,11 @@ +#include "OpenGL.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + + + } +}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/OpenGL.h b/Source/Asura.Engine/Graphics/OpenGL.h new file mode 100644 index 0000000..f46497b --- /dev/null +++ b/Source/Asura.Engine/Graphics/OpenGL.h @@ -0,0 +1,17 @@ +#ifndef __AE_OPENGL_H__ +#define __AE_OPENGL_H__ + +namespace AsuraEngine +{ + namespace Graphics + { + + class OpenGL + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/ParticleSystem.cpp b/Source/Asura.Engine/Graphics/ParticleSystem.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/ParticleSystem.cpp diff --git a/Source/Asura.Engine/Graphics/ParticleSystem.h b/Source/Asura.Engine/Graphics/ParticleSystem.h new file mode 100644 index 0000000..078427a --- /dev/null +++ b/Source/Asura.Engine/Graphics/ParticleSystem.h @@ -0,0 +1,22 @@ +#ifndef __AE_PARTICLESYSTEM_H__ +#define __AE_PARTICLESYSTEM_H__ + +#include "Component.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// ϵͳ + /// + class ParticleSystem final : public Component + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Prefab.cpp b/Source/Asura.Engine/Graphics/Prefab.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Prefab.cpp diff --git a/Source/Asura.Engine/Graphics/Prefab.h b/Source/Asura.Engine/Graphics/Prefab.h new file mode 100644 index 0000000..82a8da2 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Prefab.h @@ -0,0 +1,30 @@ +#ifndef __AE_PREFAB_H__ +#define __AE_PREFAB_H__ + +#include "Manager.hpp" +#include "FileSystem/Asset.h" + +namespace AsuraEngine +{ + + /// + /// PrefabGameObject + /// + class Prefab : public Filesystem::Asset + { + + }; + + class PrefabManager : public Manager + { + + }; + + class PrefabFactory + { + + }; + +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Renderer.cpp b/Source/Asura.Engine/Graphics/Renderer.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Renderer.cpp diff --git a/Source/Asura.Engine/Graphics/Renderer.h b/Source/Asura.Engine/Graphics/Renderer.h new file mode 100644 index 0000000..c3677a7 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Renderer.h @@ -0,0 +1,39 @@ +#ifndef __AE_RENDERER_H__ +#define __AE_RENDERER_H__ + +#include "Component.h" +#include "Material.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// ࣬ȾRendererദÿRenderer߱һʡ + /// + class Renderer : public Component + { + public: + + /// + /// һô˷ͻ´shared materialô˷ζҪmaterialýģʱʹõIJ + /// shared materialҪһݣӰrenderer + /// + Material* GetMaterial(); + + /// + /// Ⱦص + /// + virtual void OnRender() = 0; + + protected: + + Material* mMaterial; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Shader.cpp b/Source/Asura.Engine/Graphics/Shader.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Shader.cpp diff --git a/Source/Asura.Engine/Graphics/Shader.h b/Source/Asura.Engine/Graphics/Shader.h new file mode 100644 index 0000000..c3c67ad --- /dev/null +++ b/Source/Asura.Engine/Graphics/Shader.h @@ -0,0 +1,67 @@ +#ifndef __AE_SHADER_H__ +#define __AE_SHADER_H__ + +#include "luax/luax.h" + +#include "FileSystem/Asset.h" +#include "Containers/Map.h" +#include "Containers/StringMap.hpp" +#include "Object.h" +#include "Color.h" +#include "Manager.hpp" + +namespace AsuraEngine +{ + namespace Graphics + { + + class Material; + + /// + /// һshaderһڲʼ乲ijShaderuniformsͶݣֻuniforms location + /// + class Shader final : public Filesystem::Asset + { + public: + + Shader(); + ~Shader(); + + private: + + friend class Material; + + /// + /// shaderuniformsIDӳ䡣 + /// + static Containers::StringMap<int> sUniformsID; + + /// + /// uniformID + /// + static int GetUniformID(const Containers::String& name); + + /// + /// ñ + /// vec2 Asura_Time xֵΪ뵱ǰʼʱ䣬yֵΪһ֡ʱ + /// vec2 Asura_RenderTargetSize RTĴСΪλ + /// Texture Asura_MainTexture + /// + void SetBuiltInUniforms(); + + /// + /// ӳuniforms IDlocation + /// + Containers::Map<int, int> mLocations; + + }; + + class ShaderManager final : public Manager + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/ShapeRenderer.cpp b/Source/Asura.Engine/Graphics/ShapeRenderer.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/ShapeRenderer.cpp diff --git a/Source/Asura.Engine/Graphics/ShapeRenderer.h b/Source/Asura.Engine/Graphics/ShapeRenderer.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/ShapeRenderer.h diff --git a/Source/Asura.Engine/Graphics/Sprite.cpp b/Source/Asura.Engine/Graphics/Sprite.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Sprite.cpp diff --git a/Source/Asura.Engine/Graphics/Sprite.h b/Source/Asura.Engine/Graphics/Sprite.h new file mode 100644 index 0000000..b621f1b --- /dev/null +++ b/Source/Asura.Engine/Graphics/Sprite.h @@ -0,0 +1,71 @@ +#ifndef __AE_SPRITE_H__ +#define __AE_SPRITE_H__ + +#include "Math/Vector2.h" +#include "Transform.h" +#include "Component.h" +#include "Image.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// SpriteǿimageĴimagesprite乲ݣspriteimageԣתŵȡ + /// + class Sprite final : public Filesystem::Asset + { + public: + + enum Type + { + + }; + + /// + /// 뷽ʽ + /// + enum Align + { + + }; + + struct SpriteDef + { + Image* image; + Align align; + Math::Vector2 anchor; + Math::Vector2 size; + }; + + Sprite(SpriteDef definition); + ~Sprite(); + + private: + + /// + /// ê + /// + Math::Vector2 mAnchor; + + /// + /// С + /// + Math::Vector2 mSize; + + /// + /// image + /// + Image* mImage; + + //---------------------------------------------------------------------------------------------------- + + + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/SpriteBatch.cpp b/Source/Asura.Engine/Graphics/SpriteBatch.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/SpriteBatch.cpp diff --git a/Source/Asura.Engine/Graphics/SpriteBatch.h b/Source/Asura.Engine/Graphics/SpriteBatch.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/SpriteBatch.h diff --git a/Source/Asura.Engine/Graphics/SpriteRenderer.cpp b/Source/Asura.Engine/Graphics/SpriteRenderer.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/SpriteRenderer.cpp diff --git a/Source/Asura.Engine/Graphics/SpriteRenderer.h b/Source/Asura.Engine/Graphics/SpriteRenderer.h new file mode 100644 index 0000000..bd81509 --- /dev/null +++ b/Source/Asura.Engine/Graphics/SpriteRenderer.h @@ -0,0 +1,32 @@ +#ifndef __AE_SPRITE_RENDERER_H__ +#define __AE_SPRITE_RENDERER_H__ + +#include "Renderer.h" +#include "Sprite.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + class SpriteRenderer final : public Renderer + { + public: + + void SetSprite(Sprite* sprite); + + void OnRender() override; + + private: + + /// + /// Ⱦsprite + /// + Sprite* mSprite; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Texture.cpp b/Source/Asura.Engine/Graphics/Texture.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Texture.cpp diff --git a/Source/Asura.Engine/Graphics/Texture.h b/Source/Asura.Engine/Graphics/Texture.h new file mode 100644 index 0000000..8195fc9 --- /dev/null +++ b/Source/Asura.Engine/Graphics/Texture.h @@ -0,0 +1,22 @@ +#ifndef __AE_TEXTURE_H__ +#define __AE_TEXTURE_H__ + +#include "Object.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// 2Dࣩ2d meshrender targetбʹ + /// + class Texture : public Object + { + + }; + + } +} + +#endif
\ No newline at end of file |