Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Too many vertexes



Hi,
I have to pass to the VBO function an array with 480000 vertexes * 3
coordinates, but when I try to allocate the array in the stack, it doesn't
fit.

    int         mTotVertexes = 480000;
    GLfloat     vertexes[mTotVertexes][3];
    glBufferData(GL_ARRAY_BUFFER, (sizeof(GLfloat) * mTotVertexes * 3),
                 vertexes, GL_STATIC_DRAW);

So I have tried to calloc the array this way.
    
    GLfloat **vertexes = (GLfloat**)calloc(mTotVertexes, sizeof(GLfloat*));
    for(i = 0; i < mTotVertexes ; i++){
        vertexes[i] = (GLfloat*)calloc(3, sizeof(GLfloat));
    }

But now when I run I get the "MyApp has exited due to signal 11 (SIGSEGV)"
message. 0x16891ca4  <+0652>  b       0x16891cb0 <glBufferData_Exec+664>
How to fix this problem?
    

Best Regards
-- 
Lorenzo
email: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.