Is glGetTexLevelParameteriv() supported by MiniGL?

This forum is for general developer support questions.
Post Reply
softwarefailure
Posts: 96
Joined: Fri Feb 14, 2014 10:29 pm

Is glGetTexLevelParameteriv() supported by MiniGL?

Post 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?

User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 591
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Is glGetTexLevelParameteriv() supported by MiniGL?

Post 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

User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 591
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Is glGetTexLevelParameteriv() supported by MiniGL?

Post 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.

Post Reply