Witam, Okno w sfml stało się całe białe i nie da się nic zrobić. Wcześniej działało. Czym to może być spowodowane? I jak to naprawić? Oto kod: ```
#include <iostream>
#include <windows.h>
using namespace sf;
float jumpSpeed = 0.3f;
float MoveSpeed = 0.1f;
int checkskok = 1;
int main()
{
const float gravity = 1;
Vector2f velocity(sf::Vector2f(0, 0));
Texture PostacStoi;
PostacStoi.loadFromFile("_PNG/1_KNIGHT/Knight_01__IDLE_000.png", sf::IntRect(534, 175, 1266, 735));
Sprite Postac;
Postac.setTexture(PostacStoi);
Postac.setScale(0.2f,0.2f);
Postac.setPosition(10, 580);
Texture Tile2;
PostacStoi.loadFromFile("png/Tiles/2.png");
Sprite Tile2_1;
Postac.setTexture(PostacStoi);
Postac.setScale(1.f, 1.f);
Postac.setPosition(0, 672);
RenderWindow window(sf::VideoMode(1000, 700), "SFML works!");
while (window.isOpen())
{
velocity.x = 0;
velocity.y = 0;
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
int SkokWpow = Postac.getPosition().y;
if (Keyboard::isKeyPressed(Keyboard::W)) {
if (checkskok == 1) {
int SkokWpow = Postac.getPosition().y;
checkskok = 0;
}
int wysteraz = Postac.getPosition().x;
velocity.y = -jumpSpeed;
Postac.move(velocity.x, velocity.y);
if (wysteraz == SkokWpow + 100) {
while (wysteraz != SkokWpow) {
velocity.y = jumpSpeed + gravity;
Postac.move(velocity.x, velocity.y);
if (wysteraz == SkokWpow) {
checkskok = 1;
}
}
}
}
}
if (Keyboard::isKeyPressed(Keyboard::A) && Postac.getPosition().x < 0 ){
velocity.x = -MoveSpeed;
velocity.y = 0;
Postac.move(velocity.x, velocity.y);
}
if (Keyboard::isKeyPressed(Keyboard::D)) {
velocity.x = MoveSpeed;
velocity.y = 0;
Postac.move(velocity.x, velocity.y);
}
window.clear(Color(0,0,0));
window.draw(Postac);
window.draw(Tile2_1);
window.display();
return 0;
}