Are point and line not treated as polygon in GL?

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

Recommended Posts

Hi, in a program, I drew some something on the screen, in 2D, then I wanted to draw some points and lines above them. I didn't use a closer z value, so these points and lines counldn't pass the depth test. So I tried to use glPolygonOffset, but I met troubles.

I called glPolygonOffset like this:
glPolygonOffset(0.0f, -1.0f);

First I drew quads with PolgyonMode set to GL_FILL, enable GL_POLYGON_OFFSET_FILL, and everything is ok, the wireframe of the quads were displayed correctly on the screen.

To draw the points, with the same offset setting, I tried to enable GL_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_LINE, GL_POLYGON_OFFSET_POINT, but none of them worked.

I searched on google but didn't find the answer. I am thinking that whether point and line are not polygon in GL, so they are not affected by glPolygonOffset? If they were polygon, which type should I use, GL_POLYGON_OFFSET_FILL or GL_POLYGON_OFFSET_POINT?

Thanks.

Share on other sites
The point and line depth offsets applies only to points and lines drawn as a result of setting the polygon fill mode. See glPolygonMode.

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 12
• 9
• 11
• 15