Is glGetTexLevelParameteriv() supported by MiniGL?

This forum is for general developer support questions.

Is glGetTexLevelParameteriv() supported by MiniGL?

Postby softwarefailure » Thu Jan 11, 2018 12:58 am

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?
softwarefailure
 
Posts: 91
Joined: Fri Feb 14, 2014 11:29 pm

Re: Is glGetTexLevelParameteriv() supported by MiniGL?

Postby broadblues » Sat Jan 13, 2018 6:36 pm

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: 538
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: Is glGetTexLevelParameteriv() supported by MiniGL?

Postby broadblues » Sat Jan 13, 2018 6:44 pm

For a workarround the fv version looks fine so you could fetch floating point values and convert to integer for OS4. Clumsy I know.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 538
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK


Return to General Developer Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest