1
Window / Not return "canva" when window.display() ?
« on: November 05, 2021, 07:36:29 pm »
I'm making a project where I want that drew elements with window.draw() don't disappear when I run window.display(). It seems that this code:
window.draw(item);
window.display();
window.draw(item);
make item doesn't disappear when we reuse window.display(). I think it's because window is like a piece of paper drew on one side and showed on the other. When we call window.display(), the paper is returned and we now draw on the other side.
However, I need a lot of efficiency in my code, and I was wondering if it was possible to draw directly on the side of the paper that is showed so that when we call window.display(), the "piece of paper" isn't returned but just showed with all items (these that were already drew and these that were drew just before window.display())
I apologize if my English is barely understandable (I'm not native speaker), I did the best I could to explain my problem.
Thanks in advance !
window.draw(item);
window.display();
window.draw(item);
make item doesn't disappear when we reuse window.display(). I think it's because window is like a piece of paper drew on one side and showed on the other. When we call window.display(), the paper is returned and we now draw on the other side.
However, I need a lot of efficiency in my code, and I was wondering if it was possible to draw directly on the side of the paper that is showed so that when we call window.display(), the "piece of paper" isn't returned but just showed with all items (these that were already drew and these that were drew just before window.display())
I apologize if my English is barely understandable (I'm not native speaker), I did the best I could to explain my problem.
Thanks in advance !