Hi
how to draw a mouse crosshair with sdl 1.2?
Thanks in advance
Read the documentation of the SDL on how to get the mouse position in a specific time;
Read the documentation of the SDL on how to draw an image;
Draw the image in the mouse position;
You'll get an x, y position that describes the mouse position in that specific time.
After that your image should be rendered at the center of the mouse position that you got.
If SDL has a function such: DrawImage(X, Y), you pass the x and y values of the mouse position to the function.
Another simple way of doing it is read the documentation of SDL and see how you can change the mouse cursor image and change that at initialization or run-time.
http://www.libsdl.org/release/SDL-1.2.15/docs/html/sdlcreatecursor.html
how to call? If I do alike I get a crash:
init_system_cursor(arrow);
Thanks
http://www.libsdl.org/release/SDL-1.2.15/docs/html/sdlcreatecursor.html
how to call? If I do alike I get a crash:
init_system_cursor(arrow);
Thanks
What kind of crash?
Looks like your SDL version is a little bit old. I quick googled it and this is the last version, you may want to download that.
No I'm using 1.2 and won't bother to change existing code. A runtime crash without any details (x-plane plugin dll)
Do I need to give something to the arrow array?
I don't use sdl for video only for some other stuff in my x-plane (opengl) dll, hence I need more code?
Anyone doing alike in a crossplatform, already existing opengl context?
I've found a solution in the x-plane sdk. As I don't init graphics/video with my sdl stuff, I can't do that with sdl.
Thanks
Upgrade to SDL2, 1.2 is known to have issues with custom mouse cursors (I have made the switch and many small strange problems disappeared).