summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2006-02-23 01:21:11 +0000
committerDavid Reveman <davidr@novell.com>2006-02-23 01:21:11 +0000
commit08b6c5c545cfd9d9292f3594303772fbfc7485e5 (patch)
treec8b5a0461c33f40e756b9cd4b7544b20fd260865 /src
parent38c8cbf9378174eb85f277996706085f8134fb2d (diff)
Mipmap support
Diffstat (limited to 'src')
-rw-r--r--src/glitz.h10
-rw-r--r--src/glitz_gl.h5
-rw-r--r--src/glitz_texture.c21
3 files changed, 29 insertions, 7 deletions
diff --git a/src/glitz.h b/src/glitz.h
index 9089365..669b60a 100644
--- a/src/glitz.h
+++ b/src/glitz.h
@@ -28,7 +28,7 @@
#define GLITZ_MAJOR 0
#define GLITZ_MINOR 5
-#define GLITZ_REVISION 3
+#define GLITZ_REVISION 4
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
@@ -397,8 +397,12 @@ typedef enum {
} glitz_texture_filter_type_t;
typedef enum {
- GLITZ_TEXTURE_FILTER_NEAREST = 0,
- GLITZ_TEXTURE_FILTER_LINEAR = 1
+ GLITZ_TEXTURE_FILTER_NEAREST = 0,
+ GLITZ_TEXTURE_FILTER_LINEAR = 1,
+ GLITZ_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST = 2,
+ GLITZ_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST = 3,
+ GLITZ_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR = 3,
+ GLITZ_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR = 4
} glitz_texture_filter_t;
void
diff --git a/src/glitz_gl.h b/src/glitz_gl.h
index 9332e55..8f04ae4 100644
--- a/src/glitz_gl.h
+++ b/src/glitz_gl.h
@@ -145,6 +145,11 @@ typedef ptrdiff_t glitz_gl_sizeiptr_t;
#define GLITZ_GL_TEXTURE_BLUE_SIZE 0x805E
#define GLITZ_GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GLITZ_GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GLITZ_GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GLITZ_GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GLITZ_GL_LINEAR_MIPMAP_LINEAR 0x2703
+
#define GLITZ_GL_TEXTURE 0x1702
#define GLITZ_GL_SRC_COLOR 0x0300
diff --git a/src/glitz_texture.c b/src/glitz_texture.c
index ddb5cbf..d7a6243 100644
--- a/src/glitz_texture.c
+++ b/src/glitz_texture.c
@@ -388,12 +388,25 @@ glitz_texture_object_set_filter (glitz_texture_object_t *texture,
glitz_texture_filter_type_t type,
glitz_texture_filter_t filter)
{
- static glitz_gl_enum_t filters[] = {
- GLITZ_GL_NEAREST,
- GLITZ_GL_LINEAR
+ static glitz_gl_enum_t filters[2][6] = {
+ {
+ GLITZ_GL_NEAREST,
+ GLITZ_GL_LINEAR,
+ GLITZ_GL_NEAREST,
+ GLITZ_GL_LINEAR,
+ GLITZ_GL_NEAREST,
+ GLITZ_GL_LINEAR
+ }, {
+ GLITZ_GL_NEAREST,
+ GLITZ_GL_LINEAR,
+ GLITZ_GL_NEAREST_MIPMAP_NEAREST,
+ GLITZ_GL_LINEAR_MIPMAP_NEAREST,
+ GLITZ_GL_NEAREST_MIPMAP_LINEAR,
+ GLITZ_GL_LINEAR_MIPMAP_LINEAR
+ }
};
- texture->param.filter[type] = filters[filter];
+ texture->param.filter[type] = filters[type][filter];
}
void