Hi, i have a bit of code that geneterates a list of x,y positions to draw some quads, it then goes thru and draws them. however it only seems to like to add 3 or 4 even tho there are 30 being added
can n e one spot a reason ??
SuperStrict SetGraphicsDriver GLGraphicsDriver() GLGraphics 640,480 Global tmpImg:TPixmap,tex% tmpImg = LoadPixmap("pen.png"); tex = GLTexFromPixmap(tmpImg); Type Units Field sx:Float=0.0; Field sy:Float=0.0; End Type Global penList:TList = New TList glInit(); Repeat glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() For Local tl:units = EachIn penList glTranslatef(tl.sx,tl.sy,0); glBegin(GL_QUADS); glcolor4f(1,0,0,0);glVertex3f(0, 0, 0.0); glcolor4f(0,1,0,0);glVertex3f(0, 32, 0.0); glcolor4f(0,0,1,0);glVertex3f(32,32, 0.0); glcolor4f(1,0,1,0);glVertex3f(32,0, 0.0); glEnd(); Next Flip() Until KeyDown(key_escape) Function AddNew() Local tl:Units = New Units; penList.addlast tl; tl.sx = Rnd(300); tl.sy = Rnd(300); End Function Function glInit() SeedRnd MilliSecs() For Local i:Int = 1 To 60 addnew() Next glViewport(0,0,640,480); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glortho (0.0,640,480,0,-1.0,1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClearColor(1,1,1,1); End Function
can n e one spot a reason ??