summaryrefslogtreecommitdiffstats
path: root/src/graphics/common/texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/common/texture.h')
-rw-r--r--src/graphics/common/texture.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/src/graphics/common/texture.h b/src/graphics/common/texture.h
index 55d5c70..55b2fc2 100644
--- a/src/graphics/common/texture.h
+++ b/src/graphics/common/texture.h
@@ -20,6 +20,115 @@
namespace Gfx {
+/**
+ \enum TexMinFilter
+ \brief Minification texture filter
+
+ Corresponds to OpenGL modes but should translate to DirectX too. */
+enum TexMinFilter
+{
+ TEX_MIN_FILTER_NEAREST,
+ TEX_MIN_FILTER_LINEAR,
+ TEX_MIN_FILTER_NEAREST_MIPMAP_NEAREST,
+ TEX_MIN_FILTER_LINEAR_MIPMAP_NEAREST,
+ TEX_MIN_FILTER_NEAREST_MIPMAP_LINEAR,
+ TEX_MIN_FILTER_LINEAR_MIPMAP_LINEAR
+};
+
+/**
+ \enum TexMagFilter
+ \brief Magnification texture filter */
+enum TexMagFilter
+{
+ TEX_MAG_FILTER_NEAREST,
+ TEX_MAG_FILTER_LINEAR
+};
+
+/**
+ \enum TexWrapMode
+ \brief Wrapping mode for texture coords */
+enum TexWrapMode
+{
+ TEX_WRAP_CLAMP,
+ TEX_WRAP_REPEAT
+};
+
+/**
+ \enum TexMixOperation
+ \brief Multitexture mixing operation
+ */
+enum TexMixOperation
+{
+ TEX_MIX_OPER_MODULATE,
+ TEX_MIX_OPER_ADD
+};
+
+/**
+ \enum TexMixArgument
+ \brief Multitexture mixing argument
+ */
+enum TexMixArgument
+{
+ TEX_MIX_ARG_CURRENT,
+ TEX_MIX_ARG_TEXTURE,
+ TEX_MIX_ARG_DIFFUSE,
+ TEX_MIX_ARG_FACTOR
+};
+
+/**
+ \struct TextureCreateParams
+ \brief Parameters for texture creation
+ */
+struct TextureCreateParams
+{
+ //! Whether the texture image contains alpha
+ bool alpha;
+ //! Whether to generate mipmaps
+ bool mipmap;
+ //! Minification filter
+ Gfx::TexMinFilter minFilter;
+ //! Magnification filter
+ Gfx::TexMagFilter magFilter;
+ //! Wrap S coord mode
+ Gfx::TexWrapMode wrapS;
+ //! Wrap T coord mode
+ Gfx::TexWrapMode wrapT;
+
+ //! Constructor; calls LoadDefault()
+ TextureCreateParams()
+ { LoadDefault(); }
+
+ //! Loads the default values
+ void LoadDefault();
+};
+
+/**
+ \struct TextureParams
+ \brief Parameters for texture creation
+ */
+struct TextureParams
+{
+ //! Mixing operation done on color values
+ Gfx::TexMixOperation colorOperation;
+ //! 1st argument of color operations
+ Gfx::TexMixArgument colorArg1;
+ //! 2nd argument of color operations
+ Gfx::TexMixArgument colorArg2;
+ //! Mixing operation done on alpha values
+ Gfx::TexMixOperation alphaOperation;
+ //! 1st argument of alpha operations
+ Gfx::TexMixArgument alphaArg1;
+ //! 2nd argument of alpha operations
+ Gfx::TexMixArgument alphaArg2;
+
+ //! Constructor; calls LoadDefault()
+ TextureParams()
+ { LoadDefault(); }
+
+ //! Loads the default values
+ void LoadDefault();
+};
+
/** \struct Texture*/
struct Texture
{