No Transparent textures Using OpenGL 1.3 Inizialization

I have a very strange problem.
This is my GLFW OpenGL inizialization.

 glfwInit();
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 1);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);// GLFW_OPENGL_CORE_PROFILE);// );
    glfwWindowHint(GLFW_SAMPLES, 8);
    glfwWindowHint(GLFW_ALPHA_BITS, 8);
    glfwWindowHint(GLFW_DEPTH_BITS, 24);
    glfwWindowHint(GLFW_STENCIL_BITS, 8);
    glfwWindowHint(GLFW_ALPHA_BITS, 8);
    glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
    g_Window = glfwCreateWindow(iw, ih, "APP", NULL, NULL);

    if (g_Window == NULL)
    {
        printf("Failed to create GLFW window\n");
        glfwTerminate();
        return -1;
    }
...

then My OpenGL configuration…

 glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, g_iWidthGL, 0, g_iHeightGL, -1.0, 1.0);
    glMatrixMode(GL_MODELVIEW);
    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
  
 glEnable(GL_BLEND);
 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

my load RGBA Tga Load File funtion…

void LoadTextureFromTga(uint32_t *uiTextureID, const char* caImg, int32_t* w, int32_t* h )
{
    if (!caImg)	return;

    struct tImageTGA* pImgData = 0;

    pImgData = Load_TGA(caImg);

    if (pImgData == 0) {
        printf("TGA_Texture\n ERROR\n: %s \n ERROR\n", caImg);
        return;
    }
    glGenTextures(1, uiTextureID);
    glBindTexture(GL_TEXTURE_2D, *uiTextureID);


    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    

    *w = pImgData->size_x;
    *h = pImgData->size_y;

    // Give the image to OpenGL                                                    //  GL_RGBA
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, pImgData->size_x, pImgData->size_y, 0, GL_RGBA, GL_UNSIGNED_BYTE, pImgData->data);
    

}

and my drawing texture function…

   glBindTexture(GL_TEXTURE_2D, uiTexture);

    glBindTexture(GL_TEXTURE_2D, uiTexture);
    glEnable(GL_TEXTURE_2D);
        glBegin(GL_QUADS);
            glTexCoord2d(0, 0);
            glVertex2i(v.x, v.y);
            glTexCoord2d(1, 0);
            glVertex2i(v.x + v.w, v.y);
            glTexCoord2d(1, 1);
            glVertex2i(v.x + v.w, v.y + v.h);
            glTexCoord2d(0, 1);
            glVertex2i(v.x, v.y + v.h);
        glEnd();
    glDisable(GL_TEXTURE_2D);

So the problem is… when I Draw a plygon with alpha is drawing with thwe correct transparency… but if draw a TGA with RGBA Channels… I Obtain a full white colour insted the tranparency.

I test the same code with glut and it works correwctly.

Any tip for that …!!!
Thank you.

Hi and welcome to the GLFW forum,

this forum is more for help with using the GLFW API than OpenGL, and this is an OpenGL question.

I would first check that your texture is loaded correctly with alpha by inspecting it’s byte content, as I don’t know what Load_TGA does.

I Know that is a GLFW forum but I Don´t know what´s happen with this issue
The LoadTGA funcion load the TGA (without compression) (RGBA information inside the raw file as follows RGBA RGBA RGBA… for an image with 512x512 size… I´m sure that this work fine…

It has been 20 years while since I have used legacy OpenGL, but you may need to specify:

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );

Thank you very mutch dougbinks…

I create another project form scratch (with the same code) and it works properly even without using …
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
So… I have some kind of problem at the big project…
Sorry for the interruption and thank you for your tip !!
I have to investigate more for discover the problem, but at the moment I don´t know what´s the problem… so frustrating…

By the way is possible with GLFW library capture to a log file all the instructions OpenGL for a later analysis.

Thank you in advance.

By the way is possible with GLFW library capture to a log file all the instructions OpenGL for a later analysis.

No, GLFW is a simple, platform-independent API for creating windows, contexts and surfaces, reading input, handling events, etc. The majority of OpenGL functionality is via the system OpenGL libraries.

There are tools for OpenGL capture and replay but I’m not sure which ones will work with legacy OpenGL. For example RenderDoc only supports the core profile of OpenGL - from 3.2 up to 4.6 inclusive.

Ok, perfect, Thank you very much.