Results 1 to 10 of 121

Thread: G.T.A.2 Map Editor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #26
    Whats the proper way to draw objects with vertex arrays?
    Is it better to do this before every single object drawn:
    Code:
        glEnableClientState(GL_VERTEX_ARRAY);
        glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    // draw my single object here
    // gldrawarrays
    
       glDisableClientState(GL_VERTEX_ARRAY);
        glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    Or just do once this at the beginning of drawing every object (all objects)?
    Code:
        
    
    glEnableClientState(GL_VERTEX_ARRAY);
        glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    for i:=0 to num_objects do begin
    // draw all my objects
    // gldrawarrays
    end;
    
       glDisableClientState(GL_VERTEX_ARRAY);
        glDisableClientState(GL_TEXTURE_COORD_ARRAY);

    Whats the better (in performance) to do this?

    Im currently using vertex arrays and not drawing that much of objects but still i get 25% CPU usage.
    I dont know what causes this CPU usage.

    I will try to pinpoint this of course in the meantime, but maybe the vertex array "order" is important.
    Thats why i asked


    EDIT: one thing i noticed, sometimes CPU usage is 25% sometimes 0.
    In the same place of map.

    I dont have any antivirus or something. But i do have enabled debug info and stuff.
    I decreased visible range by 1, will see if that reduced the CPU usage.
    Last edited by hwnd; 03-05-2014 at 05:06 PM.

Tags for this Thread

Bookmarks

Posting Permissions

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