Changeset 1292


Ignore:
Timestamp:
Apr 24, 2012, 8:17:58 PM (8 years ago)
Author:
sam
Message:

ps3: start fixing the vertex buffer logic in there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/vertexbuffer.cpp

    r1266 r1292  
    4747#elif defined _XBOX
    4848    D3DVertexBuffer *m_vbo;
    49 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     49#elif !defined __ANDROID__
    5050    GLuint m_vbo;
    5151    uint8_t *m_memory;
     
    246246        uint32_t index = l[n].m_flags & 0xffff;
    247247
     248#   if !defined __CELLOS_LV2__
    248249        glEnableVertexAttribArray((GLint)reg);
     250#   else
     251        switch (usage)
     252        {
     253        case VertexUsage::Position:
     254            glEnableClientState(GL_VERTEX_ARRAY);
     255            break;
     256        case VertexUsage::Color:
     257            glEnableClientState(GL_COLOR_ARRAY);
     258            break;
     259        }
     260#   endif
    249261
    250262        /* We need to parse the whole vertex declaration to retrieve
     
    269281
    270282        /* Finally, we need to retrieve the type of the data */
     283#   if !defined GL_DOUBLE
     284#       define GL_DOUBLE 0
     285#   endif
    271286        static struct { GLint size; GLenum type; } const tlut[] =
    272287        {
     
    300315                           || (tlut[type_index].type == GL_BYTE);
    301316
     317#   if !defined __CELLOS_LV2__
    302318        glVertexAttribPointer((GLint)reg, tlut[type_index].size,
    303319                              tlut[type_index].type, normalize,
    304320                              stride, (GLvoid const *)(uintptr_t)offset);
     321#   else
     322        switch (usage)
     323        {
     324        case VertexUsage::Position:
     325            glVertexPointer(tlut[type_index].size, tlut[type_index].type,
     326                            stride, (GLvoid const *)(uintptr_t)offset);
     327            break;
     328        case VertexUsage::Normal:
     329            glNormalPointer(tlut[type_index].type,
     330                            stride, (GLvoid const *)(uintptr_t)offset);
     331            break;
     332        case VertexUsage::Color:
     333            glColorPointer(tlut[type_index].size, tlut[type_index].type,
     334                           stride, (GLvoid const *)(uintptr_t)offset);
     335            break;
     336        }
     337#   endif
    305338    }
    306339#endif
Note: See TracChangeset for help on using the changeset viewer.