I've been working on implementing an engine that is utilizing both SDL and OpenGL, I've currently been testing to see how my textures are being rendered on the various machines I have around here to test it with.
This is how I'm attempting to render my textures currently:
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, this->textureID);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
//std::cout << "Color Tint: " << this->colorTint << '\n';
float* colors = Utilities::ColorUtilities::CalculateRGBAColors(this->colorTint);
//std::cout << "R: " << red << " G: " << green << " B: " << blue << " A: " << alpha << '\n';
//glPushMatrix();
glBegin(GL_TRIANGLES);
glColor4f(colors[0], colors[1], colors[2], colors[3]);
glTexCoord2f(0, 0); glVertex2f(0, 0);
glTexCoord2f(1, 0); glVertex2f(1, 0);
glTexCoord2f(0, 1); glVertex2f(0, 1);
glTexCoord2f(1, 1); glVertex2f(1, 1);
glTexCoord2f(0, 1); glVertex2f(0, 1);
glTexCoord2f(1, 0); glVertex2f(1, 0);
glEnd();
//glPopMatrix();
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
On the machines that I've tested this on where it worked it either ran OpenGL 4.3 or 4.4 as well as contained dedicated graphics cards. On the other machine I tried it on, where the texture wasn't being rendered to the screen, it was running OpenGL 4.0 on an integrated graphics card. I don't think the graphics card type should make the difference, but I'm definitely leaning toward the OpenGL version being the cause of the issue.
I do have a shader pipeline that I've been setting up for utilization, and I'm thinking maybe I need to convert my texture rendering process to use that to be able to display textures properly on all OpenGL 2.0+.
I'm not entirely sure tho, and would enjoy some clarification on whether this is what I need to do, a better way to do it and / or information on what is different between these various OpenGL versions causing this to not work on the <= 4.0 version.