1
Graphics / Re: Efficient way to work ontop of a static image each frame
« on: April 23, 2012, 02:10:35 pm »
Thanks for the suggestion! I'll experiment with this.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
dynamicImage.create(staticImage.getWidth(), staticImage.getHeight(), sf::Color(0,0,0,0));
dynamicImage.copy(staticImage, 0, 0);
dynamicImage.setPixel(...);
dynamicTexture.loadFromImage(dynamicImage);
const SF::Vertex vertices[] = { SF::Vertex(SF::Vector2f(0.0f, app.getSize().y)), SF::Vertex(SF::Vector2f(app.getSize().x, app.getSize().y)), SF::Vertex(SF::Vector2f(app.getSize().x, 0.0f)), SF::Vertex(SF::Vector2f(0.0f, 0.0f)) };
const SF::Vertex vertices[] = { SF::Vertex(SF::Vector2f(-1.0f, 1.0f)), SF::Vertex(SF::Vector2f(1.0f, 1.0f)), SF::Vertex(SF::Vector2f(1.0f, -1.0f)), SF::Vertex(SF::Vector2f(-1.0f, -1.0f)) };
target.draw(&vertices[0], 4, SF::PrimitiveType::Quads, states);