Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Client Side OpenGl Rendering a line issue

  1. #1
    Newbie Newbie
    Join Date
    Jan 2019
    Posts
    1

    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:

    Code cpp:
            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
    Last edited by Dark Photon; 01-10-2019 at 06:47 PM.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,596
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •