void ParticleSystem::PushOpenGLStates(sf::RenderWindow& target) const { // Switch to manual OpenGL handling, save SFML's state target.SaveGLStates(); target.SetActive(); // Switch blend mode, depending on glow effect if (mGlow) glBlendFunc(GL_SRC_ALPHA, GL_ONE); else glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); // Store attributes and assign them glPushAttrib(GL_DEPTH_BITS | GL_TEXTURE_BIT); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, mTexture->id); // Initialize projection matrix (2D view) glMatrixMode(GL_PROJECTION); glPushMatrix(); detail::SetupOpenGL2DView(target.GetView()); // Initialize modelview matrix (will be edited in Particle::Render()) glMatrixMode(GL_MODELVIEW); glPushMatrix(); }