|
openwallpaper
|
Here are some OpenWallpaper features to add interactivity to your scene.
To get mouse cursor position and pressed buttons, use ow_get_mouse_state function. It stores cursor position in x, y: float and returns a mask of currently pressed buttons. See enum ow_mouse_button for available buttons.
To get audio spectrum data for visualization, use ow_get_audio_spectrum function. You need to specify a number of bars to get and a buffer to store them. ow_get_audio_spectrum will fill the buffer with normalized floats from 0 to 1.
You may see an example of ow_get_audio_spectrum usage in visualizer example.
This feature allows to change the behavior of the scene at runtime. Wallpaper options are specified in wallpaperd CLI arguments after the wallpaper path like this:
To get a value of a wallpaper option, use ow_get_option function. It will return option value as null-terminated string. If option is not specified, it will return NULL. If the option is specified but has no value, it will return an empty string "".