summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-06-09 21:12:25 +0800
committerchai <chaifix@163.com>2019-06-09 21:12:25 +0800
commit8ee3f7453bf7b0db5c7358e697e91714d825c87d (patch)
tree57283565219d1808b47bbd4a883a5a52b6eb7bae /source
parentd7a972a0f16da0fd7bf4c0b70913920216ff3113 (diff)
*misc
Diffstat (limited to 'source')
-rw-r--r--source/Asura.Editor/system/editor_window.cpp6
-rw-r--r--source/Asura.Editor/system/editor_window.h62
-rw-r--r--source/Asura.Editor/system/window.cpp13
-rw-r--r--source/Asura.Editor/system/window.h82
-rw-r--r--source/external/Luax/luax.h4
-rw-r--r--source/external/Luax/luax_class.hpp7
-rw-r--r--source/modules/asura-core/graphics/canvas.h8
-rw-r--r--source/modules/asura-core/graphics/color.h4
-rw-r--r--source/modules/asura-core/graphics/color32.h8
-rw-r--r--source/modules/asura-core/graphics/gfx_device.cpp13
-rw-r--r--source/modules/asura-core/graphics/gfx_device.h31
-rw-r--r--source/modules/asura-core/graphics/gpu_buffer.cpp4
-rw-r--r--source/modules/asura-core/graphics/gpu_buffer.h41
-rw-r--r--source/modules/asura-core/graphics/image.cpp4
-rw-r--r--source/modules/asura-core/graphics/image.h34
-rw-r--r--source/modules/asura-core/graphics/index_buffer.h2
-rw-r--r--source/modules/asura-core/graphics/matrix_stack.h25
-rw-r--r--source/modules/asura-core/graphics/mesh2d.h11
-rw-r--r--source/modules/asura-core/graphics/shader.h25
-rw-r--r--source/modules/asura-core/graphics/sprite_batch.h4
-rw-r--r--source/modules/asura-core/graphics/texture.h40
-rw-r--r--source/modules/asura-core/graphics/vertex_buffer.h2
-rw-r--r--source/modules/asura-core/image/image_data.h24
-rw-r--r--source/modules/asura-core/image/image_decode_task.h2
-rw-r--r--source/modules/asura-core/input/clipboard.h10
-rw-r--r--source/modules/asura-core/input/cursor.h6
-rw-r--r--source/modules/asura-utils/scripting/portable.hpp1
-rw-r--r--source/tests/win32/01-window/03_sub_menu.cpp4
28 files changed, 184 insertions, 293 deletions
diff --git a/source/Asura.Editor/system/editor_window.cpp b/source/Asura.Editor/system/editor_window.cpp
new file mode 100644
index 0000000..0e2d4f4
--- /dev/null
+++ b/source/Asura.Editor/system/editor_window.cpp
@@ -0,0 +1,6 @@
+#include "editor_window.h"
+
+namespace AsuraEditor
+{
+
+} // AsruaEditor \ No newline at end of file
diff --git a/source/Asura.Editor/system/editor_window.h b/source/Asura.Editor/system/editor_window.h
new file mode 100644
index 0000000..8a3b0e1
--- /dev/null
+++ b/source/Asura.Editor/system/editor_window.h
@@ -0,0 +1,62 @@
+#ifndef __ASURA_EDITOR_WINDOW_H__
+#define __ASURA_EDITOR_WINDOW_H__
+
+#include <windows.h>
+#include <string.h>
+
+#include <asura-utils/scripting/portable.hpp>
+
+#include "../type.h"
+
+namespace AsuraEditor
+{
+
+ ///
+ /// ༭ڵnative
+ ///
+ class ContainerWindow : public AEScripting::Portable<ContainerWindow>
+ {
+ public:
+
+ enum WindowStyle
+ {
+ WINDOW_STYLE_BASIC, ///<
+ WINDOW_STYLE_TOOL, ///<
+ WINDOW_STYLE_CONFIRM, ///< ȷϴ
+ };
+
+ struct WindowConfig
+ {
+ std::string title; ///<
+ uint x, y; ///<
+ uint width, height; ///< С
+ WindowStyle style; ///<
+ };
+
+ ContainerWindow();
+ ~ContainerWindow();
+
+ bool Init(WindowConfig& config);
+
+ private:
+
+ ContainerWindow* mParent;
+ WindowStyle mStyle;
+ HWND mHWND;
+ HDC mHDC;
+
+ luaxport:
+
+ LUAX_DECL_FACTORY(ContainerWindow);
+
+ LUAX_DECL_ENUM(WindowStyle);
+
+ LUAX_DECL_METHOD(_New);
+ LUAX_DECL_METHOD(_Init);
+ LUAX_DECL_METHOD(_SetPosition);
+
+ };
+
+} // AsuraEditor
+
+#endif \ No newline at end of file
diff --git a/source/Asura.Editor/system/window.cpp b/source/Asura.Editor/system/window.cpp
deleted file mode 100644
index 440c88c..0000000
--- a/source/Asura.Editor/system/window.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "window.h"
-
-namespace AsuraEditor
-{
-
- bool Window::Init(int posx, uint posy, uint w, uint h)
- {
- if (mHWND)
- return false;
-
- }
-
-} \ No newline at end of file
diff --git a/source/Asura.Editor/system/window.h b/source/Asura.Editor/system/window.h
deleted file mode 100644
index c9837e3..0000000
--- a/source/Asura.Editor/system/window.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef __ASURA_EDITOR_WINDOW_H__
-#define __ASURA_EDITOR_WINDOW_H__
-
-#include <windows.h>
-#include <string.h>
-
-#include <asura-utils/scripting/portable.hpp>
-
-#include "../type.h"
-
-namespace AsuraEditor
-{
-
- ///
- /// ڷָֻ˿ܵķ񣬾ĿؼӦóơ
- ///
- enum WindowStyle
- {
- WINDOW_STYLE_BASIC, ///<
- WINDOW_STYLE_TOOL, ///<
- WINDOW_STYLE_CONFIRM, ///< ȷϴ
- };
-
- ///
- /// ʱҪ
- ///
- struct WindowConfig
- {
- std::string title; ///<
- uint x, y; ///<
- uint width, height; ///< С
- WindowStyle style; ///<
- };
-
- ///
- /// ༭win32ڣÿһڰһHWNDһHDC
- ///
- class Window
- : public AEScripting::Portable<Window>
- {
- public:
-
- Window();
- ~Window();
-
- bool Init(WindowConfig& config);
-
- private:
-
- //------------------------------------------------------------------------------//
-
- LUAX_DECL_FACTORY(Window);
-
- LUAX_DECL_ENUM(WindowStyle);
-
- LUAX_DECL_METHOD(_New);
- LUAX_DECL_METHOD(_Init);
- LUAX_DECL_METHOD(_SetPosition);
-
- //------------------------------------------------------------------------------//
-
- ///
- /// ڡ
- ///
- Window* mParent;
-
- ///
- /// ھ豸ġ
- ///
- HWND mHWND;
- HDC mHDC;
-
- ///
- /// ڷ
- ///
- WindowStyle mStyle;
-
- };
-
-}
-
-#endif \ No newline at end of file
diff --git a/source/external/Luax/luax.h b/source/external/Luax/luax.h
index 45fa514..7a0dcd6 100644
--- a/source/external/Luax/luax.h
+++ b/source/external/Luax/luax.h
@@ -1,6 +1,10 @@
#ifndef __LUAX_H__
#define __LUAX_H__
+///
+/// Luax(port) library ڸluaעͺ
+///
+
#include "luax_state.h"
#include "luax_vm.h"
#include "luax_ref.h"
diff --git a/source/external/Luax/luax_class.hpp b/source/external/Luax/luax_class.hpp
index 193ecff..fd9f75a 100644
--- a/source/external/Luax/luax_class.hpp
+++ b/source/external/Luax/luax_class.hpp
@@ -92,6 +92,9 @@ namespace Luax
#define LUAX_INHERIT(state, type) type::RegisterLuaxClass(state)
+#define luaxport private
+
+
///
/// ࣬Ϊʵֶ̬ҪЩӿڵⲿҪ̳д֮࣬оͻ
/// öӦʵķע̳дʱʵķʵLuaxNativeClassУʵֻ
@@ -129,8 +132,8 @@ namespace Luax
//}
///
- /// Ҫ¶luanative classҪ̳дࡣͨluaʵҪȷüȷԣ
- /// ߳Ҫȷͷš
+ /// Ҫ¶luanative classҪ̳дࡣͨluaʵҪȷüȷԣڶ߳Ҫȷ
+ /// ͷš
///
template<class TYPE, class BASE = LuaxObject>
class LuaxNativeClass : public BASE
diff --git a/source/modules/asura-core/graphics/canvas.h b/source/modules/asura-core/graphics/canvas.h
index 4175561..5c11706 100644
--- a/source/modules/asura-core/graphics/canvas.h
+++ b/source/modules/asura-core/graphics/canvas.h
@@ -53,18 +53,14 @@ namespace AsuraEngine
uint mWidth, mHeight;
- public:
-
- //----------------------------------------------------------------------------//
+ luaxport:
- LUAX_DECL_FACTORY(Canvas);
+ LUAX_DECL_FACTORY(Canvas, RenderTarget);
LUAX_DECL_METHOD(_SetSize);
LUAX_DECL_METHOD(_Bind);
LUAX_DECL_METHOD(_Unbind);
- //----------------------------------------------------------------------------//
-
};
///
diff --git a/source/modules/asura-core/graphics/color.h b/source/modules/asura-core/graphics/color.h
index ababcf7..b29c43f 100644
--- a/source/modules/asura-core/graphics/color.h
+++ b/source/modules/asura-core/graphics/color.h
@@ -42,7 +42,7 @@ namespace AsuraEngine
float r, g, b, a;
- //----------------------------------------------------------------------------//
+ luaxport:
LUAX_DECL_FACTORY(Color);
@@ -61,8 +61,6 @@ namespace AsuraEngine
LUAX_DECL_METHOD(___mul); // __mul
LUAX_DECL_METHOD(___div); // __div
- //----------------------------------------------------------------------------//
-
};
}
diff --git a/source/modules/asura-core/graphics/color32.h b/source/modules/asura-core/graphics/color32.h
index 5b10931..9f14155 100644
--- a/source/modules/asura-core/graphics/color32.h
+++ b/source/modules/asura-core/graphics/color32.h
@@ -20,8 +20,6 @@ namespace AsuraEngine
{
public:
- LUAX_DECL_FACTORY(Color32);
-
static const uint32 RMASK;
static const uint32 GMASK;
static const uint32 BMASK;
@@ -41,10 +39,12 @@ namespace AsuraEngine
byte r, g, b, a;
- LUAX_DECL_METHOD(_ToColor);
+ luaxport:
- LUAX_DECL_METHOD(_SetColor);
+ LUAX_DECL_FACTORY(Color32);
+ LUAX_DECL_METHOD(_ToColor);
+ LUAX_DECL_METHOD(_SetColor);
LUAX_DECL_METHOD(_GetColor);
LUAX_DECL_METHOD(_GetRed);
LUAX_DECL_METHOD(_GetGreen);
diff --git a/source/modules/asura-core/graphics/gfx_device.cpp b/source/modules/asura-core/graphics/gfx_device.cpp
index edfa784..c520127 100644
--- a/source/modules/asura-core/graphics/gfx_device.cpp
+++ b/source/modules/asura-core/graphics/gfx_device.cpp
@@ -32,6 +32,11 @@ namespace AsuraEngine
{
}
+ GfxDevice& GfxDevice::Get()
+ {
+ return gfx;
+ }
+
static bool inited = false;
bool GfxDevice::Init(const AEMath::Recti& view)
@@ -122,8 +127,6 @@ namespace AsuraEngine
#endif
}
- //------------------------------------------------------------------------------//
-
void GfxDevice::SetMatrixMode(MatrixMode mode)
{
state.matrixMode = mode;
@@ -191,7 +194,5 @@ namespace AsuraEngine
return state.matrix[state.matrixMode].GetTopIndex();
}
- //------------------------------------------------------------------------------//
-
- }
-} \ No newline at end of file
+ } // Graphics
+} // AsuraEngine \ No newline at end of file
diff --git a/source/modules/asura-core/graphics/gfx_device.h b/source/modules/asura-core/graphics/gfx_device.h
index c93717f..3c5b383 100644
--- a/source/modules/asura-core/graphics/gfx_device.h
+++ b/source/modules/asura-core/graphics/gfx_device.h
@@ -33,12 +33,6 @@ namespace AsuraEngine
GL_PARAM_MAX_TEXTURE_UNIT = 1,
};
- ///
- /// OpenGLģһЩopengl״̬׷١ڱ༭രڻ£һڶӦһhwnd
- /// һhdcԼopengl contextʹwglMakeCurrent(hdc, glc)ָǰ̶߳
- /// Ⱦhdcopenglglcglм¼ľһ̵߳һڵһOpenGL
- /// ĵ״ֶ̬֧Ⱦ
- ///
class GfxDevice : public AEScripting::Portable<GfxDevice>
{
public:
@@ -46,6 +40,8 @@ namespace AsuraEngine
GfxDevice();
~GfxDevice();
+ static GfxDevice& Get();
+
int GetParam(GLParams param);
bool Init(const AEMath::Recti& viewport);
@@ -54,8 +50,8 @@ namespace AsuraEngine
void SetViewport(const AEMath::Recti viewport);
const AEMath::Recti& GetViewport();
- void UseShader(Shader* shader);
- void UnuseShader();
+ void UseShader(Shader* shader);
+ void UnuseShader();
Shader* GetShader();
void DrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -69,16 +65,16 @@ namespace AsuraEngine
void Translate(float x, float y);
void Scale(float x, float y);
void Ortho(float l, float r, float b, float t, float n, float f);
- AEMath::Matrix44& GetMatrix(MatrixMode mode);
- AEMath::Matrix44 GetMVPMatrix();
uint GetMatrixDepth();
uint GetMatrixIndex();
+ AEMath::Matrix44& GetMatrix(MatrixMode mode);
+ AEMath::Matrix44 GetMVPMatrix();
- void SetDrawColor(float r, float g, float b, float a);
+ void SetDrawColor(float r, float g, float b, float a);
Color& GetDrawColor();
- void WipeError();
- bool HasError();
+ void WipeError();
+ bool HasError();
GLenum GetError();
struct
@@ -103,7 +99,7 @@ namespace AsuraEngine
friend class Profiler;
- //----------------------------------------------------------------------------//
+ luaxport:
LUAX_DECL_SINGLETON(GfxDevice);
@@ -121,17 +117,12 @@ namespace AsuraEngine
LUAX_DECL_METHOD(_Ortho);
LUAX_DECL_METHOD(_GetMatrixDepth);
LUAX_DECL_METHOD(_GetMatrixIndex);
-
LUAX_DECL_METHOD(_UseShader);
LUAX_DECL_METHOD(_UnuseShader);
- //----------------------------------------------------------------------------//
-
};
- ///
- /// OpenGL
- ///
+ // ȫgfx device
extern GfxDevice gfx;
}
diff --git a/source/modules/asura-core/graphics/gpu_buffer.cpp b/source/modules/asura-core/graphics/gpu_buffer.cpp
index 4c84b7e..8d6f491 100644
--- a/source/modules/asura-core/graphics/gpu_buffer.cpp
+++ b/source/modules/asura-core/graphics/gpu_buffer.cpp
@@ -71,13 +71,12 @@ namespace AsuraEngine
return false;
if (mBuffer == 0)
{
- // ʼ
gfx.WipeError();
glGenBuffers(1, &mBuffer);
if (mBuffer == 0)
throw Exception("OpenGL glGenBuffers failed.");
glBindBuffer(mTarget, mBuffer);
- glBufferData(mTarget, mSize, NULL, mUsage); // ʼСΪsizeĻ壬usageŵӦԴ
+ glBufferData(mTarget, mSize, NULL, mUsage);
if (gfx.HasError())
{
glBindBuffer(mTarget, 0);
@@ -98,7 +97,6 @@ namespace AsuraEngine
}
glBindBuffer(mTarget, 0);
#if ASURA_DEBUG
- // һݣ
memcpy(mData + offset, data, size);
#endif
return true;
diff --git a/source/modules/asura-core/graphics/gpu_buffer.h b/source/modules/asura-core/graphics/gpu_buffer.h
index 9013619..f4f518f 100644
--- a/source/modules/asura-core/graphics/gpu_buffer.h
+++ b/source/modules/asura-core/graphics/gpu_buffer.h
@@ -44,44 +44,18 @@ namespace AsuraEngine
static size_t GetDataTypeSize(GLenum datatype);
- ///
- /// ʼ\»棬ûgpu bufferԴΪdzʼΪǸ¡
- ///
bool Fill(const void* data, size_t size, uint offset = 0) ASURA_THROW(Exception);
- ///
- /// 󶨵ӦĿϣͿʹˡ
- ///
void Bind();
void UnBind();
- ///
- /// bufferĴС(Byte)
- ///
uint GetBufferSize();
- ///
- /// bufferԪظ=size/datatypesize
- ///
uint GetBufferCount();
GLenum GetDataType();
size_t GetDataTypeSize();
private:
- //----------------------------------------------------------------------------//
-
- LUAX_DECL_ABSTRACT_FACTORY(GPUBuffer);
-
- LUAX_DECL_ENUM(BufferType, 1);
- LUAX_DECL_ENUM(BufferUsage, 1);
- LUAX_DECL_ENUM(BufferDataType, 2);
-
- LUAX_DECL_METHOD(_Fill);
- LUAX_DECL_METHOD(_GetSize);
- LUAX_DECL_METHOD(_GetCount);
-
- //----------------------------------------------------------------------------//
-
GLenum ConvertBufferType(BufferType type);
GLenum ConvertBufferUsage(BufferUsage type);
GLenum ConvertBufferDataType(BufferDataType type);
@@ -99,12 +73,21 @@ namespace AsuraEngine
uint mSize;
#if ASURA_DEBUG
- ///
- /// رbufferݣԴݱһ£Ժ͸Դ档
- ///
byte* mData;
#endif
+ luaxport:
+
+ LUAX_DECL_ABSTRACT_FACTORY(GPUBuffer);
+
+ LUAX_DECL_ENUM(BufferType, 1);
+ LUAX_DECL_ENUM(BufferUsage, 1);
+ LUAX_DECL_ENUM(BufferDataType, 2);
+
+ LUAX_DECL_METHOD(_Fill);
+ LUAX_DECL_METHOD(_GetSize);
+ LUAX_DECL_METHOD(_GetCount);
+
};
}
diff --git a/source/modules/asura-core/graphics/image.cpp b/source/modules/asura-core/graphics/image.cpp
index 42fc2ab..ef01730 100644
--- a/source/modules/asura-core/graphics/image.cpp
+++ b/source/modules/asura-core/graphics/image.cpp
@@ -101,5 +101,5 @@ namespace AsuraEngine
return mHeight;
}
- }
-} \ No newline at end of file
+ } // Graphics
+} // AsuraEngine \ No newline at end of file
diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h
index 8e3e7d3..d7cd37f 100644
--- a/source/modules/asura-core/graphics/image.h
+++ b/source/modules/asura-core/graphics/image.h
@@ -24,40 +24,26 @@ namespace AsuraEngine
namespace Graphics
{
- ///
- /// ImageͼƬڴ󣬶ȡϷ󱣴ĽһImageڴ桢Դֻᱣһ
- /// ݣҪimageêλãźתǶȣʹsprite
- /// һֻࡣҪǿǵeditorengineʹòͬķװImageֻṩȾʱҪ
- /// sampler2Dϸ˵Image޹أӦImageṩFrameworkУ
- /// Ⱦʵspritespriteṩ˶ݺͷ任
- ///
- class Image ASURA_FINAL
- : public AEScripting::Portable<Image, Texture>
+ class Image ASURA_FINAL : public AEScripting::Portable<Image, Texture>
{
public:
Image();
-
~Image();
- ///
- /// ͼύGPUϢ¹imageʹglTexImage2D
- /// ύimageݡ
- ///
bool Load(AEImage::ImageData* decodeData);
bool Load(AEImage::ImageData* decodeData, const AEMath::Vector2i& pos);
uint GetWidth();
uint GetHeight();
- ///
- /// һgpu buffer䶥positionݺUV.
- ///
GPUBuffer* GenGPUBuffer();
private:
- //----------------------------------------------------------------------------//
+ uint32 mWidth, mHeight;
+
+ luaxport:
LUAX_DECL_FACTORY(Image, Texture);
@@ -69,18 +55,10 @@ namespace AsuraEngine
LUAX_DECL_METHOD(_GetPixel);
LUAX_DECL_METHOD(_Render);
- //----------------------------------------------------------------------------//
-
- uint32 mWidth, mHeight;
-
-#if ASURA_EDITOR
-
-#endif
-
};
- }
-}
+ } // Graphics
+} // AsuraEngine
namespace AEGraphics = AsuraEngine::Graphics;
diff --git a/source/modules/asura-core/graphics/index_buffer.h b/source/modules/asura-core/graphics/index_buffer.h
index ac77162..c5d2e9e 100644
--- a/source/modules/asura-core/graphics/index_buffer.h
+++ b/source/modules/asura-core/graphics/index_buffer.h
@@ -24,6 +24,8 @@ namespace AsuraEngine
private:
+ luaxport:
+
LUAX_DECL_FACTORY(IndexBuffer);
LUAX_DECL_METHOD(_New);
diff --git a/source/modules/asura-core/graphics/matrix_stack.h b/source/modules/asura-core/graphics/matrix_stack.h
index 1a318fa..ae983e7 100644
--- a/source/modules/asura-core/graphics/matrix_stack.h
+++ b/source/modules/asura-core/graphics/matrix_stack.h
@@ -27,9 +27,6 @@ namespace AsuraEngine
MatrixStack();
~MatrixStack();
- ///
- /// ջԪصIJֻͨºʵ
- ///
void LoadIdentity();
bool Push();
bool Pop();
@@ -40,39 +37,19 @@ namespace AsuraEngine
void LoadMatrix(const AEMath::Matrix44& mat44);
void MultMatrix(const AEMath::Matrix44& mat44);
- ///
- /// 任
- ///
void Rotate(float angle);
void Translate(float x, float y);
void Scale(float x, float y);
- ///
- /// ͶӰ任
- ///
void Ortho(float l, float r, float b, float t, float n, float f);
- //void Perspective(float fov, float aspect, float near, float far);
- //void Frustum(float left, float right, float top, float bottom, float near, float far);
- //void LookAt(float x, float y, float z, float cx, float cy, float cz, float ux, float uy, float uz);
- ///
- /// ջΧ0~ASURA_MAX_MATRIX_STACK_DEPTH-1
- ///
uint GetTopIndex();
-
- ///
- /// ջASURA_MAX_MATRIX_STACK_DEPTH
- ///
uint GetCapacity();
private:
AEMath::Matrix44 mStack[ASURA_MAX_MATRIX_STACK_DEPTH];
-
- ///
- /// ջ0~ASURA_MAX_MATRIX_STACK_DEPTH-1
- ///
- uint8 top;
+ uint8 top;
};
diff --git a/source/modules/asura-core/graphics/mesh2d.h b/source/modules/asura-core/graphics/mesh2d.h
index f2770e1..5330967 100644
--- a/source/modules/asura-core/graphics/mesh2d.h
+++ b/source/modules/asura-core/graphics/mesh2d.h
@@ -37,15 +37,14 @@ namespace AsuraEngine
private:
+ VertexBuffer* mVBO; ///< vertex buffer
+ IndexBuffer* mIBO; ///< index buffer
+
+ luaxport:
+
LUAX_DECL_FACTORY(Mesh2D);
LUAX_DECL_METHOD(_SetVertex);
-
- ///
- /// mesh2d dataйvertex bufferindex buffer
- ///
- VertexBuffer* mVBO;
- IndexBuffer* mIBO;
};
diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h
index f4553ec..61aa6f1 100644
--- a/source/modules/asura-core/graphics/shader.h
+++ b/source/modules/asura-core/graphics/shader.h
@@ -71,7 +71,17 @@ namespace AsuraEngine
private:
- //----------------------------------------------------------------------------//
+ 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);
+
+ GLuint mProgram;
+ GLuint mVertShader;
+ GLuint mFragShader;
+
+ luaxport:
LUAX_DECL_FACTORY(Shader);
@@ -93,20 +103,9 @@ namespace AsuraEngine
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);
-
- GLuint mProgram;
- GLuint mVertShader;
- GLuint mFragShader;
-
};
+ // ڱһGPU
typedef Shader GpuProgram;
}
diff --git a/source/modules/asura-core/graphics/sprite_batch.h b/source/modules/asura-core/graphics/sprite_batch.h
index 17ecb40..b517334 100644
--- a/source/modules/asura-core/graphics/sprite_batch.h
+++ b/source/modules/asura-core/graphics/sprite_batch.h
@@ -24,9 +24,9 @@ namespace AsuraEngine
private:
- LUAX_DECL_FACTORY(SpriteBatch);
-
+ luaxport:
+ LUAX_DECL_FACTORY(SpriteBatch);
};
diff --git a/source/modules/asura-core/graphics/texture.h b/source/modules/asura-core/graphics/texture.h
index 799227e..7cfddec 100644
--- a/source/modules/asura-core/graphics/texture.h
+++ b/source/modules/asura-core/graphics/texture.h
@@ -46,10 +46,10 @@ namespace AsuraEngine
///
struct TextureFormat
{
- GLenum internalformat; // GPUڲʽ
+ GLenum internalformat; ///< GPUڲʽ
- GLenum externalformat; // CPUⲿʽ
- GLenum type; // ⲿʽÿchannelֵ
+ GLenum externalformat; ///< CPUⲿʽ
+ GLenum type; ///< ⲿʽÿchannelֵ
};
///
@@ -81,42 +81,30 @@ namespace AsuraEngine
protected:
- //----------------------------------------------------------------------------//
-
- LUAX_DECL_ENUM(ColorFormat, 1);
- LUAX_DECL_ENUM(FilterMode, 1);
- LUAX_DECL_ENUM(WrapMode, 1);
-
- LUAX_DECL_METHOD(_SetFilterMode);
- LUAX_DECL_METHOD(_SetWrapMode);
- LUAX_DECL_METHOD(_GetFilterMode);
- LUAX_DECL_METHOD(_GetWrapMode);
- LUAX_DECL_METHOD(_IsGenMipmap);
-
- //----------------------------------------------------------------------------//
-
///
/// תcolor formatΪtexture format
///
TextureFormat ConvertColorFormat(const ColorFormat& colorformat);
- //----------------------------------------------------------------------------//
-
- ///
- /// OpenGL
- ///
GLuint mTex;
-
FilterMode mMinFilter;
FilterMode mMagFilter;
-
WrapMode mWrapMode;
-
bool mIsGenMipmap;
+ LUAX_DECL_ENUM(ColorFormat, 1);
+ LUAX_DECL_ENUM(FilterMode, 1);
+ LUAX_DECL_ENUM(WrapMode, 1);
+
+ LUAX_DECL_METHOD(_SetFilterMode);
+ LUAX_DECL_METHOD(_SetWrapMode);
+ LUAX_DECL_METHOD(_GetFilterMode);
+ LUAX_DECL_METHOD(_GetWrapMode);
+ LUAX_DECL_METHOD(_IsGenMipmap);
+
};
- using Drawable = Texture;
+ typedef Texture Drawable;
}
}
diff --git a/source/modules/asura-core/graphics/vertex_buffer.h b/source/modules/asura-core/graphics/vertex_buffer.h
index b078c2b..7aad27d 100644
--- a/source/modules/asura-core/graphics/vertex_buffer.h
+++ b/source/modules/asura-core/graphics/vertex_buffer.h
@@ -25,6 +25,8 @@ namespace AsuraEngine
private:
+ luaxport:
+
LUAX_DECL_FACTORY(VertexBuffer);
LUAX_DECL_METHOD(_New);
diff --git a/source/modules/asura-core/image/image_data.h b/source/modules/asura-core/image/image_data.h
index c377407..ca459e7 100644
--- a/source/modules/asura-core/image/image_data.h
+++ b/source/modules/asura-core/image/image_data.h
@@ -49,7 +49,17 @@ namespace AsuraEngine
private:
- //----------------------------------------------------------------------------//
+ ///
+ /// ڵһ׼image dataʱṩdecoderڼdecodersмѡԡ
+ ///
+ static std::list<ImageDecoder*> ImageDecoders;
+
+ ///
+ /// дݵ
+ ///
+ AEThreading::Mutex mMutex;
+
+ luaxport:
LUAX_DECL_FACTORY(ImageData);
@@ -63,18 +73,6 @@ namespace AsuraEngine
LUAX_DECL_METHOD(_DecodeAsync);
LUAX_DECL_METHOD(_IsAvailable);
- //----------------------------------------------------------------------------//
-
- ///
- /// ڵһ׼image dataʱṩdecoderڼdecodersмѡԡ
- ///
- static std::list<ImageDecoder*> ImageDecoders;
-
- ///
- /// дݵ
- ///
- AEThreading::Mutex mMutex;
-
};
}
diff --git a/source/modules/asura-core/image/image_decode_task.h b/source/modules/asura-core/image/image_decode_task.h
index fc695fa..5108c23 100644
--- a/source/modules/asura-core/image/image_decode_task.h
+++ b/source/modules/asura-core/image/image_decode_task.h
@@ -24,7 +24,7 @@ namespace AsuraEngine
///
void Invoke(lua_State* invokeThreaad) override;
- private:
+ luaxport:
LUAX_DECL_FACTORY(ImageDecodeTask, AEThreading::Task);
diff --git a/source/modules/asura-core/input/clipboard.h b/source/modules/asura-core/input/clipboard.h
index b3b9a1a..1b7c2b8 100644
--- a/source/modules/asura-core/input/clipboard.h
+++ b/source/modules/asura-core/input/clipboard.h
@@ -19,16 +19,14 @@ namespace AsuraEngine
void SetString(const Text::String& text);
- //----------------------------------------------------------------------------//
-
- LUAX_DECL_SINGLETON(Clipboard);
-
- //----------------------------------------------------------------------------//
-
private:
~Clipboard();
+ luaxport:
+
+ LUAX_DECL_SINGLETON(Clipboard);
+
};
};
diff --git a/source/modules/asura-core/input/cursor.h b/source/modules/asura-core/input/cursor.h
index d420d66..e3df7ee 100644
--- a/source/modules/asura-core/input/cursor.h
+++ b/source/modules/asura-core/input/cursor.h
@@ -49,8 +49,6 @@ namespace AsuraEngine
{
public:
- LUAX_DECL_FACTORY(Cursor);
-
Cursor(Graphics::ImageData& imageData, int hotx, int hoty);
Cursor(SystemCursor cursortype);
@@ -66,6 +64,10 @@ namespace AsuraEngine
SystemCursor mSystemType;
CursorImpl* mImpl;
+ luaxport:
+
+ LUAX_DECL_FACTORY(Cursor);
+
};
ASURA_ABSTRACT class CursorImpl
diff --git a/source/modules/asura-utils/scripting/portable.hpp b/source/modules/asura-utils/scripting/portable.hpp
index cb8e2eb..2716da4 100644
--- a/source/modules/asura-utils/scripting/portable.hpp
+++ b/source/modules/asura-utils/scripting/portable.hpp
@@ -6,6 +6,7 @@ extern "C" {
#include <lua51/lualib.h>
#include <lua51/lauxlib.h>
}
+
#include <luax/luax.h>
#include "../type.h"
diff --git a/source/tests/win32/01-window/03_sub_menu.cpp b/source/tests/win32/01-window/03_sub_menu.cpp
index 462370f..6fe93d7 100644
--- a/source/tests/win32/01-window/03_sub_menu.cpp
+++ b/source/tests/win32/01-window/03_sub_menu.cpp
@@ -77,7 +77,7 @@ struct Vert
float s, t; // uv
};
-int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLine, int nCmdShow)
+int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLine, int nCmdShow)
{
AEIO::Filesystem::Get()->Init("D:\Asura\bin\win64");
@@ -90,7 +90,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLin
wc.hCursor = LoadCursor(0, IDC_ARROW);
RegisterClassW(&wc);
- wnd = CreateWindowW(wc.lpszClassName, L"Asura beta",
+ wnd = CreateWindowW(wc.lpszClassName, L"Asura",
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
200, 200, 550, 450, 0, 0, hInstance, 0);