There is no Gideros plugin for webp I am aware of, and no plan to add it currently. The question was raised before, but it seems that webp use is still marginal, and the only gain as compared to jpeg or png would be lower package size.
Unless you want to be able to dynamically import/export webp format from your Gideros app, or have so many images that the size would actually matter, this didn't seem worth the effort.
Yep, both. And images have transparency, so using jpg is not allowed. Even minified pngs increases the size a ton versus the webp files. I'm coming from a C programming background and I have the webp static library. Is it possible for me to create a Lua plugin with it or link the lib directly from Gideros? Lua newbie, sorry.
Yes, you can create a plugin for Gideros to interface your webp library. It ios not trivial though, and poorly documented. The best way to get started is to look at other Gideros plugins source code, those involving only C/C++ code are easier (no platform dependent code). Json plugin would be a good choice to start. (https://github.com/gideros/gideros/tree/master/plugins/json)
Main parts of a plugin are: - the .gplugin file: which describe the plugin to Gideros and tells it how to integrate on various platforms - the gideros/lua binding source file (lua_cjson_stub for json plugin): Gideros will call it when plugin is loaded and give it a lua context (lua_State). With it, the plugin will need to register its own objects and functions into lua environment. - the actual C/C++ code called by the lua binders, possibly different depending on target platform.
Of course you'll need a Gideros development toolchain. You don't need to build Gideros itself, since everything needed to link your plugin should already be in SDK folder of your Gideros installation. See here for how to get the tools depending on the platform: https://wiki.gideros.rocks/index.php/Compiling_Gideros_Source
Comments
Unless you want to be able to dynamically import/export webp format from your Gideros app, or have so many images that the size would actually matter, this didn't seem worth the effort.
I'm coming from a C programming background and I have the webp static library. Is it possible for me to create a Lua plugin with it or link the lib directly from Gideros?
Lua newbie, sorry.
Main parts of a plugin are:
- the .gplugin file: which describe the plugin to Gideros and tells it how to integrate on various platforms
- the gideros/lua binding source file (lua_cjson_stub for json plugin): Gideros will call it when plugin is loaded and give it a lua context (lua_State). With it, the plugin will need to register its own objects and functions into lua environment.
- the actual C/C++ code called by the lua binders, possibly different depending on target platform.
Of course you'll need a Gideros development toolchain. You don't need to build Gideros itself, since everything needed to link your plugin should already be in SDK folder of your Gideros installation. See here for how to get the tools depending on the platform: https://wiki.gideros.rocks/index.php/Compiling_Gideros_Source