veandco / go-sdl2-examples

This is where all go-sdl2 examples are stored
91 stars 34 forks source link

Cursor unresponding #3

Closed pouryatorabi closed 5 years ago

pouryatorabi commented 5 years ago

I have a problem with the cursor, it also occurs in the render example provided. The problem is if I move my mouse to the created window, it becomes unresponding.

veeableful commented 5 years ago

Hi @pouryatorabi, could you elaborate on what you mean by unresponding? What is your OS?

pouryatorabi commented 5 years ago

Hi, Actually I have tried both on Win and Linux, I just tried to hide my mouse cursor, but the cursor would show a busy indicator when I move it from outside the window to inside it. I hope you understand it, it is hard to explain :)))

veeableful commented 5 years ago

Hi @pouryatorabi, there is a 2-second sleep / freeze in the program after it finishes drawing which I guess causes the cursor to be busy. Does that match what you experienced? It is an intended outcome as of now.

pouryatorabi commented 5 years ago

Yes that is what causes the problem, but what if we actually need a delay?

veeableful commented 5 years ago

Hi @pouryatorabi, you can use the delay function on another thread if needed so it doesn't block the main thread. If you block the main thread with sleep, the cursor will be shown busy.