[SOLVED]Image moving after drawing a new image

Started by KLMNT, August 04, 2018, 15:18:23

Previous topic - Next topic

KLMNT

SOLVED
Hi, iÃ,´m new to the forum and using the tool LWJGL. I have little experience with Java as well so I apologize if IÃ,´m asking somehting dumb.
I started a game and IÃ,´m just experimenting with the library, so I tried to display an image inside my window (Display).
The problem is, the image is beeing drawn inside the typical while(!Display.isCloseRequested()), and i configured it to be at 1 frame per second, for debbuging purposes.
Well, every time it draws the image, it first moves the same image (the previous frame drawn one) down and right, and then draws the one from this frame, both of the images staying on screen, overlapping each other.
After trying to draw it at 0, 0, i realized it didnÃ,´t happen, and made me think it takes the previous imageÃ,´s coordinates and sums them to the new image one, hence the moving. And if i draw it at 0, 0, since 0+0=0 it stays in the corner without moving.
Honestly I donÃ,´t, and I would be glad to recieve any help for this.
If more information is needed, like the code itself, iÃ,´ll be glad to show it.