Re: Failed to load SHCORE.DLL
"BenoitRen" <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
I've found my problem. My program was stalling because it couldn't find an INI file (forgot to copy my assets and configuration files), a situation I did not foresee, causing the program to get stuck somehow. The error about SHCORE.DLL is the last internal error that SDL2 detected, but it was not blocking and unrelated. Now my window appeared, but it remained blank. I fixed this problem as well, which, in a way, is because of an undocumented change that isn't mentioned in the migration guide. In SDL 1.2, if you wanted to copy (part of) a surface to another, you used SDL_BlitSurface. The fourth argument, dstrect, specified at what position on the destination surface you wanted to copy the source surface to. The documentation states "Only the position is used in the dstrect (the width and height are ignored).". In SDL 2.0, if you want to copy (part of) a texture to the current rendering target, you use SDL_RenderCopy. This works like SDL_BlitSurface, except for one important change: the width and height in dstrect are /not/ ignored. So if you were like me and just set those two values to zero, nothing would get copied. You need to specify the width and height of what you want to copy. If you want to copy part of a texture, you can use the dimensions of srcrect. But if you want to copy the entirety of the source texture, you have to query its dimensions, because unlike SDL_Surface, SDL_Texture does not have its dimensions as struct members. _______________________________________________ SDL mailing list [email protected] http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org