summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-core/graphics
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-29 00:43:25 +0800
committerchai <chaifix@163.com>2019-03-29 00:43:25 +0800
commitf4c338c63f3456a8eccd56c35e233843687d55be (patch)
tree7278fe4723320c9ef310c5a04d92bf0be1bc778c /source/libs/asura-lib-core/graphics
parent3bced067a4144381e59ce4bd0eb749eeff5ad1f4 (diff)
*thread
Diffstat (limited to 'source/libs/asura-lib-core/graphics')
-rw-r--r--source/libs/asura-lib-core/graphics/binding/_image.cpp4
-rw-r--r--source/libs/asura-lib-core/graphics/image.h9
-rw-r--r--source/libs/asura-lib-core/graphics/shader.h2
-rw-r--r--source/libs/asura-lib-core/graphics/window.cpp50
-rw-r--r--source/libs/asura-lib-core/graphics/window.h90
-rw-r--r--source/libs/asura-lib-core/graphics/window_impl_glew.cpp0
-rw-r--r--source/libs/asura-lib-core/graphics/window_impl_glew.h0
-rw-r--r--source/libs/asura-lib-core/graphics/window_impl_glut.cpp0
-rw-r--r--source/libs/asura-lib-core/graphics/window_impl_glut.h0
-rw-r--r--source/libs/asura-lib-core/graphics/window_impl_sdl.cpp0
-rw-r--r--source/libs/asura-lib-core/graphics/window_impl_sdl.h0
11 files changed, 8 insertions, 147 deletions
diff --git a/source/libs/asura-lib-core/graphics/binding/_image.cpp b/source/libs/asura-lib-core/graphics/binding/_image.cpp
index b455ad5..cb008d3 100644
--- a/source/libs/asura-lib-core/graphics/binding/_image.cpp
+++ b/source/libs/asura-lib-core/graphics/binding/_image.cpp
@@ -80,8 +80,8 @@ namespace AsuraEngine
{
LUAX_PREPARE(L, Image);
- uint x = state.CheckParam<uint>(2);
- uint y = state.CheckParam<uint>(3);
+ uint x = state.CheckValue<uint>(2);
+ uint y = state.CheckValue<uint>(3);
Color32* c32 = new Color32(self->GetPixel(x, y));
c32->PushLuaxUserdata(state);
return 1;
diff --git a/source/libs/asura-lib-core/graphics/image.h b/source/libs/asura-lib-core/graphics/image.h
index 4c1c7b5..4d9787b 100644
--- a/source/libs/asura-lib-core/graphics/image.h
+++ b/source/libs/asura-lib-core/graphics/image.h
@@ -22,8 +22,9 @@ namespace AsuraEngine
class ImageFactory;
///
- /// ImageͼƬڴ󣬶ȡϷ󱣴ĽһImageڴ桢ԴֻᱣһݣҪ
- /// imageêλãźתǶȣʹspriteһֻࡣҪǿǵeditorengineʹòͬķװ
+ /// ImageͼƬڴ󣬶ȡϷ󱣴ĽһImageڴ桢Դֻᱣһ
+ /// ݣҪimageêλãźתǶȣʹsprite
+ /// һֻࡣҪǿǵeditorengineʹòͬķװ
///
class Image ASURA_FINAL
: public Drawable
@@ -39,8 +40,8 @@ namespace AsuraEngine
~Image();
///
- /// bufferimageϢmPixelsΪգݡ¹imageʹglTexImage2Dύimage
- /// ݡ
+ /// bufferimageϢmPixelsΪգݡ¹image
+ /// ʹglTexImage2Dύimageݡ
///
bool Load(ImageData* data);
diff --git a/source/libs/asura-lib-core/graphics/shader.h b/source/libs/asura-lib-core/graphics/shader.h
index 575a37e..1c81355 100644
--- a/source/libs/asura-lib-core/graphics/shader.h
+++ b/source/libs/asura-lib-core/graphics/shader.h
@@ -94,7 +94,7 @@ namespace AsuraEngine
///
GLuint mProgramHandle;
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
public:
diff --git a/source/libs/asura-lib-core/graphics/window.cpp b/source/libs/asura-lib-core/graphics/window.cpp
deleted file mode 100644
index 83a4f53..0000000
--- a/source/libs/asura-lib-core/graphics/window.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "Config.h"
-#include "Window.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- Window::Window(WindowStyle style)
- {
- }
-
- Window::~Window()
- {
-
- }
-
- void Window::SetPosition(int x, int y)
- {
- ASSERT(mWindowHandle);
- SDL_SetWindowPosition(mWindowHandle, x, y);
- }
-
- void Window::SetTitle(const std::string& title)
- {
-
- }
-
- void Window::Show()
- {
-
- }
-
- void Window::Hide()
- {
-
- }
-
- void Window::SetWindowStyle(WindowStyle style)
- {
-
- }
-
- void Window::SwapRenderBuffer()
- {
-
- }
-
- }
-}
diff --git a/source/libs/asura-lib-core/graphics/window.h b/source/libs/asura-lib-core/graphics/window.h
deleted file mode 100644
index 1b219a2..0000000
--- a/source/libs/asura-lib-core/graphics/window.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef __ASURA_ENGINE_WINDOW_H__
-#define __ASURA_ENGINE_WINDOW_H__
-
-#include <asura-lib-utils/scripting/portable.hpp>
-#include <asura-lib-utils/math/vector2.hpp>
-
-#include "render_state.h"
-#include "render_target.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- class WindowImpl;
-
- enum WindowStyle
- {
- WINDOW_STYLE_FULLSCREEN = 1 << 1,
- };
-
- ///
- /// ϷĵڣrunnerֻҪһڡͬĿͻʵִ˽ӿڲֶעᵽlua༭ᵼ࣬޽ӵ༭
- /// ⴰϡ
- ///
- class Window
- : public RenderTarget
- , public AEScripting::Portable<Window>
- {
- public:
-
- LUAX_DECL_SINGLETON(Window);
-
- Window(WindowStyle style);
-
- ~Window();
-
- void SetSize(uint width, uint height);
-
- void SetPosition(int x, int y);
-
- void SetTitle(const std::string& title);
-
- void SetWindowStyle(WindowStyle style);
-
- void Show();
-
- void Hide();
-
- ///
- /// ǿ˫ĴڣҪչʾǰ̨
- ///
- void SwapRenderBuffer();
-
- void Clear(const Color& col = Color::Black);
-
- void Clear(const Math::Recti& quad, const Color& col = Color::Black);
-
- void Draw(const Drawable* texture, const RenderState& state);
-
- void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state);
-
- protected:
-
- WindowImpl* mImpl;
-
- LUAX_DECL_METHOD(_Show);
- LUAX_DECL_METHOD(_Hide);
- LUAX_DECL_METHOD(_SetResolution);
- LUAX_DECL_METHOD(_SetFullScreen);
- LUAX_DECL_METHOD(_SetTitle);
- LUAX_DECL_METHOD(_SetWindowStyle);
- LUAX_DECL_METHOD(_Clear);
- LUAX_DECL_METHOD(_Draw);
- LUAX_DECL_METHOD(_SwapRenderBuffer);
-
- };
-
- using RenderWindow = Window;
-
- ASURA_ABSTRACT class WindowImpl
- {
- public:
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/source/libs/asura-lib-core/graphics/window_impl_glew.cpp b/source/libs/asura-lib-core/graphics/window_impl_glew.cpp
deleted file mode 100644
index e69de29..0000000
--- a/source/libs/asura-lib-core/graphics/window_impl_glew.cpp
+++ /dev/null
diff --git a/source/libs/asura-lib-core/graphics/window_impl_glew.h b/source/libs/asura-lib-core/graphics/window_impl_glew.h
deleted file mode 100644
index e69de29..0000000
--- a/source/libs/asura-lib-core/graphics/window_impl_glew.h
+++ /dev/null
diff --git a/source/libs/asura-lib-core/graphics/window_impl_glut.cpp b/source/libs/asura-lib-core/graphics/window_impl_glut.cpp
deleted file mode 100644
index e69de29..0000000
--- a/source/libs/asura-lib-core/graphics/window_impl_glut.cpp
+++ /dev/null
diff --git a/source/libs/asura-lib-core/graphics/window_impl_glut.h b/source/libs/asura-lib-core/graphics/window_impl_glut.h
deleted file mode 100644
index e69de29..0000000
--- a/source/libs/asura-lib-core/graphics/window_impl_glut.h
+++ /dev/null
diff --git a/source/libs/asura-lib-core/graphics/window_impl_sdl.cpp b/source/libs/asura-lib-core/graphics/window_impl_sdl.cpp
deleted file mode 100644
index e69de29..0000000
--- a/source/libs/asura-lib-core/graphics/window_impl_sdl.cpp
+++ /dev/null
diff --git a/source/libs/asura-lib-core/graphics/window_impl_sdl.h b/source/libs/asura-lib-core/graphics/window_impl_sdl.h
deleted file mode 100644
index e69de29..0000000
--- a/source/libs/asura-lib-core/graphics/window_impl_sdl.h
+++ /dev/null