I'm learning some OpenGL basics and when I decided to make a particle system I met some problems. When I'm trying to render GL_POINT with GL_POINT_SPRITE they do not show on the screen unless they are renderer first. Code I'm using for rendering:
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glColor3f(1.0f,1.0f,1.0f);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, t->id());
glBegin(GL_QUADS);
glTexCoord2f(0.0f,0.0f);
glVertex2f(10,10);
glTexCoord2f(1.0f,0.0f);
glVertex2f(100,10);
glTexCoord2f(1.0f,1.0f);
glVertex2f(100,100);
glTexCoord2f(0.0f,1.0f);
glVertex2f(10,100);
glEnd();
glDisable(GL_TEXTURE_2D);
glPopMatrix();
glPushMatrix();
glColor3f(1.0f,1.0f,1.0f);
glEnable(GL_TEXTURE_2D);
glEnable(GL_POINT_SPRITE_ARB);
glBindTexture(GL_TEXTURE_2D, t->id());
glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
glPointSize(32);
glBegin(GL_POINTS);
glVertex2f(300,300);
glEnd();
glDisable(GL_POINT_SPRITE);
glDisable(GL_TEXTURE_2D);
glPopMatrix();
SDL_GL_SwapBuffers();
This only renders a textured quad but not point. When I change the order (first render point then quad) they both appear on the screen (textured point and textured quad).
Am I doing something wrong here or is this correct behavior?
Some info about my PC migh be helpful - Arch Linux 64bit with AMD Mobility Radeon HD 4550 (Catalyst 12.6 driver)