Fix gluBuild2DMipmaps not returning a value
This commit is contained in:
parent
8d6435d9dc
commit
135f4c58c5
@ -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__);
|
||||
|
14
GL/glu.c
14
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user