cocoa - glMultiDrawElements stops my code -



cocoa - glMultiDrawElements stops my code -

i'm trying larn opengl "the redbook", , i'm @ point i'm testing glmultidrawelements. got code work gldrawelements, , other "simpler" methods, stops working here, , i'm completly stuck. code supposed draw cube, , acctuall drawing code posted under:

glfloat verticies[] = {-0.5, -0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5}; glvertexpointer(3, gl_float, 0, verticies); glubyte front[] = {4, 5, 6, 7}; glubyte left[] = {0, 3, 7, 4}; glubyte right[] = {5, 1, 2, 6}; glubyte back[] = {0, 1, 2, 3}; glubyte bottom[] = {0, 1, 5, 4}; glubyte topp[] = {2, 3, 7, 6}; glvoid *faces[6] = {front, left, right, back, bottom, topp}; glmultidrawelements(gl_quads, 4, gl_unsigned_byte, faces, 6); glflush();

the programme cocoa based, , compile fine, stops under running due "exc_bad_access". there yellowish warning triangle next glmultidrawelements(..) saying "incompatible integer pointer conversion", tought using pointers in "faces" array (at to the lowest degree how looks in "the reddish book"). can somone help me?

the sec parameter glmultidrawelements() pointer array of sizes, not numerical value size. why compiler complaining integer pointer conversion (which, way, reason why should enable compiler flag turning warnings errors when doing cocoa development).

i believe changing above read

glsizei count[] = {4, 4, 4, 4, 4, 4}; glmultidrawelements(gl_quads, count, gl_unsigned_byte, faces, 6);

should work, haven't tested here.

cocoa opengl

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -