summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-06-08 08:34:52 +0800
committerchai <chaifix@163.com>2019-06-08 08:34:52 +0800
commitd7a972a0f16da0fd7bf4c0b70913920216ff3113 (patch)
treea9146629cbf513200462c3f1223a9e07f3e01862 /source
parent8bfe54676f728076a92d802bb5d064e58265c8f2 (diff)
*misc
Diffstat (limited to 'source')
-rw-r--r--source/external/Luax/luax_class.hpp44
-rw-r--r--source/modules/asura-core/core_module.cpp2
-rw-r--r--source/modules/asura-core/graphics/canvas.h9
-rw-r--r--source/modules/asura-core/graphics/gfx_device.h26
-rw-r--r--source/modules/asura-core/graphics/image.cpp1
-rw-r--r--source/modules/asura-core/graphics/image.h4
-rw-r--r--source/modules/asura-core/graphics/shader.cpp97
-rw-r--r--source/modules/asura-core/graphics/shader.h9
-rw-r--r--source/modules/asura-core/image/binding/_image_data.cpp2
-rw-r--r--source/modules/asura-core/image/binding/_image_decode_task.cpp2
-rw-r--r--source/modules/asura-core/image/image_data.cpp8
-rw-r--r--source/modules/asura-core/image/image_data.h8
-rw-r--r--source/modules/asura-core/image/image_decode_task.cpp19
-rw-r--r--source/modules/asura-core/image/image_decode_task.h16
-rw-r--r--source/modules/asura-core/image/image_decoder.h2
-rw-r--r--source/modules/asura-core/image/png_decoder.cpp2
-rw-r--r--source/modules/asura-core/image/png_decoder.h2
-rw-r--r--source/modules/asura-core/image/stb_decoder.cpp4
-rw-r--r--source/modules/asura-core/image/stb_decoder.h2
-rw-r--r--source/modules/asura-core/profiler/gpu_profiler.cpp0
-rw-r--r--source/modules/asura-core/profiler/gpu_profiler.h0
-rw-r--r--source/modules/asura-core/window/binding/_window.cpp1
-rw-r--r--source/modules/asura-core/window/window.h4
-rw-r--r--source/modules/asura-core/window/window_impl_sdl.cpp1
-rw-r--r--source/tests/win32/01-window/03_sub_menu.cpp5
25 files changed, 152 insertions, 118 deletions
diff --git a/source/external/Luax/luax_class.hpp b/source/external/Luax/luax_class.hpp
index c39138d..193ecff 100644
--- a/source/external/Luax/luax_class.hpp
+++ b/source/external/Luax/luax_class.hpp
@@ -19,11 +19,11 @@ namespace Luax
class LuaxVM;
- ///
- /// RegisterLuaxClass ע����ķ����ͳ�Ա������ö�١������ȵ�class table
- /// LuaxGetFactoryName ��ù�����������ͬʱ��������ע��ʱ����ע��Ϊ��singleton��ͨ������
- /// ʱ��������
- ///
+///
+/// RegisterLuaxClass ע����ķ����ͳ�Ա������ö�١������ȵ�class table
+/// LuaxGetFactoryName ��ù�����������ͬʱ��������ע��ʱ����ע��Ϊ��singleton��ͨ������
+/// ʱ��������
+///
#define LUAX_DECL_FACTORY(type, ...) \
friend class Luax::LuaxState; \
friend class Luax::LuaxNativeClass<type,##__VA_ARGS__>; \
@@ -33,18 +33,18 @@ namespace Luax
static const char* GetLuaxClassName() { return #type; };\
static bool IsLuaxClassSingleton() { return false; }
- ///
- /// ��Ϊ����ij��󹤳������ʹ�ô˺꣬ע��һ����ڣ����������ע�ắ���е��ã�ע��������Щ
- /// ������
- ///
+///
+/// ��Ϊ����ij��󹤳������ʹ�ô˺꣬ע��һ����ڣ����������ע�ắ���е��ã�ע��������Щ
+/// ������
+///
#define LUAX_DECL_ABSTRACT_FACTORY() \
static void RegisterLuaxClass(Luax::LuaxState&);\
static void RegisterLuaxPostprocess(Luax::LuaxState&)
- ///
- /// RegisterLuaxClass ע����ķ����ͳ�Ա������ö�١������ȵ�class table
- /// LuaxGetSingletonName ��õ���������
- ///
+///
+/// RegisterLuaxClass ע����ķ����ͳ�Ա������ö�١������ȵ�class table
+/// LuaxGetSingletonName ��õ���������
+///
#define LUAX_DECL_SINGLETON(type, ...) \
friend class Luax::LuaxState; \
friend class Luax::LuaxNativeClass<type,##__VA_ARGS__>; \
@@ -58,20 +58,20 @@ namespace Luax
#define LUAX_DECL_ENUM(e, under_line_index)
- ///
- /// ��������ʵ�ֵĺꡣ����������һ��L��
- ///
+///
+/// ��������ʵ�ֵĺꡣ����������һ��L��
+///
#define LUAX_IMPL_METHOD(type, f) int type::f(lua_State* L)
- ///
- /// ��Ӧ�ó���ʵ�ֵ������ӿڡ�����������һ��state��
- ///
+///
+/// ��Ӧ�ó���ʵ�ֵ������ӿڡ�����������һ��state��
+///
#define LUAX_REGISTRY(type) void type::RegisterLuaxClass(Luax::LuaxState& state)
#define LUAX_POSTPROCESS(type) void type::RegisterLuaxPostprocess(Luax::LuaxState& state)
- ///
- /// ����ע��ĺꡣ֮ǰ���������ÿɱ�꣬����û��luaclastable refû��ע��ԡ�
- ///
+///
+/// ����ע��ĺꡣ֮ǰ���������ÿɱ�꣬����û��luaclastable refû��ע��ԡ�
+///
#define LUAX_REGISTER_FACTORY(state, param) state.RegisterFactory<param>()
#define LUAX_REGISTER_SINGLETON(state, param) state.RegisterSingleton<param>()
#define LUAX_REGISTER_ABSTRACT_FACTORY(state, type) type::RegisterLuaxPostprocess(state)
diff --git a/source/modules/asura-core/core_module.cpp b/source/modules/asura-core/core_module.cpp
index 989ec3e..e91dd8f 100644
--- a/source/modules/asura-core/core_module.cpp
+++ b/source/modules/asura-core/core_module.cpp
@@ -10,7 +10,7 @@ namespace AsuraEngine
{
// Graphics
LUAX_REGISTER_ABSTRACT_FACTORY(state, Texture);
- LUAX_REGISTER_FACTORY(state, Image);
+ LUAX_REGISTER_FACTORY(state, AEGraphics::Image);
// Wnd
LUAX_REGISTER_SINGLETON(state, AEWindow::Window);
// Threading
diff --git a/source/modules/asura-core/graphics/canvas.h b/source/modules/asura-core/graphics/canvas.h
index 49096c7..4175561 100644
--- a/source/modules/asura-core/graphics/canvas.h
+++ b/source/modules/asura-core/graphics/canvas.h
@@ -47,19 +47,10 @@ namespace AsuraEngine
private:
- ///
- /// Frame buffer object id.
- ///
GLuint mFBO;
- ///
- /// �󶨵�tex
- ///
GLuint mTex;
- ///
- /// canvas�Ĵ�С
- ///
uint mWidth, mHeight;
public:
diff --git a/source/modules/asura-core/graphics/gfx_device.h b/source/modules/asura-core/graphics/gfx_device.h
index 5bb8c6a..c93717f 100644
--- a/source/modules/asura-core/graphics/gfx_device.h
+++ b/source/modules/asura-core/graphics/gfx_device.h
@@ -46,14 +46,8 @@ namespace AsuraEngine
GfxDevice();
~GfxDevice();
- ///
- /// ��ó���ֵ
- ///
int GetParam(GLParams param);
- ///
- /// ��ʼ��OpenGL�����IJ����������ڴ���OpenGL������֮�󡣴˺�����ע��OpenGL�����ĵ�ַ��
- ///
bool Init(const AEMath::Recti& viewport);
bool Inited();
@@ -64,12 +58,8 @@ namespace AsuraEngine
void UnuseShader();
Shader* GetShader();
- // Draw call.
void DrawArrays(GLenum mode, GLint first, GLsizei count);
- ///
- /// Matrix stack��ز���
- ///
void SetMatrixMode(MatrixMode mode);
MatrixMode GetMatrixMode();
void PushMatrix();
@@ -87,20 +77,10 @@ namespace AsuraEngine
void SetDrawColor(float r, float g, float b, float a);
Color& GetDrawColor();
- ///
- /// ����������ʾ
- ///
void WipeError();
bool HasError();
GLenum GetError();
- ///
- /// OpenGL3.0�Ժ����û���������任���ӿڡ�shader�Ȳ��������ﱣ��һЩOpenGL״̬��ע��
- /// �ƺ�ȫ���̵ģ�Ҳ����˵��Asura��֧�ֶ��߳���Ⱦ��OpenGL�����ĵĴ���ʹ��һ������
- /// �İ���һ��HDC\�����ϣ����ڴ��������ض��̴߳����ģ�����OpenGL������Ҳ����һ��
- /// �ض����̡߳�ͬһ���̵߳IJ�ͬHDC\���ڿ��Թ���ͬһ��OpenGL�����ġ�������������Ϊ��
- /// ���������������textuer\shader��handle��
- ///
struct
{
Shader* shader; ///< ��ǰʹ�õ�shader
@@ -113,9 +93,9 @@ namespace AsuraEngine
#if ASURA_GL_PROFILE
struct
{
- uint drawCall; ///< ͳ��drawcall
- uint canvasSwitch; ///< �л�texture�Ĵ���
- uint shaderSwitch; ///< �л�shader�Ĵ���
+ uint drawCall; ///< ͳ��drawcall
+ uint canvasSwitch; ///< �л�texture�Ĵ���
+ uint shaderSwitch; ///< �л�shader�Ĵ���
} stats;
#endif
diff --git a/source/modules/asura-core/graphics/image.cpp b/source/modules/asura-core/graphics/image.cpp
index d2f1d7b..42fc2ab 100644
--- a/source/modules/asura-core/graphics/image.cpp
+++ b/source/modules/asura-core/graphics/image.cpp
@@ -7,6 +7,7 @@
#include "gfx_device.h"
using namespace AEIO;
+using namespace AEImage;
namespace AsuraEngine
{
diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h
index 932ca65..8e3e7d3 100644
--- a/source/modules/asura-core/graphics/image.h
+++ b/source/modules/asura-core/graphics/image.h
@@ -44,8 +44,8 @@ namespace AsuraEngine
/// ���������ͼ�������ύ��GPU������������Ϣ���������¹���image��ʹ��glTexImage2D��
/// ���ύimage���������ݡ�
///
- bool Load(ImageData* decodeData);
- bool Load(ImageData* decodeData, const AEMath::Vector2i& pos);
+ bool Load(AEImage::ImageData* decodeData);
+ bool Load(AEImage::ImageData* decodeData, const AEMath::Vector2i& pos);
uint GetWidth();
uint GetHeight();
diff --git a/source/modules/asura-core/graphics/shader.cpp b/source/modules/asura-core/graphics/shader.cpp
index 866c4da..afd10b0 100644
--- a/source/modules/asura-core/graphics/shader.cpp
+++ b/source/modules/asura-core/graphics/shader.cpp
@@ -21,74 +21,97 @@ namespace AsuraEngine
Shader::~Shader()
{
- if(mVertShader != 0)
- glDeleteShader(mVertShader);
- if(mFragShader != 0)
- glDeleteShader(mFragShader);
- if(mProgram != 0)
- glDeleteProgram(mProgram);
+ if(mVertShader) glDeleteShader(mVertShader);
+ if(mFragShader) glDeleteShader(mFragShader);
+ if(mProgram) glDeleteProgram(mProgram);
}
bool Shader::Load(const string& vert, const string& frag)
{
- GLenum err = GL_NO_ERROR;
- GLint success;
string warnning = "";
- if (mProgram == 0)
+ if (!mProgram)
{
mProgram = glCreateProgram();
- if (mProgram == 0)
+ if (!mProgram)
throw Exception("Cannot create OpenGL shader program.");
}
- if (mVertShader == 0)
+ if (!CompileVertexShader(vert, warnning))
{
- mVertShader = glCreateShader(GL_VERTEX_SHADER);
- if (mVertShader == 0)
- throw Exception("Cannot create OpenGL vertex shader.");
+ throw Exception("Compile vertex shader failed:%s", warnning);
}
- if (mFragShader == 0)
+ if (!CompileFragementShader(frag, warnning))
{
- mFragShader = glCreateShader(GL_FRAGMENT_SHADER);
- if(mFragShader == 0)
- throw Exception("Cannot create OpenGL fragment shader.");
+ throw Exception("Compile fragment shader failed:%s", warnning);
}
- const GLchar* source;
+ glAttachShader(mProgram, mVertShader);
+ glAttachShader(mProgram, mFragShader);
+
+ glLinkProgram(mProgram);
+ GLint success;
+ glGetProgramiv(mProgram, GL_LINK_STATUS, &success);
+ if (success == GL_FALSE)
+ {
+ warnning = GetProgramWarnings();
+ throw Exception("Link shader program failed:\n%s", warnning.c_str());
+ }
+
+ return true;
+ }
+
+ bool Shader::CompileVertexShader(const string& vert, string& outError)
+ {
+ if (!mVertShader)
+ {
+ mVertShader = glCreateShader(GL_VERTEX_SHADER);
+ if (!mVertShader)
+ {
+ outError = "Cannot create OpenGL Vertex shader.";
+ return false;
+ }
+ }
+
+ const GLchar* source = vert.c_str();
+ GLint success;
- // Compile vertex shader.
- source = vert.c_str();
glShaderSource(mVertShader, 1, &source, NULL);
glCompileShader(mVertShader);
glGetShaderiv(mVertShader, GL_COMPILE_STATUS, &success);
if (success == GL_FALSE)
{
- warnning = GetShaderWarnings(mVertShader);
- throw Exception("Compile vertex shader failed:\n%s", warnning.c_str());
+ outError = GetShaderWarnings(mVertShader);
+ return false;
}
- // Compile fragment shader.
+ return true;
+ }
+
+ bool Shader::CompileFragementShader(const string& frag, string& outError)
+ {
+ if (!mFragShader)
+ {
+ mFragShader = glCreateShader(GL_FRAGMENT_SHADER);
+ if (!mFragShader)
+ {
+ outError = "Cannot create OpenGL fragment shader.";
+ return false;
+ }
+ }
+
+ const GLchar* source = frag.c_str();
+ GLint success;
+
source = frag.c_str();
glShaderSource(mFragShader, 1, &source, NULL);
glCompileShader(mFragShader);
glGetShaderiv(mFragShader, GL_COMPILE_STATUS, &success);
if (success == GL_FALSE)
{
- warnning = GetShaderWarnings(mFragShader);
- throw Exception("Compile fragment shader failed:\n%s", warnning.c_str());
- }
-
- // Link program.
- glAttachShader(mProgram, mVertShader);
- glAttachShader(mProgram, mFragShader);
- glLinkProgram(mProgram);
- glGetProgramiv(mProgram, GL_LINK_STATUS, &success);
- if (success == GL_FALSE)
- {
- warnning = GetProgramWarnings();
- throw Exception("Link shader program failed:\n%s", warnning.c_str());
+ outError = GetShaderWarnings(mFragShader);
+ return false;
}
return true;
diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h
index b5d866e..f4553ec 100644
--- a/source/modules/asura-core/graphics/shader.h
+++ b/source/modules/asura-core/graphics/shader.h
@@ -45,12 +45,10 @@ namespace AsuraEngine
void OnUse();
void OnUnuse();
- /// ��������
void SetAttribute(int loc, VertexBuffer* vbo, uint offseti = 0, uint stridei = 0, bool normalized = false);
int GetAttributeLocation(const std::string& attribute);
void DisableAttribute(int loc);
- /// Uniform����
bool HasUniform(const std::string& uniform);
uint GetUniformLocation(const std::string& uniform);
void SetUniformFloat(uint loc, float value);
@@ -88,15 +86,18 @@ namespace AsuraEngine
LUAX_DECL_METHOD(_SetUniformVector3);
LUAX_DECL_METHOD(_SetUniformVector4);
LUAX_DECL_METHOD(_SetUniformColor);
- /// ����vertex attributes
+
LUAX_DECL_METHOD(_GetAttributeLocation);
LUAX_DECL_METHOD(_SetAttribute);
LUAX_DECL_METHOD(_DisableAttribute);
- /// ��������uniform����
+
LUAX_DECL_METHOD(_SetBuiltInUniforms);
//----------------------------------------------------------------------------//
+ bool CompileVertexShader(const std::string& vert, std::string& outError);
+ bool CompileFragementShader(const std::string& frag, std::string& outError);
+
std::string GetProgramWarnings();
std::string GetShaderWarnings(GLuint shader);
diff --git a/source/modules/asura-core/image/binding/_image_data.cpp b/source/modules/asura-core/image/binding/_image_data.cpp
index ac9473b..1030e93 100644
--- a/source/modules/asura-core/image/binding/_image_data.cpp
+++ b/source/modules/asura-core/image/binding/_image_data.cpp
@@ -9,7 +9,7 @@ using namespace AEIO;
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
LUAX_REGISTRY(ImageData)
diff --git a/source/modules/asura-core/image/binding/_image_decode_task.cpp b/source/modules/asura-core/image/binding/_image_decode_task.cpp
index 76b544b..a0caddf 100644
--- a/source/modules/asura-core/image/binding/_image_decode_task.cpp
+++ b/source/modules/asura-core/image/binding/_image_decode_task.cpp
@@ -4,7 +4,7 @@ using namespace std;
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
LUAX_REGISTRY(ImageDecodeTask)
diff --git a/source/modules/asura-core/image/image_data.cpp b/source/modules/asura-core/image/image_data.cpp
index 1a6d3a2..b35c4b2 100644
--- a/source/modules/asura-core/image/image_data.cpp
+++ b/source/modules/asura-core/image/image_data.cpp
@@ -3,13 +3,15 @@
#include "stb_decoder.h"
#include "image_decoder.h"
+using namespace std;
+
+using namespace AEGraphics;
+
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
- using namespace std;
-
// ����image��decoder��������Ϊ�������ԡ�
list<ImageDecoder*> ImageData::ImageDecoders = {
new PNGDecoder(), // png
diff --git a/source/modules/asura-core/image/image_data.h b/source/modules/asura-core/image/image_data.h
index b05507a..c377407 100644
--- a/source/modules/asura-core/image/image_data.h
+++ b/source/modules/asura-core/image/image_data.h
@@ -14,7 +14,7 @@
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
class ImageDecoder;
@@ -36,12 +36,12 @@ namespace AsuraEngine
void Lock();
void Unlock();
- Color GetPixel(uint x, uint y);
+ AEGraphics::Color GetPixel(uint x, uint y);
//----------------------------------------------------------------------------//
uint width, height; // ���سߴ�
- ColorFormat format; // ��ʽ
+ AEGraphics::ColorFormat format; // ��ʽ
byte* pixels; // ��������
std::size_t size; // ���ݳ���
@@ -80,6 +80,6 @@ namespace AsuraEngine
}
}
-namespace AEGraphics = AsuraEngine::Graphics;
+namespace AEImage = AsuraEngine::Image;
#endif \ No newline at end of file
diff --git a/source/modules/asura-core/image/image_decode_task.cpp b/source/modules/asura-core/image/image_decode_task.cpp
index e69de29..954749a 100644
--- a/source/modules/asura-core/image/image_decode_task.cpp
+++ b/source/modules/asura-core/image/image_decode_task.cpp
@@ -0,0 +1,19 @@
+#include "image_decode_task.h"
+
+namespace AsuraEngine
+{
+ namespace Image
+ {
+
+ bool ImageDecodeTask::Execute()
+ {
+ return false;
+ }
+
+ void ImageDecodeTask::Invoke(lua_State* invokeThreaad)
+ {
+
+ }
+
+ }
+} \ No newline at end of file
diff --git a/source/modules/asura-core/image/image_decode_task.h b/source/modules/asura-core/image/image_decode_task.h
index 666d00f..fc695fa 100644
--- a/source/modules/asura-core/image/image_decode_task.h
+++ b/source/modules/asura-core/image/image_decode_task.h
@@ -6,7 +6,7 @@
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
class ImageDecodeTask
@@ -14,7 +14,19 @@ namespace AsuraEngine
{
public:
- LUAX_DECL_FACTORY(ImageDecodeTask);
+ ///
+ /// ִ��������ɺ󷵻�true�����ûص�������
+ ///
+ bool Execute() override;
+
+ ///
+ /// ���ûص�����invoke thread����ص���
+ ///
+ void Invoke(lua_State* invokeThreaad) override;
+
+ private:
+
+ LUAX_DECL_FACTORY(ImageDecodeTask, AEThreading::Task);
};
diff --git a/source/modules/asura-core/image/image_decoder.h b/source/modules/asura-core/image/image_decoder.h
index f752826..15efff7 100644
--- a/source/modules/asura-core/image/image_decoder.h
+++ b/source/modules/asura-core/image/image_decoder.h
@@ -7,7 +7,7 @@
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
ASURA_ABSTRACT class ImageDecoder
diff --git a/source/modules/asura-core/image/png_decoder.cpp b/source/modules/asura-core/image/png_decoder.cpp
index 80463d5..a76af80 100644
--- a/source/modules/asura-core/image/png_decoder.cpp
+++ b/source/modules/asura-core/image/png_decoder.cpp
@@ -2,7 +2,7 @@
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
bool PNGDecoder::CanDecode(AEIO::DataBuffer& buffer)
diff --git a/source/modules/asura-core/image/png_decoder.h b/source/modules/asura-core/image/png_decoder.h
index 6377940..24e40c5 100644
--- a/source/modules/asura-core/image/png_decoder.h
+++ b/source/modules/asura-core/image/png_decoder.h
@@ -5,7 +5,7 @@
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
///
diff --git a/source/modules/asura-core/image/stb_decoder.cpp b/source/modules/asura-core/image/stb_decoder.cpp
index b19f28b..add1c13 100644
--- a/source/modules/asura-core/image/stb_decoder.cpp
+++ b/source/modules/asura-core/image/stb_decoder.cpp
@@ -5,9 +5,11 @@
#define STB_IMAGE_IMPLEMENTATION
#include <stb/stb_image.h>
+using namespace AEGraphics;
+
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
bool STBDecoder::CanDecode(IO::DataBuffer& buffer)
diff --git a/source/modules/asura-core/image/stb_decoder.h b/source/modules/asura-core/image/stb_decoder.h
index 76e70c3..ad89214 100644
--- a/source/modules/asura-core/image/stb_decoder.h
+++ b/source/modules/asura-core/image/stb_decoder.h
@@ -5,7 +5,7 @@
namespace AsuraEngine
{
- namespace Graphics
+ namespace Image
{
///
diff --git a/source/modules/asura-core/profiler/gpu_profiler.cpp b/source/modules/asura-core/profiler/gpu_profiler.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/source/modules/asura-core/profiler/gpu_profiler.cpp
diff --git a/source/modules/asura-core/profiler/gpu_profiler.h b/source/modules/asura-core/profiler/gpu_profiler.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/source/modules/asura-core/profiler/gpu_profiler.h
diff --git a/source/modules/asura-core/window/binding/_window.cpp b/source/modules/asura-core/window/binding/_window.cpp
index e477408..cff1dd3 100644
--- a/source/modules/asura-core/window/binding/_window.cpp
+++ b/source/modules/asura-core/window/binding/_window.cpp
@@ -4,6 +4,7 @@
using namespace std;
using namespace AEGraphics;
+using namespace AEImage;
namespace AsuraEngine
{
diff --git a/source/modules/asura-core/window/window.h b/source/modules/asura-core/window/window.h
index 61adae1..d0f62c1 100644
--- a/source/modules/asura-core/window/window.h
+++ b/source/modules/asura-core/window/window.h
@@ -48,7 +48,7 @@ namespace AsuraEngine
int x, y; ///< ���ڳ�ʼ����
std::string title; ///< ������
bool vsync; ///< ��ֱͬ��
- AEGraphics::ImageData* icon; ///< ͼ��
+ AEImage::ImageData* icon; ///< ͼ��
bool show; ///< �Ƿ���ʾ
int flag; ///< ���ڱ��
};
@@ -80,7 +80,7 @@ namespace AsuraEngine
void SetSize(uint width, uint height);
void SetPosition(int x, int y);
void SetTitle(const std::string& title);
- void SetIcon(AEGraphics::ImageData* imgData);
+ void SetIcon(AEImage::ImageData* imgData);
void Show();
void Hide();
diff --git a/source/modules/asura-core/window/window_impl_sdl.cpp b/source/modules/asura-core/window/window_impl_sdl.cpp
index 9554e37..2679bc1 100644
--- a/source/modules/asura-core/window/window_impl_sdl.cpp
+++ b/source/modules/asura-core/window/window_impl_sdl.cpp
@@ -9,6 +9,7 @@
#include "window_impl_sdl.h"
using namespace AEGraphics;
+using namespace AEImage;
namespace AsuraEngine
{
diff --git a/source/tests/win32/01-window/03_sub_menu.cpp b/source/tests/win32/01-window/03_sub_menu.cpp
index e532658..462370f 100644
--- a/source/tests/win32/01-window/03_sub_menu.cpp
+++ b/source/tests/win32/01-window/03_sub_menu.cpp
@@ -13,6 +13,7 @@
using namespace std;
using namespace AEIO;
using namespace AEGraphics;
+using namespace AEImage;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
void AddMenus(HWND);
@@ -118,7 +119,7 @@ File* file2;
DataBuffer db(102400);
AEIO::Filesystem* fs;
ImageData* imgdata = new ImageData();
-Image* img;
+AEGraphics::Image* img;
GLint tex;
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
@@ -232,7 +233,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
imgdata->Decode(db);
img->Load(imgdata, {50, 100});
imgdata->Release();
-
+
// shader
shader = new Shader();
shader->Load(vert, frag);