PDA

View Full Version : Rendering single lines



06-22-2002, 05:37 AM
Allright, this may sound as a very dumb question to most of you developers here, but I'm still going to ask it... http://www.opengl.org/discussion_boards/ubb/wink.gif

So, I wonder if it's possible to render a single, (un)colored, (un)lightened, (un)textured line in OpenGL? I mean, I might just draw a really thin square, but woulnd't that be unneficient, and unneccessary, since I only want to draw a single line?

Bob
06-22-2002, 05:48 AM
glBegin(GL_LINES);
{
glVertex(start point);
glVertex(end point);
}
glEnd();

For (un)lit, (un)textured lines, enable/disable states as you wich. If you want textures, enable it. If you don't want lighting, disable it, and so on.

06-22-2002, 07:05 AM
Hey, thanks man! You really helped me!