1
Graphics / Re: Drawing to 2 views simultaniously
« on: September 30, 2014, 02:50:36 pm »
Alright, thanks for your answer
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.
BrushW = Border->GetWidth();
Cx = (Solution.x / BrushW) + 1;
for(int i = 0; i < Cx;++i)
{
BackGround->Copy(*Border, i*BrushW, 0);
BackGround->Copy(*Border, i*BrushW, Solution.y - BrushW);
}
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <SFML/Graphics.hpp>
#include <list>
int WINAPI WinMain(HINSTANCE d1, HINSTANCE d2, LPSTR d3, int d4)
{
sf::RenderWindow *W = new sf::RenderWindow(sf::VideoMode(1024, 768, 32), "Test Window");
sf::Image I1, I2, I3, I4;
I1.LoadFromFile("Images\\CreateNetGame.png");
I2.LoadFromFile("Images\\Exit.png");
I3.LoadFromFile("Images\\JoinNetgame.png");
I4.LoadFromFile("Images\\Start.png");
sf::Sprite S1(I1, sf::Vector2f(0, 0)), S2(I2, sf::Vector2f(0, 200)), S3(I3, sf::Vector2f(0, 400)), S4(I4, sf::Vector2f(0, 600));
while (W->IsOpened())
{
// Process events
sf::Event Event;
while (W->GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
W->Close();
if(Event.Type == sf::Event::KeyPressed && Event.Key.Code == sf::Key::A)
W->Clear(sf::Color(255, 0, 255));
}
W->Draw(S1);
W->Draw(S2);
W->Draw(S3);
W->Draw(S4);
W->Display();
}
return 0;
}