Multiplying by 1 actually does hard work. It positions all the blocks side by side. If i remove it all blocks are on top of each other.
One idea i had is to use some list with all blocks already with correct X,Y,Z coords translated mathematically and just let opengl draw them. Just a rough idea. I still will need gltranslate i guess, dunno.
And i found now that displaylist increased performance alot.
33% CPU with area of 33x33, using vertex arrays and drawing only lids.
With 23x23 its around 3-7% which is fine for me.
Now i need some ideas, how to rebuild display list after map array modification so it will render the changes?
Just gldeletelists and create new list after each mouse map manipulation?
Edit:
my idea, have some list (vector, tlist) with all the needed blocks and coordinates. If user modifies block it will get added / removed / modified. And make_displaylist function just loops through all these blocks and positions them.
And in draw() i just call that list.
If i modify map, again loop through block list and make new display list.
Dunno if it will work.
Bookmarks