SDL_RenderCopy & RenderCopyEX + vmware-linux guest (bug!?)

My first post here, so hello everyone! :smiley:

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!

Quote:

/* 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.

This comment means that clipping of the destination rectangle is not done
because if you take a rectangle, and then rotate it, the destination
rectangle on screen will be different. For example, a rectangle of 10 by
20, rotated at 90 degrees becomes a rectangle of 20 by 10
This is not a problem in general because the accelerated backends do a
better job at clipping than what we can do by manually rotating the
rectangle and trying to figure out where things end up.

TL;DR: I don’t think that’s the cause of the issue you are seeing.–
Gabriel.

I don’t think that’s the cause of the issue you are seeing.

Well I don’t think its the cause either, but seeing that this is the main difference between Copy and CopyEx thought that this behaviour at least triggers the actual problem, which must lie with

the accelerated backends do[ing] a better job at clipping

– in this case though, it seems to fail. I have no idea on how to follow this further though…