1
Graphics / Re: Shape setposition
« on: June 14, 2012, 05:02:56 am »
Thank you.
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.
Where is getRGBA?
customTexture.create(640, 480);
window.create(sf::VideoMode(1366, 768, 32), "Rendering Camera", sf::Style::Default, windowSetting);
window.setActive();
customTexture.setSmooth(true);
customSprite.setTexture(customTexture);
customSprite.scale(2.13f,1.6f);
while(window.isOpen())
{
while(window.pollEvent(evt))
{
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{ window.close(); exit(1);}
if(evt.type = sf::Event::Closed)
window.close();
}
newCam->Update();
for(long int i = 0; i < 640*480; i++)
{
wRGBA[i].r = (unsigned char)newCam->getRGBA(i, 'r');
wRGBA[i].g = (unsigned char)newCam->getRGBA(i, 'g');
wRGBA[i].b = (unsigned char)newCam->getRGBA(i, 'b');
wRGBA[i].a = 255;
}
pixels = (sf::Uint8*)(wRGBA);
customTexture.update(pixels);
window.draw(customSprite);
window.display();
}
Depends on what you do exactly, which we have no idea about.