diff --git a/GL/framebuffer.c b/GL/framebuffer.c index a7e6532..b30c07f 100644 --- a/GL/framebuffer.c +++ b/GL/framebuffer.c @@ -325,18 +325,6 @@ void APIENTRY glGenerateMipmap(GLenum target) { gl_assert(_glIsMipmapComplete(tex)); } -/* generate mipmaps for any image provided by the user and then pass them to OpenGL */ -GLAPI GLvoid APIENTRY gluBuild2DMipmaps(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, const void *data){ - /* 2d texture, level of detail 0 (normal), 3 components (red, green, blue), - width & height of the image, border 0 (normal), rgb color data, - unsigned byte data, and finally the data itself. */ - glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data); - - glGenerateMipmap(GL_TEXTURE_2D); -} - GLenum APIENTRY glCheckFramebufferStatusEXT(GLenum target) { if(target != GL_FRAMEBUFFER_EXT) { _glKosThrowError(GL_INVALID_ENUM, __func__); diff --git a/GL/glu.c b/GL/glu.c index 9b2f48d..68a2028 100644 --- a/GL/glu.c +++ b/GL/glu.c @@ -15,3 +15,17 @@ void APIENTRY gluPerspective(GLdouble angle, GLdouble aspect, void APIENTRY gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) { glOrtho(left, right, bottom, top, -1.0f, 1.0f); } + +/* generate mipmaps for any image provided by the user and then pass them to OpenGL */ +GLint APIENTRY gluBuild2DMipmaps(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, + GLenum format, GLenum type, const void *data){ + /* 2d texture, level of detail 0 (normal), 3 components (red, green, blue), + width & height of the image, border 0 (normal), rgb color data, + unsigned byte data, and finally the data itself. */ + glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data); + + glGenerateMipmap(GL_TEXTURE_2D); + // FIXME return glu error codes + return 0; +}