[Kde-games-devel] Ideas for QML support in libkdegames

Viranch Mehta viranch.mehta at gmail.com
Thu Mar 7 11:53:40 UTC 2013


On Thursday 07 Mar 2013 11:54:17 AM Albert Astals Cid wrote:
> El Dijous, 7 de març de 2013, a les 12:09:19, Viranch Mehta va escriure:
> > On Monday 04 Mar 2013 7:56:04 PM Albert Astals Cid wrote:
> > > El Dilluns, 4 de març de 2013, a les 18:40:46, Viranch Mehta va 
escriure:
> > > > Cons:
> > > > 1. When game window is resized, sprites of new size have to be
> > > > naturally
> > > > retrieved from the SVGs, but QDeclarativeImageProvider is not
> > > > triggering
> > > > a
> > > > new request, its resizing the pixmap from cache. we could overcome
> > > > this
> > > > by
> > > > adding dimensions to source string, change in which would trigger a
> > > > new
> > > > pixmap request, but that seems over-usage of source parameter IMO.
> > > 
> > > Not really, you are asking for
> > > image://myimageprovider/EgyptianTheme/Background/1920x1080
> > > that is the image that i want to use at 1920x1080, at a different
> > > resulution might even be a different image, not just a rescaled one, i
> > > don't think it's over-usage to be honest.
> > 
> > Fair enough, I implemented the same and now resizing is very glitchy as is
> > the case with KGameRenderer (because each resize requests for a new
> > pixmap).
> 
> What do you mean by glitchy? Do you have the code somewhere so we can try
> and see it?

the code has irrelevant comments and other stuff, will clean up and push to a 
branch in libkdegames, and corresponding port to a branch in kbreakout (i'm 
testing all of this with kbreakout).

> 
> > Simple resize of window from landscape to portrait mode takes 50%
> > CPU for 1-1.5 seconds.
> 
> Maybe this is because the images are being generated for all the sizes in
> between the original and the final size?

that's right. I should update pixmaps only to the final size.

will try to fix this and push the code.

Cheers,
Viranch



More information about the kde-games-devel mailing list