glGetIntegerv and GL_ACTIVE_TEXTURE

This topic contains 4 replies, has 4 voices, and was last updated by  Xmas 6 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29971

    miraglia
    Member

    I am using OGLES-1.1_WINDOWS_PCEMULATION_2.05.25.0804.
    I am developing on Visual Studio 2003 and using “OpenGLES common” version.

    I am using the following code lines to retrive the current texture unit in my own project:
       GLint activeTxtUnit;
       glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTxtUnit);

    it seems that this function call corrupts the stack and it does not retrieve the correct value.

    I tryed the same code into the following training project
    PowerVR SDKOGLES-1.1_WINDOWS_PCEMULATION_2.05.25.0804TrainingCourse10_MultitextureOGLES (into the function OGLESMultitexture::EnableStates).
    The result is the same.

    Does anyone had the same problem or can help me?
    Is it a PowerVR SDK bug?

    #33498

    jacekc
    Member

    I’m sorry for a late reposne. Yes, this is a bug in pcemulation. Fix for it will be included in our next release. Thanks for reporting it to us.

    #33499

    jbuck
    Member

    I am using 2.08.28.0634, and the two bugs named in the original posting (corrupt stack and incorrect value) appear to still be there. I get a “Run-Time Check Failure #2 – Stack around the variable ‘prevActiveTexUnit’ was corrupted.” when I exit a function that contains:

    GLint prevActiveTexUnit;

    glGetIntegerv(GL_ACTIVE_TEXTURE, &prevActiveTexUnit);

    glActiveTexture(GL_TEXTURE0 + 1);

    // etc.

    glActiveTexture(GL_TEXTURE0 + prevActiveTexUnit);

    This code was fine before adding the code for putting back the prevActiveTexUnit. Also, the value for prevActiveTexUnit seems to be 0-based instead of GL_TEXTURE0-based. From my reading of the standard, it seems that it should be GL_TEXTURE0-based.

    #33500

    jacekc
    Member

    Thanks for your report. We will be looking at that shortly.

    Regards,

    #33501

    Xmas
    Member
    jbuck wrote:
    This code was fine before adding the code for putting back the prevActiveTexUnit. Also, the value for prevActiveTexUnit seems to be 0-based instead of GL_TEXTURE0-based. From my reading of the standard, it seems that it should be GL_TEXTURE0-based.

    GL_ACTIVE_TEXTURE stores the enum value, not the number of the unit starting from 0. As the specification states, the initial value is GL_TEXTURE0.

Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.