Re: adding texture scaling functionally to SDL2_perl

[email protected] ("Kartik Thakore") Fri, 09 Aug 2013 11:37:28 -0700 (PDT)
Newsgroups perl.sdl.devel
Message-ID <1376073447307.7cb65a1a@Nodemailer>
------Nodemailer-0.5.0-?=_1-1376073448208
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Thanks mason,


Can you make these feature requests as issues on http://github.=
com/PerlGameDev/SDL2

On Fri, Aug 9, 2013 at 2:25 PM, Mason James <[email protected]> wrote:

> hi sdl-devel
> i am planning/researching about adding a small amount of SDL2=5FPerl code=
 into my existing SDL=5FPerl app, for a framerate increase
> i have one long-standingly slow bit of code in my app, that i would like =
to replace with SDL2 code
> my slow code is a SDL::GFX::Rotozoom::surface() call. but SDL2 has =
'hardware accelerated' stretching/scaling/zooming [1], yay!
> i checked the SDL2 version of ./SDL2=5Frotozoom.c, and it is still using =
the current slow software method (no changes)=20
> but the good news is=E2=80=A6 there seems to be a preferred method to =
achieve this fast hardware scaling in SDL2
> SDL2's SDL=5FRenderCopyEx() function [2] will scale a texture using a =
fast HW method, (but...i have not benchmarked my theory yet)
> my plan is to attempt to add some missing SDL2 functionality to =
SDL2=5FPerl.
> then swap my slow SDL::GFX::Rotozoom::surface() call, with the faster =
SDL2 equivalent
> so basically, i need to implement the 'test/testrendercopyex.c' demo [3],=
 in SDL2=5FPerl,=20
> and add access to these missing SDL2 functions in SDL2=5FPerl...
> SDL=5FLoadBMP(),
> SDL=5FCreateTextureFromSurface(),
> SDL=5FFreeSurface()=20
> SDL=5FRenderGetViewport()
> SDL=5FCreateTexture()
> SDL=5FSetRenderTarget()
> SDL=5FRenderCopy()
> SDL=5FRenderCopyEx(),
> SDL=5FQueryTexture()
> fyi: the testrendercopyex.c demo is nice and simple, it...
> - loads a .bmp file to a surface
> - converts the surface to a HW texture
> - then randomly moves, rotates and scales that texture around the window,=
 in a loop
> i believe this demo is using the new hardware-accelerated scaling on a =
'texture' in SDL2
> [1] http://wiki.libsdl.org/moin.fcg/Introduction
> [2] http://wiki.libsdl.org/moin.fcg/SDL=5FRenderCopyEx
> [3] http://hg.libsdl.org/SDL/file/90ff13467550/test/testrendercopyex.c
> any comments or suggestions, folks=3F
> cheers, Mason
------Nodemailer-0.5.0-?=_1-1376073448208
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<div>Thanks mason,</div><div><br></div><div>Can you make these feature =
requests as issues on http://github.com/PerlGameDev/SDL2</div><br><br><div =
class=3D=22gmail=5Fquote=22><p>On Fri, Aug 9, 2013 at 2:25 PM, Mason James =
<span dir=3D=22ltr=22>&lt;<a href=3D=22mailto:[email protected]=22 =
target=3D=22=5Fblank=22>[email protected]</a>&gt;</span> =
wrote:<br></p><blockquote class=3D=22gmail=5Fquote=22 style=3D=22margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;=22><p>hi sdl-devel
<br><br>i am planning/researching about adding a small amount of =
SDL2=5FPerl code into my existing SDL=5FPerl app, for a framerate increase
<br>i have one long-standingly slow bit of code in my app, that i would =
like to replace with SDL2 code
<br><br>my slow code is a SDL::GFX::Rotozoom::surface() call. but SDL2 has =
'hardware accelerated' stretching/scaling/zooming [1], yay!
<br><br><br>i checked the SDL2 version of ./SDL2=5Frotozoom.c, and it is =
still using the current slow software method (no changes)=20
<br>but the good news is=E2=80=A6 there seems to be a preferred method to =
achieve this fast hardware scaling in SDL2
<br><br>SDL2's SDL=5FRenderCopyEx() function [2] will scale a texture using=
 a fast HW method, (but...i have not benchmarked my theory yet)
<br><br><br>my plan is to attempt to add some missing SDL2 functionality to=
 SDL2=5FPerl.
<br>then swap my slow SDL::GFX::Rotozoom::surface() call, with the faster =
SDL2 equivalent
<br><br>so basically, i need to implement the 'test/testrendercopyex.c' =
demo [3], in SDL2=5FPerl,=20
<br>and add access to these missing SDL2 functions in SDL2=5FPerl...
<br><br>SDL=5FLoadBMP(),
<br>SDL=5FCreateTextureFromSurface(),
<br>SDL=5FFreeSurface()=20
<br>SDL=5FRenderGetViewport()
<br>SDL=5FCreateTexture()
<br>SDL=5FSetRenderTarget()
<br>SDL=5FRenderCopy()
<br>SDL=5FRenderCopyEx(),
<br>SDL=5FQueryTexture()
<br><br><br><br>fyi: the testrendercopyex.c demo is nice and simple, it...
<br><br>- loads a .bmp file to a surface
<br>- converts the surface to a HW texture
<br>- then randomly moves, rotates and scales that texture around the =
window, in a loop
<br><br>i believe this demo is using the new hardware-accelerated scaling =
on a 'texture' in SDL2
<br><br><br>[1] http://wiki.libsdl.org/moin.fcg/Introduction
<br>[2] http://wiki.libsdl.org/moin.fcg/SDL=5FRenderCopyEx
<br>[3] http://hg.libsdl.org/SDL/file/90ff13467550/test/testrendercopyex.c
<br><br>any comments or suggestions, folks=3F
<br><br><br>cheers, Mason</p></blockquote></div><br>
------Nodemailer-0.5.0-?=_1-1376073448208--