Hello I am trying to make a small game and I follow this tutorial for the framework https://www.youtube.com/watch?v=bKiejuOaJtU&list=PLhJr2LOK-xwxQlevIZ97ZABLw72Eu9he7&index=4. I am working with Visual Studio 2019, In my Graphic.cpp in the class SDL_Texture* Graphics::LoadTexture I convert the surface into a texture to be able to render it using the renderer. However I am getting an Unhandled Exception and I cant figure out why?
Here I uploaded the error and the header code.Thanks in advance!
//---------------------------------------------------------------
// Graphics
//---------------------------------------------------------------
class Graphics {
public:
static const int SCREEN_WIDTH = 800;
static const int SCREEN_HEIGHT = 600;
private:
static Graphics* sInstance;
static bool sInitialize;
SDL_Window* mWindow;
SDL_Surface* mBackBuffer;
SDL_Renderer* mRenderer;
public:
static Graphics* Instance();
static void Release();
static bool Initialized();
SDL_Texture* LoadTexture(std::string path);
SDL_Texture* CreateTextTexture(TTF_Font* font, std::string text);
void ClearBackBuffer();
void DrawTexture(SDL_Texture* tex, SDL_Rect* clip = NULL, SDL_Rect* rend = NULL);
void Render();
private:
Graphics();
~Graphics();
bool Init();
};
#endif