16
General discussions / Re: New Release?
« on: April 07, 2012, 03:12:02 pm »
Laurent: Some of us can help you write the tutorials if you want.
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.
#include <sfml/graphics.hpp>
#include <iostream>
int main()
{
sf::Image i;
int a;
std::cin>>a;
return 0;
}
Yup, I did all the design, programming, and art. The music was from a band called The Volcanics and the sound effects were from a library.
In fact it might be a bug. Unfortunately I can't reproduce it, your first piece of code works fine on my computer.
What OS / graphics card / revision of SFML 2 do you use?
r1.Clear();
r1.Draw(spr1);
r1.Display();
app.Clear();
everything.SetImage(r1.GetImage());
app.Draw(everything);
app.Display();
The only limit is the amount of RAM that your graphics card has. But you shouldn't need so many render-images, what do you do with them?
#include <sfml/window.hpp>
#include <sfml/graphics.hpp>
int main()
{
sf::RenderWindow app(sf::VideoMode(800,600,32),"renderimage");
sf::RenderImage r1;
r1.Create(800,600);
sf::Image i;
i.LoadFromFile("Data/Sprites/test.png");
sf::Sprite spr1(i,sf::Vector2f(0,0));
spr1.Resize(800,600);
sf::Sprite everything;
while(app.IsOpened())
{
sf::Event e;
while(app.PollEvent(e))
{
switch(e.Type)
{
case sf::Event::Closed:
app.Close();
break;
}
}
app.Clear();
r1.Clear();
r1.Draw(spr1);
r1.Display();
everything.SetImage(r1.GetImage());
app.Draw(everything);
app.Display();
}
return 0;
}
#include <sfml/window.hpp>
#include <sfml/graphics.hpp>
int main()
{
sf::RenderWindow app(sf::VideoMode(800,600,32),"renderimage");
sf::RenderImage r1;
r1.Create(800,600);
sf::Image i;
i.LoadFromFile("Data/Sprites/test.png");
sf::Sprite spr1(i,sf::Vector2f(0,0));
spr1.Resize(800,600);
sf::Sprite everything;
while(app.IsOpened())
{
sf::Event e;
while(app.PollEvent(e))
{
switch(e.Type)
{
case sf::Event::Closed:
app.Close();
break;
}
}
app.Clear();
app.Draw(spr1);
app.Display();
}
return 0;
}