Hello,
sorry if I should do a kind of double post now, but I believe that it's stylistic better if I write this in a new post.
Today I continued to experiment on my m“litte Programm and the result is very satisfying, or at least half satisfying!
I got my programm so far that it draw the picture now correct, meaning a subimage of the rotated original. Looks like the only thing that needed to be done was a flush() on the graphics of the copy. The only thing I don't like is that everytime my programm shows me now the picture it also says:
Sat Apr 30 10:58:22 CEST 2011 INFO:Offscreen Buffers FBO=true PBUFFER=true PBUFFERRT=true
Sat Apr 30 10:58:22 CEST 2011 DEBUG:Creating FBO 50x50
Can someone translate that for me in an english that I can understand please?^^
Here the used code:
1 2 3 4 5
| Image draw = img.copy(); draw.rotate(grad); Image aimg = this.getCopy(draw); Image newdraw = draw.getSubImage(actx, acty, this.tilewidth-actx, this.tileheigth-acty); newdraw.draw(0, 0); |
And here the getCopy() Method, that only does flush at the moment...
1 2 3 4 5 6 7
| private Image getCopy(Image img) throws SlickException { Image aimg = new Image(img.getWidth(), img.getHeight()); Graphics g = img.getGraphics(); g.flush(); return aimg; } |
What I now don't understand is why the flush is needed, for that the subimage gets taken form the rotated picture and not from the not rotated one, maybe someone can explain that to me. And maybe someone has another Idea for how to write it shorter.
Greetings
biro
Edit:
It looks like that my rotation method kills my fps... while I have an undrosseled fps from between 3000 and 5000 I have only and fps of about 20 when my screens shows and rotated picture... Hope someone can help me and has an more efficient way to get a subimage from an rotated image...