Image-loading extentions compile error

Hi,

I’m attempting to use the image loading extensions Image Loader or Defold-PNG but run into the same compile error with both:

/imageloader/src/extension.cpp
	Line 138: non-aggregate type 'dmScript::LuaHBuffer' cannot be initialized with an initializer list
                dmScript::LuaHBuffer lua_buffer = {buffer, true};
                                     ^            ~~~~~~~~~~~~~~

And

/png/src/png.cpp
	Line 132: non-aggregate type 'dmScript::LuaHBuffer' cannot be initialized with an initializer list
            dmScript::LuaHBuffer luabuffer = { buffer, true };
                                 ^           ~~~~~~~~~~~~~~~~

I’m not at all familiar with writing extensions for Defold and not sure how to fix it.

Does anyone know what the correct syntax should be?

Thanks

1 Like

Yes, that’s unfortunately the old syntax.
The new syntax is shown in the documentation.

Thanks for the quick reply!

In the old syntax:

dmScript::LuaHBuffer luabuffer = { buffer, true };

which of these did “true” indicate:

dmScript::OWNER_C 	
dmScript::OWNER_LUA 	
dmScript::OWNER_RES

Thanks

FYI: I’ve updated Defold-PNG to support the new buffer creation API.

2 Likes