Found the problem with that bit.
Const XRES=640 Const YRES=480 Const RRES= 32 bglCreateContext(XRES,YRES,RRES,0,BGL_BACKBUFFER | BGL_DEPTHBUFFER) HideMouse Global texname:Int Global ParticleList:TList = New TList ' ' Create the Fireworks as a type. ' Type Fireworks Field x#,y#,z# Field vy# Field xd#,yd#,zd# Field r#,g#,b# Field alpha# Field Blend% End Type Global ParticleCount InitOpenGL() glDisable(GL_CULL_FACE) Print glGetError() While Not KeyHit(KEY_ESCAPE) If MouseHit(1) Then CreateFireworks() RenderOpenGL() bglSwapBuffers() Delay 8 Wend Function RenderOpenGL() Local Update:Fireworks glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ' Clear The Screen And The Depth Buffer glLoadIdentity () glTranslatef(0,0,-20) For Update = EachIn ParticleList glPushMatrix() glColor4f( Update.r, Update.g, Update.b, Update.Alpha) glTranslatef (Update.x,Update.y,Update.z) glBegin (GL_QUADS) 'Draw using Quads. glVertex2f(-1.0, 1.0) 'Top Left. glVertex2f( 1.0, 1.0) 'Top Right. glVertex2f( 1.0,- 1.0) 'Bottom Right. glVertex2f(-1.0,- 1.0) 'Bottom Left. glEnd() 'Done Drawing The Quad. If update.Blend Then glBlendFunc(GL_SRC_ALPHA,GL_ONE) Else glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) EndIf ' Update.Alpha = Update.Alpha - .01 If Update.Alpha <0 ParticleList.Remove Update End If ' ' update.x = update.x + update.xd * 10 ' update.y = update.y + update.yd * 10 ' update.z = update.z + update.zd * 10 ' ' update.y = update.y + update.vy ' update.vy = update.vy + 0.02 glPopMatrix() Next End Function Function CreateFireworks() ' ' Here we go For starters. ' Local x#=Rand( -5, 5 ) Local y#=Rand( -5, 5 ) Local z#=-20 ' ' Colour scheme For this New batch of fireworks, ' Local r#=Rand( 2 ) Local g#=Rand( 2 ) Local b#=Rand( 2 ) Local create:Fireworks For Local amount=1 To 100 Local speed# = .00001 Local ang1# = Rand( 360 ) Local ang2# = Rand( 360 ) create = New Fireworks create.x = Rnd(-5,5) create.y = Rnd(-5,5) create.z = Rnd(-5,5) ' create.xd = Cos( ang1# ) * Cos( ang2# ) * speed# ' create.yd = Cos( ang1# ) * Sin( ang2# ) * speed# ' create.zd = Sin( ang1# ) * speed# create.r = Rnd(1) create.g = Rnd(1) create.b = Rnd(1) create.Blend = Rand(32) > 16 create.alpha = Rnd(1,1.5) ParticleList.AddLast Create Next End Function Function InitOpenGL() glEnable (GL_TEXTURE_2D) ' Enable Texture Mapping glShadeModel (GL_SMOOTH) ' Enable Smooth Shading glClearColor (0.0, 0.0, 0.0, 0.0) ' Black Background glClearDepth (1.0) ' Depth Buffer Setup glDisable (GL_DEPTH_TEST) ' Disable Depth Testing glEnable (GL_BLEND) ' Enable Blending glDepthFunc (GL_LEQUAL) ' The Type Of Depth Testing To Do glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) ' Really Nice Perspective Calculations glViewport (0,0,XRES,YRES) ' Set viewport glMatrixMode (GL_PROJECTION) ' Select The Projection Matrix glLoadIdentity () ' Reset The Projection Matrix gluPerspective (45.0,Float(XRES)/Float(YRES),0.1,100.0) ' Calculate Aspect Ratio glMatrixMode (GL_MODELVIEW) ' Select The Modelview Matrix glLoadIdentity () End Function