![]() ![]() In this function Iâm showing the folders of my current directory and Iâm make an image load of each folder, if it work it write âworkedâ else it print an error message. Right now my implementation in the Texture.cpp looks like this: include 'Texture.h' include include include![]() I also correctly linked my libraries, I have pain to understand why, IMG_Load is not able to load my images. and only need SDL2 (or rather SDLImage 2) for loading PNG Images and converting them to OpenGL textures. When I try to load the texture, and use SDLQueryTexture () it gets the size and everything just fine. I have an image called Red.png in my res/img/ folder. You should load those into an array of SDLTextures and then switch the array index of the surface youre drawing with the one you currently want to show. You can load Healer0.png to Healer15.png yourself, you can do that with a loop and some string manipulation. I am trying to render an image using SDLimage v2.0.0, in SDL2. begingroup Thanks, Ive pasted the code into your post. This is strange because the file exist, as I you can see in my output. SDLimage is an image file loading library. SDL2image rendering not working properly. Fill that new surface with your desired background color using SDLFillRect. Heres how you can achieve that: Create a new surface of the same dimensions as your image. I have an image called underground.png and when Iâm loading it, Iâm permanently get the error : âIMG_Load : Failed loading libjpeg-9.dll specified is unfoundableâ. To give a background color to your transparent image, you will need to fill the images surface with the desired background color before creating a texture from it. Is there something minor I may have missed include include includeexe so I am not sure why it is not displaying. I have a big problem with IMG_Load function from âSDL_image.hâ. The code compiles just fine and the image has been placed in the debug folder with my. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |