SDL2's concept of GameController is a like a PS or Xbox controller, two sticks, four face buttons, etc. These are the same as the bgfx example's Gamepad.
SDL also has a concept of Joystick, which could be anything, like a flight stick. Game Controllers are implemented by these lower level joystick's.
Entry SDL gets duplicate events, for both controller and the joystick implementing it. Game controller buttons are remapped to bgfx gamepad, but joystick buttons are not. This causes incorrect button presses.
Additionally, the joystick z axis behaves differently than game controller or bgfx gamepad. With at-rest value being negative, not zero.
Due to all of this, it seems like the best approach would be to ignore joystick events and only handle game controller events.
Also, minor additional fix to get handle's index when using it as array index. Fixes compilation in Visual Studio.
Fixes possible concurrency issue - makes code usable in a multithreaded environment. imageReleasCb releases imageContainer after bgfx::createTexture...() is called. If bgfx::frame() is called from another thread, the release can happen before imageContainer is used in bgfx::calcTextureSize(), leading to a crash. Although loadTexture() is not used in multithreaded environment in the examples, calling bgfx::calcTextureSize() before bgfx::createTexture...() is a better reference for users.
Kerning is now also scaled with the scaled child font when using SDF fonts. In examples/common/font_manager.cpp kerning was visibly off when scaling SDF font down.
* Allow simultaneous X11 and Wayland support
* Add NativeWindowHandleType
* Set default value for g_platformData.type
* Use g_platformData.type to check for a native Wayland window
* Stub getNativeWindowHandleType on platform where Wayland is not an option
* Implement getNativeWindowHandleType for GLFW
* Add getNativeWindowHandleType to the remaining C++ examples
* Add getNativeWindowHandleType to the C example
* Fix compiler warnings for nanovg wrapper
Code for the nanovg wrapper was generating compiler warnings for
implicit casts from int32_t to uint16_t. These casts are unavoidable
due to how bgfx and nanovg APIs use different types for texture
width/height.
* Fix compiler warning from nanovg fontstash.h
This fixes some warnings for signed/unsigned comparsion
coming from the nanovg fontstash.h header.