Im trying to create weapon screen. i have the base of it. But how do i add the picture of the gun on it? Im using VBO to render the base of it.THis code draws a rectangle and puts a texture on it. But how do i but additional textures/pictures on this rectangle.In addition it should display currentammo and the totalammo of the weapon.

The first is easy:Take all of the textures and stuff them into a single big texture, and also store somewhere (somehow) where your textures in the big texture are located and how much space they take, or in easy words, just store their texture-coordinates (min-X Y, max-X Y).

Then just bind the big texture and access the single textures in the big one using simply their texture-coordinates.As I said, its easy.

The second one is not so easy:1. Take all of your single textures.2. Find ALL combinations your textures will have.3. Create a new texture for each combination... (This is the part where all the smart people *facepalm*)4. And combine the texture in memory into the new ones.5. 6. Draw the whateverything using your 'combined' texture.

You definitively CAN draw multiple shapes with a single VBO.Who told you that you can't draw multiple things with a single VBO?Even though I am not using VBO's (and never did), I do know for sure that you can draw as many rectangles as you want with them.

By the way. A buffer object just holds data, there's no such thing as rendering a buffer object. There's also no such thing as a buffer that can only hold one object. A buffer object just holds data, of course you can have multiple "objects" in a buffer.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org