Hi, whenever I run my application, and I want to set rect image to the grass. It keeps on giving me a first chance exception. Here is the 2 stacktraces
First-chance exception at 0x1004ab8d in Game.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x1004ab8d in Game.exe: 0xC0000005: Access violation writing location 0x00000000.
I'm a little confused, could anybody tell me what is going on? I have added the code that is drawing and setting the rect on the screen below.
sf::RectangleShape rect;
sf::Texture* grass;
grass->loadFromFile("grass.png");
rect.setSize(sf::Vector2f(16,16));
rect.setTexture(grass);
rect.setPosition(x * 16, y * 16);
window.draw(rect);
window.setView(map_view);
window.display();