gLib2D icon indicating copy to clipboard operation
gLib2D copied to clipboard

Problem with crop functions and tex_repeat

Open nikmes opened this issue 9 years ago • 2 comments

Hi,

I am not sure if you are still working on this but i see that you made SDL port. I have an issue when running code on PSP and it has to do with crop functions. When i g2dSetCropXY(cx, cy); and i increase cx by 1 or decrease by 1 depending on which direction i am scrolling i have an issue. Basicaly when i start scrolling cx-=1 i get weird artifacts, when i scroll the other direction cx+=1 all is good. Same happens when i scolling the image using cy.

Here is a screen shot with artifacts: image

I get the same problem on a real PSP.

I am using your rendering library (an opengl version as well) to render all my graphics for this tool www.facebook.com/2dleveleditor

Thanks for this library! Is amazing!

Regards

nikmes avatar Apr 04 '16 22:04 nikmes

Not sure how to fix this but I would suggest to change your view on this. Don't crop your texture but draw it large enough so it covers the screen.

Always happy to hear that someone is using that library!

libcg avatar Apr 05 '16 23:04 libcg

Hi, Thanks a lot for the response. Actually I crop the texture to achieve the infinite scrolling effect of the background. I figure out another work around. Before I start cx-=1 or cx+=1 to scroll it, i initialize cx=text->width_1000 and cy=text->height_1000 and now no matter which direction i scroll left or right up or down i do not get the artifacts.

Thanks a lot for your response! I learned a lot from your code, especially from the gSquare game. Thanks for your open source contributions.

Regards

nikmes avatar Apr 06 '16 08:04 nikmes