Client Side OpenGl Rendering a line issue

Hi guys,

I used OpenGL server side to render lines and it worked fine as expected. Now I converted them to server side. Now they render Vertically straight rather than horizontal. Any reason why? Please any help. My client code is below:


        glEnableClientState(GL_VERTEX_ARRAY);
        //Upload the data to graphics card
        for (int j = 0; j < 200; j++)
        {
                        //m_sArray is an array of size 200 and m_position is a set of 3. Holding x, y, z.
            glVertexPointer(3, GL_FLOAT, 0, &pElement->m_sArray[j].m_position);
        }
        glDrawArrays(GL_LINES, 0, 3);
        glDisableClientState(GL_VERTEX_ARRAY);

Many thanks

This doesn’t make much sense.

You said “server side” twice (for the before and for the after).

Also, the code you posted is rendering vertex data still stored on the client side (i.e. from app CPU memory).

Also, you’re setting the vertex attribute pointer repeatedly without doing draw calls which each setting. All of these but the last is effectively a no-op.

Why don’t you back up and describe what you’re trying to do and why. Then we’ll go from there.