glDrawElements not working

Hi everyone. I have a problem with VBOs and glDrawElements(). DrawElements method doesn’t draw a simple triangle. The program run but I can see only a black screen
Here is my code:

bool StartMenu::initialize()
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

    float radius = 0.5f;
    glGenBuffers(1, &vertexBuffer);
    glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); //Bind the vertex buffer
    glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 3 * m_vertices.size(), &m_vertices[0], GL_STATIC_DRAW);
    glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
    glVertexPointer(3, GL_FLOAT, 0, 0);
    glGenBuffers(1, &indexBuffer);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); //Bind the vertex buffer
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint) * m_indices.size(), &m_indices[0], GL_STATIC_DRAW);
    return true;

void StartMenu::render()
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
void StartMenu::renderTriangle()
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
    glDrawElements(GL_TRIANGLES, m_indices.size(), GL_INT, 0);

I use GLUT library.
I’ve used in past simple OpenGL projects VBOs and glDrawElements() methods and it works fine, so I don’t know why this time it’s not working.
I’m using for the first time Xcode 4 on Lion OSX. I coded past projects on Xcode 3 on Snow Leopard.
Thank you

I don’t see you rebinding the array buffer in the method RenderTriangle

I rebind the array buffer before glVertexPointer.
Even if I put the array buffer binding in renderTriangle the program doesn’t work

Have you made sure the depth buffer is set up correctly? You must explicitly ask GLUT for a depth buffer.

And also: what does glGetError() return?

I don’t check for glGetError, the program run without error but there’s no any triangle, only black screen.

glGetError returns “0”/GL_NO_ERROR.
I call glGetError after glDrawElements function, is it correct?

I check this way:

if(glGetError == GL_NO_ERROR)
std::cout << "ok"

and program prints “ok” on console, so there’s no Gl Error

Solved the stupid problem.
It was a gluLookAt issue, now I put:

gluLookAt(0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, -2.0f);

in my render function

thank you for your answers