PDA

View Full Version : Can't draw points



appdeveloper
10-12-2009, 06:49 AM
I'm trying to draw point over a textured polygon, but the points are not seen on screen, although everything else is. Is there any reason for this to happen?


Dim intCounter As Integer

Gl.glClear(Gl.GL_COLOR_BUFFER_BIT Or Gl.GL_DEPTH_BUFFER_BIT)



Gl.glPushMatrix()




Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture)
Gl.glBegin(Gl.GL_TRIANGLE_STRIP)
Gl.glColor3f(1.0F, 1.0F, 1.0F)

Gl.glTexCoord2f(-1.0, 0.0) : Gl.glVertex3f(0.0, m_size.Height, 0.0)
Gl.glTexCoord2f(-1.0, 1.0) : Gl.glVertex3f(0.0, 0.0, 0.0)
Gl.glTexCoord2f(0.0, 0.0) : Gl.glVertex3f(m_size.Width, m_size.Height, 0.0)
Gl.glTexCoord2f(0.0, 1.0) : Gl.glVertex3f(m_size.Width, 0.0, 0.0)
Gl.glEnd()

If m_curPoints > 0 Then
Gl.glPointSize(45)
Gl.glColor3f(1.0F, 0.0F, 0.0F)
For intCounter = 0 To m_curPoints - 1
Gl.glBegin(Gl.GL_POINT)
Gl.glVertex3f(m_Points(intCounter).X, m_Points(intCounter).Y, 0.0)
Gl.glEnd()
Next
End If

Gl.glPopMatrix()
Gl.glFlush()

Nighthawk
10-12-2009, 07:02 AM
Are they visible when you alter their z-value slightly(try 0.01f or -0.01f)?
Disable the texturing for debugging.

appdeveloper
10-12-2009, 07:15 AM
Thank you for your reply.
I've tryed your suggestions but didn't work. No points are drawn

todayman
10-12-2009, 07:48 AM
The constant you want for glBegin is GL_POINTS, with the 'S', not GL_POINT. GL_POINT gets used for the polygon mode, not a primitive type.

appdeveloper
10-12-2009, 07:58 AM
You are absolutly right. Thanks