Line 13 is RenderWindow Window(vm, "Timber!!!", style::Fullscreen);
Hi so I have just started learning programming I used to just used UE4 Blueprints, anyway i picked up a book that uses SFML to teach game programming its a little out of date so I've been using the SFML website to fix most of the descrepancys anyway I get this 'Exception Unhandled' and the following : Unhandled exception at 0x00A75DF8 in Timber.exe: 0xC0000005: Access violation writing location 0x00000069. occurred
I cant find any site saying this or fixing it can anyone explain what i am doing wrong?
Using VS community 2017
#include "stdafx.h"
#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{
//creates a video mode object 1920x1080
VideoMode vm(1920, 1080);
//open the window in fullscreen
RenderWindow Window(vm, "Timber!!!", Style::Fullscreen);
//create a texture to hold the graphic on the GPU
Texture textureBackground;
//load a graphic into a texture
textureBackground.loadFromFile("graphics/background.png");
// create sprite
Sprite spriteBackground;
//Attach the texture to the sprite
spriteBackground.setTexture(textureBackground);
//set the sprite background to cover the screen
spriteBackground.setPosition(0,0);
while (Window.isOpen())
{
/*
******************************************
Handle Player input
******************************************
*/
if (Keyboard::isKeyPressed(Keyboard::Escape))
{
Window.close();
}
/*
******************************************
Update the scene
******************************************
*/
/*
******************************************
Draw the scene
******************************************
*/
//Clear everything from the last frame
Window.clear();
//Draw our game scene here
Window.draw(spriteBackground);
//show everything we just drew
Window.display();
}
return 0;
}
User contributions licensed under CC BY-SA 3.0