Page 1 of 1

Is glGetTexLevelParameteriv() supported by MiniGL?

PostPosted: Thu Jan 11, 2018 12:58 am
by softwarefailure
I'm trying to get some info from a texture:

Code: Select all
int texwidth = 0, texheight = 0, fmt = 0;
glBindTexture(textureTarget, id);
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_COMPONENTS, &fmt);
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_WIDTH, &texwidth);
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &texheight);


But I'm getting these weird return values:

Code: Select all
fmt: 0x47005800
texwidth: 0x44800000
texheight: 0x43000000


The code works fine on Windows/Linux/MacOS and but on MiniGL I get these strange values. Is this a bug in MiniGL?

Re: Is glGetTexLevelParameteriv() supported by MiniGL?

PostPosted: Sat Jan 13, 2018 6:36 pm
by broadblues
softwarefailure wrote:I'm trying to get some info from a texture:

Code: Select all
int texwidth = 0, texheight = 0, fmt = 0;
glBindTexture(textureTarget, id);
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_COMPONENTS, &fmt);
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_WIDTH, &texwidth);
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &texheight);


But I'm getting these weird return values:

Code: Select all
fmt: 0x47005800
texwidth: 0x44800000
texheight: 0x43000000



Hmmm, I though to myself, when reading this topic a few days back , those look like floating point numbers, not really knowing I held my tongue to avoid confusion.
The code works fine on Windows/Linux/MacOS and but on MiniGL I get these strange values. Is this a bug in MiniGL?


Today however I had some time to dig out my old checkout of minigl and found this:


void cgl_GLGetTexLevelParameteriv(struct GLContextIFace *Self, GLenum gltarget, GLint level,
GLenum pname, GLfloat *param)


MGLAPI void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
{
CC->GLGetTexLevelParameteriv(target, level, pname, params);
}

ooops defo a bug I'd say. I don't think I have commit access to fix that (not in the main OS repo) so I'll raise a BZ

Re: Is glGetTexLevelParameteriv() supported by MiniGL?

PostPosted: Sat Jan 13, 2018 6:44 pm
by broadblues
For a workarround the fv version looks fine so you could fetch floating point values and convert to integer for OS4. Clumsy I know.