PDA

View Full Version : plPointSize(float) is not working in Qt 4.7.



mozalincranz
25th July 2012, 18:24
I want to draw some different size points using opengl. However, glPointSize(float) is not working. I can draw a few simple shapes on the screen. However, this command just does not work. All I see is a few tiny dots. I have posted sample code.

void GLWidget::paintGL() {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1,0,0);
glBegin(GL_POINTS);
glPointSize(10.3);
glVertex2f(0,0);
glVertex2f(.2, .5);
glVertex2f(-.4, .3);
glEnd();
}

Can someone help with this?

wysota
25th July 2012, 18:45
Does it work in a non-Qt application?

mozalincranz
25th July 2012, 20:46
Yes, I tried this in command line and it works just fine.

wysota
25th July 2012, 21:35
What do you mean by "in command line"?

mozalincranz
25th July 2012, 21:45
This means without graphical user interface. This can be done by Qt console application.

wysota
25th July 2012, 21:47
So it does work with Qt but not when you display the GL result in a window? I was rather asking you to write a simple GL code without Qt and see if glPointSize() works there. It simply might be a matter of DPI or something similar.