c++ opengl texturing does not work
<p>I am debutant in Opengl and I don't arrive to make texturing in a little project with OpenGL.</p>

<pre><code>This is my code : 

// myglwidget.cpp

    #include &lt;QtWidgets&gt;
#include &lt;QtOpenGL&gt;
#include &lt;QDebug&gt;
#include &lt;QGLFormat&gt;
#include&lt;QOpenGlTexture&gt;
#include&lt;qimage.h&gt;

#include "myglwidget.h"

int MyGLWidget::loadTextures()
{
    Image = QImage("D:\\workspace\\logo.png");
    Image = QGLWidget::convertToGLFormat(Image);
    if(Image.isNull())
    {
        qDebug() &lt;&lt; "isNull"&lt;&lt;endl;
        return 0;
    }
    textures = 1;
    glGenTextures(1, (GLuint*)textures);
    glBindTexture(GL_TEXTURE_2D,(GLuint)textures);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
    glTexImage2D(GL_TEXTURE_2D, (GLuint)textures, GL_RGBA, Image.width(), Image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, Image.bits());
    return 1;

}

MyGLWidget::MyGLWidget(QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
    xRot = 0;
    yRot = 0;
    zRot = 0;
}

MyGLWidget::~MyGLWidget()
{
}

QSize MyGLWidget::minimumSizeHint() const
{
    return QSize(50, 50);
}

QSize MyGLWidget::sizeHint() const
{
    return QSize(400, 400);
}

static void qNormalizeAngle(int &amp;angle)
{
    while (angle &lt; 0)
        angle += 360 * 16;
    while (angle &gt; 360)
        angle -= 360 * 16;
}

void MyGLWidget::setXRotation(int angle)
{
    qNormalizeAngle(angle);
    if (angle != xRot) {
        xRot = angle;
        emit xRotationChanged(angle);
        updateGL();
    }
}

void MyGLWidget::setYRotation(int angle)
{
    qNormalizeAngle(angle);
    if (angle != yRot) {
        yRot = angle;
        emit yRotationChanged(angle);
        updateGL();
    }
}

void MyGLWidget::setZRotation(int angle)
{
    qNormalizeAngle(angle);
    if (angle != zRot) {
        zRot = angle;
        emit zRotationChanged(angle);
        updateGL();
    }
}

void MyGLWidget::initializeGL()
{
    glEnable(GL_DEPTH_TEST); //On initialise la profondeur
    glEnable(GL_TEXTURE_2D); //On initialise les textures !
}

void MyGLWidget::paintGL()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    glEnable(GL_TEXTURE_2D);
    glTranslatef(0.0, 0.0, -10.0);
    glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
    glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
    glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
    draw();
}

void MyGLWidget::resizeGL(int width, int height)
{
    int side = qMin(width, height);
    glViewport((width - side) / 2, (height - side) / 2, side, side);

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
#ifdef QT_OPENGL_ES_1
    glOrthof(-2, +2, -2, +2, 1.0, 15.0);
#else
    glOrtho(-2, +2, -2, +2, 1.0, 15.0);
#endif
    glMatrixMode(GL_MODELVIEW);
}

void MyGLWidget::mousePressEvent(QMouseEvent *event)
{
    lastPos = event-&gt;pos();
}

void MyGLWidget::mouseMoveEvent(QMouseEvent *event)
{
    int dx = event-&gt;x() - lastPos.x();
    int dy = event-&gt;y() - lastPos.y();

    if (event-&gt;buttons() &amp; Qt::LeftButton) {
        setXRotation(xRot + 8 * dy);
        setYRotation(yRot + 8 * dx);
    } else if (event-&gt;buttons() &amp; Qt::RightButton) {
        setXRotation(xRot + 8 * dy);
        setZRotation(zRot + 8 * dx);
    }

    lastPos = event-&gt;pos();
}

void MyGLWidget::draw()
{
    qglColor(Qt::red);
    glPushMatrix();
    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, textures);
    glBegin(GL_QUADS);
    glNormal3f(0,0,-1);
    glVertex3f(-1,-1,0);
    glVertex3f(-1,1,0);
    glVertex3f(1,1,0);
    glVertex3f(1,-1,0);
    glEnd();
    glDisable(GL_TEXTURE_2D);
    glBegin(GL_TRIANGLES);
    glNormal3f(0,-1,0.707);
    glVertex3f(-1,-1,0);
    glVertex3f(1,-1,0);
    glVertex3f(0,0,1.2);
    glEnd();
    glBegin(GL_TRIANGLES);
    glNormal3f(1,0, 0.707);
    glVertex3f(1,-1,0);
    glVertex3f(1,1,0);
    glVertex3f(0,0,1.2);
    glEnd();
    glBegin(GL_TRIANGLES);
    glNormal3f(0,1,0.707);
    glVertex3f(1,1,0);
    glVertex3f(-1,1,0);
    glVertex3f(0,0,1.2);
    glEnd();
    glBegin(GL_TRIANGLES);
    glNormal3f(-1,0,0.707);
    glVertex3f(-1,1,0);
    glVertex3f(-1,-1,0);
    glVertex3f(0,0,1.2);
    glEnd();
    glPopMatrix();
}
</code></pre>

<p>I try many image format (bmp, png, tga) and I never arrived to see the texture.
I also tried  many functions in order to load the texture on the net, and I don't arrive to show it. I know that the path for the image is ok, and the function no return any errors.
Thank you for your help.</p>