Jump to content
  • Advertisement
Sign in to follow this  
Dougie

OpenGL Engine rendering

This topic is 5412 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm constructing a OpenGL engine which uses SDL for cross platform compatiblity. I'm using OOP style drawing, where each object to be drawn has its draw member called (using virtual function). however, I would like to know if its alot more efficient to use one call to glDrawElements or if multiple calls aren't much more efficient. Also, is glDrawElements the most efficient way to render in OpenGL? Thanks

Share this post


Link to post
Share on other sites
Advertisement
It is certainly better to batch rendering into a small number of drawing calls. As far as I know the preferred drawing method is glDrawRangeElements.

Share this post


Link to post
Share on other sites
Ok, I've found out glDrawRangeElements needs OpenGL 1.2. I need to update my OpenGL headers (and, I assume, my GX drivers). My headers state their version 1.1. I'm using a Geforce 4 card, but I can't find anything useful on the nvidia site. Can anyone help?

EDIT: O, and, for example, would it be bette, if two objects used the same texture, to use GL_TRIANGLES and render both in one go, or to render each using GL_TRIANGLE_STRIP? Assuming, say 16+ primitives/triangles each

Share this post


Link to post
Share on other sites
Unfortunately, the latest OpenGL lib Microsoft has released is for version 1.1 (as you already know). You have to grab the function as an extension. See the FAQ for more details. Also, you may consider using an extension loading helper library, such as GLee.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dougie
EDIT: O, and, for example, would it be bette, if two objects used the same texture, to use GL_TRIANGLES and render both in one go, or to render each using GL_TRIANGLE_STRIP? Assuming, say 16+ primitives/triangles each


Texture switching is generally more expensive than rendering a few more primitives. I would probably just render both in one call using a triangle list.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!