summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/texture.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-30 21:49:29 +0800
committerchai <chaifix@163.com>2019-03-30 21:49:29 +0800
commit8164adb15b76f537f8b6c78b9992786b61d61cc8 (patch)
tree6e42919e32258a3c495dcec54b0fda3e8e1977d8 /source/modules/asura-core/graphics/texture.h
parentc270d033fa04873ee7a8925dbb00cae5edc4555c (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/texture.h')
-rw-r--r--source/modules/asura-core/graphics/texture.h74
1 files changed, 55 insertions, 19 deletions
diff --git a/source/modules/asura-core/graphics/texture.h b/source/modules/asura-core/graphics/texture.h
index 81ced9f..a76e1d4 100644
--- a/source/modules/asura-core/graphics/texture.h
+++ b/source/modules/asura-core/graphics/texture.h
@@ -1,9 +1,8 @@
-#ifndef __ASURA_ENGINE_TEXTURE_H__
-#define __ASURA_ENGINE_TEXTURE_H__
+#ifndef __ASURA_TEXTURE_H__
+#define __ASURA_TEXTURE_H__
#include <asura-utils/math/rect.hpp>
#include <asura-utils/math/vector2.hpp>
-#include <asura-utils/scripting/portable.hpp>
#include "../core_config.h"
@@ -17,20 +16,59 @@ namespace AsuraEngine
class RenderTarget;
+ enum WrapMode
+ {
+ WRAP_MODE_REPEAT,
+ WRAP_MODE_MIRROR,
+ WRAP_MODE_CLAMPTOEDGE,
+ WRAP_MODE_CLAMPTOBORDER,
+ //WRAP_MODE_PERAXIS, // UVвͬ4ֵ
+ };
+
+ enum FilterMode
+ {
+ FILTER_MODE_NEAREST,
+ FILTER_MODE_LINEAR,
+ };
+
///
- /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷϲԵѿϵΪ׼
- /// EditorҲϽΪԭ㣬Ϊ˷㡣
+ /// ͼݵɫʽ
+ ///
+ enum ColorFormat
+ {
+ COLOR_FORMAT_UNKNOWN,
+
+ COLOR_FORMAT_RGBA8, ///< RGBA8bits int
+ COLOR_FORMAT_RGBA32F, ///< RGBA32bits float
+ };
+
+ ///
+ /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷ
+ /// ϲԵѿϵΪ׼EditorҲϽΪԭ㣬Ϊ
+ /// 㡣
///
ASURA_ABSTRACT class Texture
{
public:
- Texture();
+ LUAX_DECL_ABSTRACT_FACTORY();
+ Texture();
virtual ~Texture();
GLuint GetGLTextureHandle() const;
+ void SetFilterMode(FilterMode min, FilterMode mag);
+ void SetWrapMode(WrapMode wrapMode);
+
+ void GetFilterMode();
+ void GetWrapMode();
+
+ ///
+ /// UVfilterΪ
+ ///
+ void IsGenMipmap();
+
///
/// ȾtexturertϣԭϽǣң
///
@@ -41,22 +79,20 @@ namespace AsuraEngine
///
virtual void Render(const RenderTarget* rt, const Math::Rectf& quad, const RenderState& state) = 0;
- ///
- /// ù˷ʽ
- ///
- void SetSmooth(bool smooth);
+ protected:
- ///
- /// ظʽ
- ///
- void SetRepeated();
+ LUAX_DECL_ENUM(ColorFormat);
+ LUAX_DECL_ENUM(FilterMode);
+ LUAX_DECL_ENUM(WrapMode);
- protected:
+ GLuint mTexHandle;
- ///
- /// OpenGL texture handle
- ///
- GLuint mTextureHandle;
+ FilterMode mMinFilter;
+ FilterMode mMagFilter;
+
+ WrapMode mWrapMode;
+
+ bool mIsGenMipmap;
};