Hello Everyone,
I just started off with some openglProgramming.
I am using the Tao OpenGL library.
Here is my question:
When I am drawing rectangles in 2d, do I always have to re-draw old rectangles?
or is there a way that I draw only new ones?
What I am doing here is:
Gl.glViewport(0, 0, Me.Width, Me.Height)
Gl.glClearColor(0.5F, 0.5F, 0.5F, 0.5F)
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT)
Gl.glMatrixMode(Gl.GL_PROJECTION)
Gl.glLoadIdentity()
Dim r = 45
Gl.glOrtho(-r, r, -r * (_height / _width), r * (_height / _width), -r, r)
Gl.glPushMatrix()
Gl.glColor3f(1.0F, 0.5F, 0.5F)
Gl.glBegin(Gl.GL_LINE_LOOP)
Gl.glVertex2f(0, 10)
Gl.glVertex2f(10, 10)
Gl.glVertex2f(10, 20)
Gl.glVertex2f(0, 20)
Gl.glEnd()
Gl.glPopMatrix()
Gl.glFlush()
Gdi.SwapBuffers(hDC)
And when I draw again, I need to re-run this code...
So is it necesssary to re-draw or is there another way out?
-Videep