PDA

View Full Version : glPointSize does not seem to work



01-20-2001, 02:25 PM
I am trying to implement a sample program that draws three dots in a window.

No matter what point size I specify, the dots are always very tiny when I re-build and execute.

Here is my code:

#include <iostream.h>
#include <gl/glut.h>

//<<<<<<<<< myInit >>>>>>>>>>>>
void myInit(void)
{

glClearColor(1.0,1.0,1.0,0.0);
glColor3f(1.0, 0.0, 0.0);
glPointSize(10.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 640.0, 0.0, 480.0);
}

//<<<<<<<<< myDisplay >>>>>>>>>
void myDisplay(void)
{
cout << "In myDisplay..." << endl;
glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POINTS);
glVertex2i(100, 50);
glVertex2i(100, 130);
glVertex2i(150, 130);
glEnd();
glFlush();
}

//<<<<<<<<<<<< main >>>>>>>>>>>>>
void main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(640,480); glutInitWindowPosition(100,150); glutCreateWindow("my first attempt");
glutDisplayFunc(myDisplay); myInit();
glutMainLoop();
}

Thanks.

zed
01-20-2001, 03:22 PM
perhaps your videocard/drivers cant handle large points?
look here http://www.gamedeveloper.org/delphi3d/hardware/

Rob
01-21-2001, 04:51 PM
I might be wrong about this, but I seem to recall that you need to enable blending to get pointsize to work. It's been a while though.

zed
01-21-2001, 06:02 PM
thats only if u want round points

billy
01-22-2001, 04:50 AM
I am not sure about this but I think that you need to call glPointSize just before glBegin. To obtain round points use glEnable (GL_POINT_SMOOTH); before glBegin.

chennes
01-22-2001, 04:58 AM
It shouldn't matter where you put the glPointSize() as long as it's somewhere before the glBegin()...right?

Chris