I have an issue as my Window does not show anymore when i use a PNG image, it works when switching back to BMP tho...
Here's the function :
SDL_Surface*load_pngjpg(charconst*path){intflags=IMG_INIT_PNG|IMG_INIT_JPG;intinitiated_flags=IMG_Init(flags);if((initiated_flags&flags)!=flags){std::cout<<"Failed to initialize all image loaders\n";std::cout<<"IMG Error: "<<IMG_GetError()<<"\n";}SDL_Surface*image_surface=IMG_Load(path);if(!image_surface){std::cout<<"Failed to open image\n";std::cout<<"IMG Error: "<<IMG_GetError()<<"\n";}SDL_FreeSurface(image_surface);}
I have an issue as my Window does not show anymore when i use a PNG image, it works when switching back to BMP tho...
Here's the function :
I did include SDL_Image.h and added the dlls and libs to my project and to my CMakeLists.txt
Replacing
SDL_FreeSurface(image_surface)toreturn image_surfaceworked.If that can help someone.