From 86dd5dd2b278a7a134a5a99531f0862bbd13cb96 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Tue, 7 Aug 2018 20:49:10 +0100 Subject: [PATCH] glCompressedTexImage2D is an ARB extension in OpenGL 1.2.1 --- GL/texture.c | 10 +++++----- include/gl.h | 17 ----------------- include/glext.h | 18 ++++++++++++++++++ samples/nehe06_vq/main.c | 2 +- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/GL/texture.c b/GL/texture.c index 016e2fb..5d45f08 100644 --- a/GL/texture.c +++ b/GL/texture.c @@ -168,7 +168,7 @@ void APIENTRY glTexEnvf(GLenum target, GLenum pname, GLfloat param) { glTexEnvi(target, pname, param); } -void APIENTRY glCompressedTexImage2D(GLenum target, +void APIENTRY glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, GLsizei width, @@ -179,10 +179,10 @@ void APIENTRY glCompressedTexImage2D(GLenum target, TRACE(); if(target != GL_TEXTURE_2D) - _glKosThrowError(GL_INVALID_ENUM, "glCompressedTexImage2D"); + _glKosThrowError(GL_INVALID_ENUM, __func__); if(level < 0 || border) - _glKosThrowError(GL_INVALID_VALUE, "glCompressedTexImage2D"); + _glKosThrowError(GL_INVALID_VALUE, __func__); switch(internalFormat) { case GL_COMPRESSED_ARGB_1555_VQ_KOS: @@ -193,11 +193,11 @@ void APIENTRY glCompressedTexImage2D(GLenum target, case GL_COMPRESSED_RGB_565_VQ_TWID_KOS: break; default: - _glKosThrowError(GL_INVALID_OPERATION, "glCompressedTexImage2D"); + _glKosThrowError(GL_INVALID_OPERATION, __func__); } if(TEXTURE_UNITS[ACTIVE_TEXTURE] == NULL) { - _glKosThrowError(GL_INVALID_OPERATION, "glCompressedTexImage2D"); + _glKosThrowError(GL_INVALID_OPERATION, __func__); } if(_glKosHasError()) { diff --git a/include/gl.h b/include/gl.h index 9b8a828..ef284c7 100644 --- a/include/gl.h +++ b/include/gl.h @@ -510,23 +510,6 @@ GLAPI void APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalForma GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *data); -/* Loads VQ compressed texture from SH4 RAM into PVR VRAM */ -/* internalformat must be one of the following constants: - GL_UNSIGNED_SHORT_5_6_5_VQ - GL_UNSIGNED_SHORT_5_6_5_VQ_TWID - GL_UNSIGNED_SHORT_4_4_4_4_VQ - GL_UNSIGNED_SHORT_4_4_4_4_VQ_TWID - GL_UNSIGNED_SHORT_1_5_5_5_VQ - GL_UNSIGNED_SHORT_1_5_5_5_VQ_TWID - */ -GLAPI void APIENTRY glCompressedTexImage2D(GLenum target, - GLint level, - GLenum internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLsizei imageSize, - const GLvoid *data); /* GL Array API - Only GL_TRIANGLES, GL_TRIANGLE_STRIP, and GL_QUADS are supported */ GLAPI void APIENTRY glVertexPointer(GLint size, GLenum type, diff --git a/include/glext.h b/include/glext.h index fc4a762..c511790 100644 --- a/include/glext.h +++ b/include/glext.h @@ -126,6 +126,24 @@ GLAPI void APIENTRY glGenerateMipmapEXT(GLenum target); GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT(GLenum target); GLAPI GLboolean APIENTRY glIsFramebufferEXT(GLuint framebuffer); +/* Loads VQ compressed texture from SH4 RAM into PVR VRAM */ +/* internalformat must be one of the following constants: + GL_UNSIGNED_SHORT_5_6_5_VQ + GL_UNSIGNED_SHORT_5_6_5_VQ_TWID + GL_UNSIGNED_SHORT_4_4_4_4_VQ + GL_UNSIGNED_SHORT_4_4_4_4_VQ_TWID + GL_UNSIGNED_SHORT_1_5_5_5_VQ + GL_UNSIGNED_SHORT_1_5_5_5_VQ_TWID + */ +GLAPI void APIENTRY glCompressedTexImage2DARB(GLenum target, + GLint level, + GLenum internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLsizei imageSize, + const GLvoid *data); + __END_DECLS #endif /* !__GL_GLEXT_H */ diff --git a/samples/nehe06_vq/main.c b/samples/nehe06_vq/main.c index 408d8e0..309ae57 100644 --- a/samples/nehe06_vq/main.c +++ b/samples/nehe06_vq/main.c @@ -125,7 +125,7 @@ void LoadGLTextures() { // 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image, // border 0 (normal), rgb color data, unsigned byte data, and finally the data itself. - glCompressedTexImage2D( + glCompressedTexImage2DARB( GL_TEXTURE_2D, 0, image1->internalFormat, image1->sizeX, image1->sizeY, 0, image1->dataSize, image1->data );