![]() So IMGLoad is the old way to load in SDL images, from SDL 1 i believe. You can download the project for making a loading screen : Loading.7z (VS2015). texture SDLCreateTextureFromSurface(renderer, surface) SDLFreeSurface(surface) return texture Thanks, so IMGLoadTexture and IMGLoad to load a surface an then convert it to an texture is the same. ![]() ![]() Im half certain that the problem lies in the program actually finding the image in the folder, but I cant see the reason. png image to a surface, so does SDLLoadBMP when attempting to load a. One interesting thing to notice is that SDL_image is initialized in the thread and not in the rendering thread. begingroup Using IMGLoad also fails to load the. Suppose you have the following SDLimage function call in your code to load an image: SDLSurface image image IMGLoadRW ('background.png', 1) That code works only if the file background. Loading a texture is as easy as this: int textureID SOILloadOGLtexture('img. I have used the same texture over and over again but you will be using your real content to load.įor convenience, I have hardcoded the paths inside an array, do not do that in your game use an XML or JSON file so you do not need to recompile the game each time you change an asset! The most common cause of trouble of PNG file loading is the operating system being unable to find the file. This link show you how to set up SDL library/libpng16-16.dll to be available for acceess by the compiler.exe (the last step right before the sample code) yourProgram proprety page -> Builds event-> post-build event. Its a very easy to use OpenGL texture loader library, you dont have to worry about the image format or make any loading code yourself, it will do it all for you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |