initial support for GL_MIRRORED_REPEAT
This commit is contained in:
parent
f09760dda3
commit
708566af72
@ -153,7 +153,9 @@ typedef struct {
|
|||||||
//50
|
//50
|
||||||
GLenum internalFormat;
|
GLenum internalFormat;
|
||||||
//54
|
//54
|
||||||
GLubyte padding[10]; // Pad to 64-bytes
|
GLubyte uv_flip;
|
||||||
|
// 55
|
||||||
|
GLubyte padding[9]; // Pad to 64-bytes
|
||||||
} __attribute__((aligned(32))) TextureObject;
|
} __attribute__((aligned(32))) TextureObject;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@ -390,7 +390,7 @@ void _glUpdatePVRTextureContext(PolyContext *context, GLshort textureUnit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
context->txr.env = tx1->env;
|
context->txr.env = tx1->env;
|
||||||
context->txr.uv_flip = GPU_UVFLIP_NONE;
|
context->txr.uv_flip = tx1->uv_flip;
|
||||||
context->txr.uv_clamp = tx1->uv_clamp;
|
context->txr.uv_clamp = tx1->uv_clamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
GL/texture.c
12
GL/texture.c
@ -17,6 +17,9 @@
|
|||||||
#define CLAMP_U (1<<1)
|
#define CLAMP_U (1<<1)
|
||||||
#define CLAMP_V (1<<0)
|
#define CLAMP_V (1<<0)
|
||||||
|
|
||||||
|
#define MIRROR_U (1<<1)
|
||||||
|
#define MIRROR_V (1<<0)
|
||||||
|
|
||||||
static TextureObject* TEXTURE_UNITS[MAX_GLDC_TEXTURE_UNITS] = {NULL, NULL};
|
static TextureObject* TEXTURE_UNITS[MAX_GLDC_TEXTURE_UNITS] = {NULL, NULL};
|
||||||
static NamedArray TEXTURE_OBJECTS;
|
static NamedArray TEXTURE_OBJECTS;
|
||||||
GLubyte ACTIVE_TEXTURE = 0;
|
GLubyte ACTIVE_TEXTURE = 0;
|
||||||
@ -505,6 +508,7 @@ static void _glInitializeTextureObject(TextureObject* txr, unsigned int id) {
|
|||||||
txr->width = txr->height = 0;
|
txr->width = txr->height = 0;
|
||||||
txr->mipmap = 0;
|
txr->mipmap = 0;
|
||||||
txr->uv_clamp = 0;
|
txr->uv_clamp = 0;
|
||||||
|
txr->uv_flip = 0;
|
||||||
txr->env = GPU_TXRENV_MODULATEALPHA;
|
txr->env = GPU_TXRENV_MODULATEALPHA;
|
||||||
txr->data = NULL;
|
txr->data = NULL;
|
||||||
txr->mipmapCount = 0;
|
txr->mipmapCount = 0;
|
||||||
@ -1899,6 +1903,10 @@ void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
|||||||
case GL_REPEAT:
|
case GL_REPEAT:
|
||||||
active->uv_clamp &= ~CLAMP_U;
|
active->uv_clamp &= ~CLAMP_U;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GL_MIRRORED_REPEAT:
|
||||||
|
active->uv_flip |= MIRROR_U;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -1913,6 +1921,10 @@ void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
|||||||
case GL_REPEAT:
|
case GL_REPEAT:
|
||||||
active->uv_clamp &= ~CLAMP_V;
|
active->uv_clamp &= ~CLAMP_V;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GL_MIRRORED_REPEAT:
|
||||||
|
active->uv_flip |= MIRROR_V;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -116,6 +116,7 @@ __BEGIN_DECLS
|
|||||||
#define GL_TEXTURE_WRAP_T 0x2803
|
#define GL_TEXTURE_WRAP_T 0x2803
|
||||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||||
|
#define GL_MIRRORED_REPEAT 0x2902
|
||||||
#define GL_REPEAT 0x2901
|
#define GL_REPEAT 0x2901
|
||||||
#define GL_CLAMP 0x2900
|
#define GL_CLAMP 0x2900
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user