Merge branch 'misc_fixes' into 'master'

Some small fixes

See merge request simulant/GLdc!158
This commit is contained in:
Luke Benstead 2025-03-31 10:53:41 +00:00
commit dfeb32c609
3 changed files with 16 additions and 14 deletions

View File

@ -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__);

View File

@ -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;
}

View File

@ -282,10 +282,10 @@ void SceneListSubmit(Vertex* vertices, int n) {
case THIRD_VISIBLE:
memcpy_vertex(c, v2);
_glClipEdge(v2, v0, a);
_glClipEdge(v1, v2, a);
a->flags = GPU_CMD_VERTEX;
_glClipEdge(v1, v2, b);
_glClipEdge(v2, v0, b);
b->flags = GPU_CMD_VERTEX;
_glPerspectiveDivideVertex(a, 3);