AndEngine icon indicating copy to clipboard operation
AndEngine copied to clipboard

Started implementing IBO

Open MakersF opened this issue 12 years ago • 0 comments

I started implementing a VBO that also uses a IBO for drawing a mesh.

I'm unsure if it is better (or you prefer) to have 1)a single object that work both as VBO and IBO, handling the 2 buffers(locally and on the gpu) and managing all the drawing(like in the proposed commit), or 2)a separate object for IBO, that actually is really similar to VBOs, but doesn't have the method draw, and then add a draw method to all the VBOs that takes a boolean as a variable to decide if drawing with glDrawArrays or glDrawElements.

First would be more handy, but does it make sense to have an object that actually represent 2 distinct of them? The second seams more logical, but it's far less handy, since all the shapes should take care of all the operations of the IBO, and would force all the shapes that uses it to store additional members(complicating the class). Maybe a component that store a VBO and an IBO, and it is the actual interface that the shapes uses to draw? (it should implement the draw method, and should be able to decide which function to use according to the presence of the IBO, while all the other calls would be redirected to the appropriate buffer object)

I'm really unsure about the right path to follow, so i would like to discuss it here before starting to code something that would not be useful(since i already have the implementation i need, i would prefer not to lose time on something not useful to others)

(The commit i posted is just to show some code, it is not absolutely ready to go into trunk, i would reimplement it using the right interfaces and extending the appropriate superclasses)

PS: is there a mailing list where to discuss this type of things?

MakersF avatar Sep 05 '12 18:09 MakersF