Changeset 1077


Ignore:
Timestamp:
Nov 19, 2011, 2:00:16 PM (11 years ago)
Author:
sam
Message:

tutorial: get the Mandelbrot viewer to run on OS X.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/tutorial/tut03.cpp

    r1076 r1077  
    406406            m_ready = true;
    407407
    408 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__
     408#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    409409            /* Method 1: store vertex buffer on the GPU memory */
    410410            glGenBuffers(1, &m_vbo);
     
    416416            glBufferData(GL_ARRAY_BUFFER, sizeof(texcoords), texcoords,
    417417                         GL_STATIC_DRAW);
    418 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__
     418#elif !defined __CELLOS_LV2__ && !defined __ANDROID__
    419419            /* Method 2: upload vertex information at each frame */
    420420#else
     
    445445        }
    446446
    447 /* If other frames are dirty, upload fake data for now */
    448 if (0) for (int i = 0; i < 4; i++)
    449 {
    450     if (m_dirty[i])
    451     {
    452             glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i * m_size.y / 2,
    453                             m_size.x / 2, m_size.y / 2,
    454                             TEXTURE_FORMAT, TEXTURE_TYPE,
    455                             m_pixels + m_size.x * m_size.y / 4 * m_frame);
    456     }
    457 }
    458 
    459447        m_shader->Bind();
    460448        m_shader->SetUniform(m_pixeluni, m_pixel_delta);
    461 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__
     449#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    462450        glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
    463451        glEnableVertexAttribArray(m_vertexattrib);
     
    467455        glEnableVertexAttribArray(m_texattrib);
    468456        glVertexAttribPointer(m_texattrib, 2, GL_FLOAT, GL_FALSE, 0, 0);
    469 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__
     457#elif !defined __CELLOS_LV2__ && !defined __ANDROID__
    470458        /* Never used for now */
    471459        //glEnableVertexAttribArray(m_vertexattrib);
     
    480468        glDrawArrays(GL_TRIANGLES, 0, 6);
    481469
    482 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__
     470#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    483471        glDisableVertexAttribArray(m_vertexattrib);
    484472        glDisableVertexAttribArray(m_texattrib);
    485473        glBindBuffer(GL_ARRAY_BUFFER, 0);
    486 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__
     474#elif !defined __CELLOS_LV2__ && !defined __ANDROID__
    487475        /* Never used for now */
    488476        //glDisableVertexAttribArray(m_vertexattrib);
     
    502490    Shader *m_shader;
    503491    GLuint m_texid;
    504 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__
     492#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    505493    GLuint m_vbo, m_tbo;
    506494    GLuint m_tco;
     
    520508};
    521509
    522 int main()
     510int main(int argc, char **argv)
    523511{
    524512#if defined _WIN32
Note: See TracChangeset for help on using the changeset viewer.