l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2005 Jan 30 09:58

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] opengl: lines and points
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] opengl: lines and points


These are some really embarrassing questions, but I've been stumped for a
while on this.

I've already written the requisite spinning cube.  I've even texture mapped
it.  I've written a "flight simulator" that lets you fly around a teapot.

But there are 3 really basic questions I'm at a complete loss at.

1. The only point size that appears to be available is the default pointsize
   of 1, whether I'm dealing with AA or not AA points.  I've verified this
   with glGetFloatv() and GL_POINT_SIZE_RANGE.

   If there are any GL programmers out there, I'm curious what point size
   ranges you have available on your system.

2. Same problems with lines.  It appears that the only available width is
   1.  I can make them thicker by drawing lines next to each other, but
   the only width available on my system, both AA and non-AA, is 1.  Again,
   I'm curious what other people have available to them.

3. Lastly, this code is completely mysterious:

   #include <GL/glut.h>

   void display(void)
      glClear (GL_COLOR_BUFFER_BIT);

      glBegin( GL_LINES );
         glColor3f( 1.0, 0.0, 0.0 );     // *1*
         glVertex2f( 400.0f, 50.0f );    // *1*
         glVertex2f( 400.0f, 550.0f );   // *1*

         glColor3f( 1.0, 1.0, 1.0 );     // *2*
         glVertex2f( 50.0f, 300.0f );    // *2*
         glVertex2f( 750.0f, 300.0f );   // *2*


   int main(int argc, char *argv[])
      glutInit(&argc, argv);
      glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
      glutInitWindowSize (800, 600); 
      glutInitWindowPosition (100, 100);
      glutCreateWindow (argv[0]);

      glClearColor (0.0, 0.0, 0.0, 0.0);
      glShadeModel (GL_FLAT);


      return 0;

This code should draw two perpendicular lines - one red, one blue.  I've
tried using both glut and SDL, and this code doesn't draw ANYTHING.

If I comment out the 2nd line (all source lines with "*2*"), then the first
line is displayed.

If I comment out the 1st line (all source lines with "*1*"), then the second
lines is displayed.

But the lines don't display at the same time.  There must be something very
fundamental about GL_LINES that I must not know.  Why don't these lines
display together?

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.