My first post here, so hello everyone!
Iâve been playing around with SDL2 and I think Iâve come across a bug, either in SDL or in vmwareâs driver stack.
Some info ony my vm: (windows7 host)
x86-64, Archlinux, linux-3.14.4, sld-2.0.3, xf86-video-vmware-13.0.2.
The problem:
I am using SDL_RenderCopyEX() to draw a texture, this worked fine on native linux. (archlinux, 64bit, xf86-video-ati).
The same binary displays only a white box when running inside vm.
Fiddling with SDL_RENDERER_X does not help. I then set SDL_HINT_RENDER_DRIVER to âsoftwareâ, which works but only if you use SDL_RenderCopy(), with CopyEX, still just a white box.
I looked at src/render/SDL_render.c, and saw that CopyEx actually returns an error âRenderer does not support RenderCopyExâ, so I tried to catch it thinking that maybe I was at fault for initally not checking the renderfunction for errors, but it sails through, without errors.
I also found this comment with CopyEx:
/* We donât intersect the dstrect with the viewport as RenderCopy does because of potential rotation clipping issues⌠TODO: should we? */
So I conclude, somethings up with SDL_RenderCopyEx() under some specific conditions.
To make matters worse, it seems to also matter which image is loaded as a texture. (Example uses SDL_image to load png).
You can go to: http://lazyfoo.net/tutorials/SDL/07_texture_loading_and_rendering/index.php and download the example code. It wont work inside a vm.
Adding
Code:
SDL_SetHint(SDL_HINT_RENDER_DRIVER, âsoftwareâ);
will make it work.
But, swapping out RenderCopy with CopyEx will brake it again, DEPENDING on the image that is loaded.
The one that comes with that particular example will work (although libpng complians about itâŚ),
however, this (random example) : http://www.arabdoss.com/images/Page-BgTexture.png will not.
This is quite confusing, but maybe somebody wants/can try and confirm this.
Also, it would be nice to understand what that TODO in CopyEx alludes to.
Cheers!