Slick Forums

Discuss the Slick 2D Library
It is currently Sat May 25, 2013 2:50 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Aug 25, 2011 11:40 am 
Offline

Joined: Sun May 29, 2011 11:41 am
Posts: 19
Hello guys, i have encountered a strange bug with using FullScreen in Applet, the bug appears to be within CopyArea().
What happens visually is that the area that wrong area gets copied, so when im later supposed to draw the image, its been resized and repositioned all wrong.
Ive discovered a way to make it work in theory using the openGL code for copyArea, but its not practical to use.

Code:
int format = SGL.GL_RGBA;
    wormBodyImage.bind();
    GL.glCopyTexImage2D(SGL.GL_TEXTURE_2D, 0, format, (int)(map.getGameArea().getMinX()*1.5),(int) (map.getGameArea().getMinY()*1.5)+181, (int) (wormBodyImage.getTexture()
            .getTextureWidth()*1.5), (int)(wormBodyImage.getTexture().getTextureHeight()*1.5), 0);
    wormBodyImage.ensureInverted();


In this example i have a canvas thats exacly 50% in width and in height compared to my screen (counting pixels). Because of this, to make copyarea() work. I need to increase the Area i want to copy with 1.5 (50%) in both x and y. Also for some reason, i need to add 181 to the Y-value since the applet creates a 181 extra pixels in the bottom of the screen.

Anyhow, something is not working great with copyArea().
The main reason that i can think about is that an Applet doesn´t resize the same way in fullscreen as an Application.

If you want and need it, i can post some pictures and try to describe better.

Thx in advance!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group