PDA

View Full Version : Problem: I can only draw points



TheAlbinoGorilla
02-10-2004, 12:16 AM
Has anyone else experienced a problem where the only gl draw type they can use is GL_POINTS? I've tried all the other primitives, and they don't work, but glpoint works like a charm. I've tried code that works on other computers on mine, but to no avail.
I'm using visual studio.NET 2003, along with fltk 1.1.4 source compiled on the same system. My only guess at this point is that it's some sort of library issue. Does anyone have any suggestions?

Bob
02-10-2004, 01:04 AM
Without source to look at, the only thing I can say is that you're likely doing something wrong.

zeckensack
02-10-2004, 01:59 AM
GL_POINTS is the only primitive type that will produce a result with a single vertex. That may be it.

How are you sending geometry? If you are using vertex arrays (glDrawArrays, glDrawElements and friends), there's a "count" parameter that specifies vertices, not primitives. To render lines you must send at least two vertices per call, three for triangles, and four for quads.

If you're using glBegin/glEnd, the same thing applies. There must be at least three vertices inside a Begin/End pair to render a triangle.

TheAlbinoGorilla
02-10-2004, 09:42 AM
Sorry for not being more specific. I'm doing glBegin() glEnd() with glVertex calls in between. The code is for brushes in a painter program. For example, here's part of the circle brush code:

SetColor( source ); //glColor4ubv called in SetColor function
glBegin(GL_POLYGON);
for(GLdouble i = 0; i<=(2*3.1415926538);i+=(3.1415926538 / 180))
{
x = target.x + radius * cos(i);
y = target.y + radius * sin(i);
glVertex2d( x, y );
}
glEnd();

It works fine on other systems with fltk and visual studio, so it's not the code per se that's the issue. I've tried updating both, as well as my graphics card drivers, but the only glBegin parameter that works is GL_POINTS still. Does anyone know if maybe it has something to do with .NET, or the libraries it has?