Jump to content
  • Advertisement
Sign in to follow this  
HopHopTraLaLaGdaltiBshAna

About drawing circle with VBO

This topic is 1518 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

In my project I need to draw a circle , until now I had used vertex buffer object for drawing my object to the screen .

but now I need to draw some circle to the screen , my circle contains between 300 and 2500 points , so I would like to ask what is more efficient way to draw the circle , with VBO or glBegin/glEnd

Share this post


Link to post
Share on other sites
Advertisement

The words "efficient" and "glBegin/glEnd" just doesn't belong in the same sentence. Such a trivial object isn't going to push any performance boundaries anytime soon though, so it is more of general interest, but don't even consider immediate mode if you have a choice. Besides performance issues when you actually start to push larger objects, immediate mode rendering simply isn't available in the modern OpenGL API where vertex arrays is your only option.

Share this post


Link to post
Share on other sites

The words "efficient" and "glBegin/glEnd" just doesn't belong in the same sentence. Such a trivial object isn't going to push any performance boundaries anytime soon though, so it is more of general interest, but don't even consider immediate mode if you have a choice. Besides performance issues when you actually start to push larger objects, immediate mode rendering simply isn't available in the modern OpenGL API where vertex arrays is your only option.

 

ok I understood you , but what do you mean when you saying : "vertex arrays is your only option". ?

 

and antoher question , if my objects change constantly , so should I save his vertexs in the regualr varrible, in addition to VBO ?

Share this post


Link to post
Share on other sites

ok I understood you , but what do you mean when you saying : "vertex arrays is your only option". ?

The only way to draw something in the modern OpenGL API (from version 3.0 and forward, excluding some early versions including compatibility mode) is by using vertex arrays. Immediate mode rendering, using glBegin/glEnd, has been removed from the API and is no longer an option.

 

 

and antoher question , if my objects change constantly , so should I save his vertexs in the regualr varrible, in addition to VBO ?

Create a dynamic buffer object. You specify your intended read and write usage as the last parameter to glBufferData, so if you intend to modify it alot, you create a dynamic buffer object. And depending on what you mean by changing, there may be other solutions better suited for shaders and uniform parameters.

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!