Hi Karim, On Thu, Sep 13, 2012 at 7:29 PM, Karim 'Kasi Mir' Senoucci <direc...@tvetc.de> wrote: > Hi, > Am 13.09.2012 17:41, schrieb Ezequiel Garcia: > >>> What do you mean by this? Are you suggesting that I should "simply" >>> rotate >>> every of my roughly 800 calls to DirectFB instead of rotating just the >>> surface (or layer) once? >>> >> Well, I'm not familiar with your app. But, I would think to be wise to >> have >> just one call to Flip(). You simply have to rotate before flipping. > > Rotate what, exactly, and with which call? > >> Of course, I might be wrong. But, do you have 800 different places >> where you call Flip()? > > No, I said calls to DirectFB, not calls to Flip(), that one I have just > once. But how do I "rotate" the surface I am about to flip? I know how to > set rotation on a layer (in theory, as it doesn't work in practice) and a > window, but for a surface, I'm at a loss. >
Well, if I wasn't so busy I would write a small test for you. Sorry. I would do this: 1. Locate Flip(). Flip updates one surface, it's the one that "shows" the image on screen. So if you do this: (seudo-code!) new_surf = Rotate(surf); surf = new_surf // of course, using Blit() surf->Flip(surf); I guess you would have your image rotated on screen. 2. You will have to implement Rotate() yourself. This means two steps: * create another surface to put the rotated image. * pixels are just dots, they don't have orientation. so rotate means pixel relocation for us. * use Lock() / Unlock() to access pixels. If you're thinking: "Heck, this is an awful dirty hack". Then: you're right. I call it "Last resource software butchery". If you need to see how to access pixels, take a look at the "colorize" example from DFBTutorials repo: http://git.directfb.org/?p=extras/DFBTutorials.git;a=blob;f=src/colorize/colorize.c;h=95af990fcc70a88df3c41943dd469622ed20ce6c;hb=65dec947d045f7b0e2d83a454afd0b5d5764f7cc If you have some luck with this, don't forget to tell us :-) _______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users