Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm getting close now to OpenGL.

I wish I could draw a series of cubes in a single window, starting from an array of vertices.

Currently I have a list of objects that each contain an array of 8 vertices. So, I would draw them all as passing the 8 vertices to the drawing function..

Given that the "main" is not only to draw, how can I create a recursive function or similar that is called each time, so that I can enter all the cubes in the same window by each 8 vertices?

Someone can help me?
Posted
Comments
Richard MacCutchan 27-Dec-13 4:53am    
Just create a Draw function that takes the vertices as input parameters and draws the object from them. Pretty basic doding really.
Domus1919 27-Dec-13 4:58am    
ok, but I don't understand how bypass "main loop" since my main it isn't only to draw...or all the block "glBegin, glEnd" etc can be execute without problem without "main loop" instance?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900