SFML community forums
Help => Graphics => Topic started by: Cuban-Pete on July 04, 2011, 07:30:21 pm
-
Hi,
I'm using CopyScreen and the y position is off.
I tried to fix it to change this line in the source code:
GLCheck(glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, srcRect.Left, srcRect.Top + myHeight, myWidth, myHeight));
The glCopyTexSubImage2D function starts at the left bottom and not the top left position. My fix however does not work, somehow it goes higher than it should... :roll:
-
Nobody has this problem? :roll:
-
I don't remember such a problem with the CopyScreen function. Do you use SFML 1 or 2?
-
I use SFML 2.
If you cut the screen in 4 even parts and try to get the bottom right one with the copyscreen function, it wont work.
Or perhaps it has to do with the opengl perspective?
-
Can you show a complete and minimal code that reproduces the problem?
-
Yes, here it is: https://legacy.sfmluploads.org/index.php?page=view_code&isparent=yes&id=16
-
bump
//taking a copyscreen of fourth quarter:
screen.CopyScreen(window, sf::IntRect( 600/2, 0, 300, 200) ); //this gives correct result
screen.CopyScreen(window, sf::IntRect( 600/2, 400/2, 300, 200) ); //this should be the correct code
-
You were right about inverted coordinates, now it's fixed. Thanks for your feedback :)
-
Thanks! It works great now! :D