1
SFML projects / Re: Ninja teaser
« on: January 03, 2014, 11:22:11 am »
Hah, still alive and stabbing!
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.
Anyone worked with OSL & 2D?Open Software License or Open Source Lighting or Open Shading Language?
Looking good!
Are you using any animation software like for example Spine?
The artwork is great, so just let's get excited for next week
Have you tried using window.pushGLStates() and window.popGLStates() as described in this tutorial http://sfml-dev.org/tutorials/2.1/window-opengl.php ?
sf::RenderTexture ninjaRender[maxPlayers];
...
for (int i = 0; i < maxPlayers; i++)
{
ninjaRender[i].create(256, 256);
ninjaRender[i].setView(*ninjaRenderView);
ninjaRender[i].clear(sf::Color(0, 0, 0, 0));
ninjaRender[i].display();
}
ninjaRender[ninjaNum].clear(sf::Color(0, 0, 0, 0));
ninjaRender[ninjaNum].draw(*anim->drawable);
ninjaRender[ninjaNum].display();
mainWindow->draw(sf::Sprite(ninjaRender[ninjaNum].getTexture()));
glEnable(GL_TEXTURE_2D);
sf::Texture::bind(&ninjaRender[ninjaNum].getTexture());
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 1.0f); glVertex2f(0, 0);
glTexCoord2f(1.0f, 1.0f); glVertex2f(256, 0);
glTexCoord2f(1.0f, 0.0f); glVertex2f(256, 256);
glTexCoord2f(0.0f, 0.0f); glVertex2f(0, 256);
glEnd();
You can draw to an sf::RenderTexture.
sf::Texture::bind(myRenderTexture);