summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/modules/asura-core/graphics/texture.h')
-rw-r--r--source/modules/asura-core/graphics/texture.h176
1 files changed, 87 insertions, 89 deletions
diff --git a/source/modules/asura-core/graphics/texture.h b/source/modules/asura-core/graphics/texture.h
index 5d754eb..458e35a 100644
--- a/source/modules/asura-core/graphics/texture.h
+++ b/source/modules/asura-core/graphics/texture.h
@@ -9,95 +9,93 @@
#include "render_state.h"
#include "gfx_device.h"
-namespace AsuraEngine
+namespace_begin(AsuraEngine)
+namespace_begin(Graphics)
+
+class RenderTarget;
+
+/// UVʽ
+enum WrapMode
+{
+ WRAP_MODE_REPEAT,
+ WRAP_MODE_MIRROR,
+ WRAP_MODE_CLAMPTOEDGE,
+ WRAP_MODE_CLAMPTOBORDER,
+};
+
+/// ˲ģʽ
+enum FilterMode
{
- namespace Graphics
- {
-
- class RenderTarget;
-
- /// UVʽ
- enum WrapMode
- {
- WRAP_MODE_REPEAT,
- WRAP_MODE_MIRROR,
- WRAP_MODE_CLAMPTOEDGE,
- WRAP_MODE_CLAMPTOBORDER,
- };
-
- /// ˲ģʽ
- enum FilterMode
- {
- FILTER_MODE_NEAREST,
- FILTER_MODE_LINEAR,
- };
-
- /// ͼݵɫʽ
- enum ColorFormat
- {
- COLOR_FORMAT_UNKNOWN,
- COLOR_FORMAT_RGBA8, ///< RGBA8bits int
- COLOR_FORMAT_RGBA32F, ///< RGBA32bits float
- };
-
- /// ʽGPUڲCPUⲿʽ
- struct TextureFormat
- {
- GLenum internalformat; ///< GPUڲʽ
- GLenum externalformat; ///< CPUⲿʽ
- GLenum type; ///< ⲿʽÿchannelֵ
- };
-
- ///
- /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷϲԵѿ
- /// ϵΪ׼EditorҲϽΪԭ㣬Ϊ˷㡣
- ///
- ASURA_ABSTRACT class Texture : public AEScripting::Object
- {
- public:
-
- LUAX_DECL_ABSTRACT_FACTORY(Texture);
-
- Texture();
- virtual ~Texture();
-
- GLuint GetGLTexture() const;
-
- void SetFilterMode(FilterMode min, FilterMode mag);
- void SetWrapMode(WrapMode wrapMode);
-
- void GetFilterMode();
- void GetWrapMode();
-
- /// UVfilterΪ
- bool IsGenMipmap();
-
- protected:
-
- /// תcolor formatΪtexture format
- TextureFormat ConvertColorFormat(const ColorFormat& colorformat);
-
- GLuint m_TexID;
- FilterMode m_MinFilter;
- FilterMode m_MagFilter;
- WrapMode m_WrapMode;
- bool m_IsGenMipmap;
-
- 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);
-
- };
-
- typedef Texture Drawable;
-
- }
-}
+ FILTER_MODE_NEAREST,
+ FILTER_MODE_LINEAR,
+};
+
+/// ͼݵɫʽ
+enum ColorFormat
+{
+ COLOR_FORMAT_UNKNOWN,
+ COLOR_FORMAT_RGBA8, ///< RGBA8bits int
+ COLOR_FORMAT_RGBA32F, ///< RGBA32bits float
+};
+
+/// ʽGPUڲCPUⲿʽ
+struct TextureFormat
+{
+ GLenum internalformat; ///< GPUڲʽ
+ GLenum externalformat; ///< CPUⲿʽ
+ GLenum type; ///< ⲿʽÿchannelֵ
+};
+
+///
+/// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷϲԵѿ
+/// ϵΪ׼EditorҲϽΪԭ㣬Ϊ˷㡣
+///
+ASURA_ABSTRACT class Texture : public AEScripting::Object
+{
+public:
+
+ LUAX_DECL_ABSTRACT_FACTORY(Texture);
+
+ Texture();
+ virtual ~Texture();
+
+ GLuint GetGLTexture() const;
+
+ void SetFilterMode(FilterMode min, FilterMode mag);
+ void SetWrapMode(WrapMode wrapMode);
+
+ void GetFilterMode();
+ void GetWrapMode();
+
+ /// UVfilterΪ
+ bool IsGenMipmap();
+
+protected:
+
+ /// תcolor formatΪtexture format
+ TextureFormat ConvertColorFormat(const ColorFormat& colorformat);
+
+ GLuint m_TexID;
+ FilterMode m_MinFilter;
+ FilterMode m_MagFilter;
+ WrapMode m_WrapMode;
+ bool m_IsGenMipmap;
+
+ 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);
+
+};
+
+typedef Texture Drawable;
+
+namespace_end
+namespace_end
#endif \ No newline at end of file