Ok I tried that, but I'm getting a weird bug. Tiny white dots appear near where my mouse is, and they aren't cleared everytime, rather they stay on screen. Here is the code for drawing:
void Engine::Process(){
while(window.pollEvent(event)){
if(event.type == (sf::Event::Closed)){
window.close();
}
}
sf::Vector2f mousePos(sf::Mouse::getPosition());
//sf::View
view.setCenter(mousePos);
}
void Engine::Render(){
//sf::RenderWindow
window.clear(sf::Color::Black);
//sf::RenderTexture
flashlight.clear(sf::Color::Black);
//comment the setView() out, program works fine
flashlight.setView(view);
flashlight.draw(board.GetWalls()[0].GetWallShape());
flashlight.draw(board.GetTexts()[0].GetText());
const sf::Texture &texture = flashlight.getTexture();
sf::Sprite sprite(texture);
window.draw(sprite);
window.display();
}
I'm confused as to why this isn't working, but it did work (displayed only the top left 75 * 75 pixels) without setting the RenderTexture's view.