Jump to content
  • Advertisement
Sign in to follow this  
one mind

OpenGL How does opengl work?

This topic is 5386 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, today i was trying to learn software rasterization and now i can draw 2d lines using the bresenham algorithm. It got me thinking, how does opengl actualy draw lines. I mean, in my line function, you pass in 2 points and it draws a line between them by plotting pixels. With opengl, u define two points and call glBegin(GL_LINES) does opengl do pretty much the same thing and use the same algos as software except implements them on graphics cards or is it completly different? Is it possible to draw hardware lines without a graphics api? Thanks for any info

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by one mind
Hi, today i was trying to learn software rasterization and now i can draw 2d lines using the bresenham algorithm. It got me thinking, how does opengl actualy draw lines. I mean, in my line function, you pass in 2 points and it draws a line between them by plotting pixels.


I'm sure that that's just what OpenGL does too, although it's implemented in hardware (or at least partially in hardware)

Quote:

With opengl, u define two points and call glBegin(GL_LINES)
does opengl do pretty much the same thing and use the same algos as software except implements them on graphics cards or is it completly different?


There are not all that many different ways of drawing lines. Of course if you have antialiasing enabled it would work differently, but yes, it's basically the same

Quote:

Is it possible to draw hardware lines without a graphics api?


Only if you're prepared to program the hardware directly, this has several problems:
- It's hardware-specific
- It's likely to be extremely difficult
- It will have severe OS incompatibility issues because of the complexity of having to gain permissions to directly poke the hardware on modern OSs.

Mark

Share this post


Link to post
Share on other sites
I actually think most consumer level cards draw lines by using two really thin triangles. This explains why the performance for large numbers of lines can be poor.

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!