[Gambas-user] gb3: recent changes to PaintImage and DrawImage
Kevin Fishburne
kevinfishburne at ...1887...
Sun May 1 05:24:56 CEST 2011
On 04/30/2011 11:07 PM, Benoît Minisini wrote:
>>
>> Does SDL even have a rotate function? I did some quick research and
>> found mixed results. Looks like there's something called SDL_gfx that
>> might do it (rotozoomer). If SDL flat-out isn't designed to do it, then
>> I perfectly understand the encouragement to implement OpenGL functions.
>> Seems strange though that SDL can't rotate a 2D bitmap efficiently in
>> hardware. Even the SNES could do that.
>
> AFAIK, SDL does not use hardware on Linux (but Laurent may tell I am wrong).
> All image processing are done in software.
>
> gb.sdl draw things by using OpenGL, so it is hardware accelerated when using
> the Draw.Image() method.
>
> But it does not override any method of the Image class, and so does not
> accelerate rotation. But it could.
My heart was warmed when I read that. From what I understand, SDL is an
OpenGL/DirectX wrapper (dependent on platform, of course) that attempts
to simplify basic 2D graphics functions so that the underlying
OpenGL/DirectX library is not exposed to the user. So your description
sounds correct, although I don't see why SDL wouldn't accelerate
functions using OpenGL on Linux platforms, especially using the binary
NVIDIA driver.
I found this:
http://stackoverflow.com/questions/1183900/best-way-to-rotate-an-image-using-sdl
which indicates there is no native SDL image rotation function. It seems
SDL may be used in "OpenGL mode" and rotation can be performed there.
The interesting thing is that because SDL is an OpenGL (in our case)
wrapper, in theory it could be extended in GAMBAS to do things that the
standard SDL wasn't made to do. Maybe I should just shut the hell up and
try to learn to implement OpenGL and SDL in GAMBAS. I'm starting to
think that. ;)
And yes, Laurent probably has more solid info that you or I.
--
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271
More information about the User
mailing list