win32 plugin development

Hi,

Can someone experienced help me get started on creating simple native (c++) plugin for win32 platform ?

I found this resource: https://docs.coronalabs.com/native/plugin/index.html#coding-plugins

Is there some example code/project that can get me started?

I am trying to update TextureResource object (https://docs.coronalabs.com/api/type/TextureResource/index.html) from video frames. To show video with texture inside UI.

Thanks,

Alex

Hi Alex.

You might try starting from the library I linked in the other post. It includes a Win32 solution. Some things might be out of doubt, e.g. references to CORONA_ENTERPRISE  (environment variable, possibly my own, for relative paths of include files and libraries) should be switched to CORONA_ROOT  (assigned by Corona on installation).

The memory bitmap plugin I also mentioned is probably a gentler start.

For Visual Studio setup, this is still a very good post.

Hi StarCrunch,

Awesome starting point, thank you.

Do you know if i can use corona simulator to load plugin from created .dll ?

Yep.

In the project properties in Visual Studio you should see something called Build Events. In my Post-Build Event command line, I have

set PLUGINS=$(appdata)/Corona Labs/Corona Simulator/Plugins/plugin/ copy "$(OutDir)$(TargetName).dll" "%PLUGINS%video.dll"

in that VLC plugin, which will dump that DLL in a folder Corona searches when you call require (). You can of course rename it to whatever you want. The TargetName gets picked up from the corresponding General  property. My comments in the VLC thread go into more detail, but basically you can just enter %appdata% in a File Explorer window and then follow the rest of what I assign in this command, creating the plugin folder if necessary.

You might get confused if you build while Corona is running (with the plugin loaded, anyway), since it will fail. Just make sure to Ctrl+W or whatever first.  :slight_smile:

Hi StarCrunch,

Thank you very much for detailed information :slight_smile:

Will post update on my progress here.

Alex

Hi Alex.

You might try starting from the library I linked in the other post. It includes a Win32 solution. Some things might be out of doubt, e.g. references to CORONA_ENTERPRISE  (environment variable, possibly my own, for relative paths of include files and libraries) should be switched to CORONA_ROOT  (assigned by Corona on installation).

The memory bitmap plugin I also mentioned is probably a gentler start.

For Visual Studio setup, this is still a very good post.

Hi StarCrunch,

Awesome starting point, thank you.

Do you know if i can use corona simulator to load plugin from created .dll ?

Yep.

In the project properties in Visual Studio you should see something called Build Events. In my Post-Build Event command line, I have

set PLUGINS=$(appdata)/Corona Labs/Corona Simulator/Plugins/plugin/ copy "$(OutDir)$(TargetName).dll" "%PLUGINS%video.dll"

in that VLC plugin, which will dump that DLL in a folder Corona searches when you call require (). You can of course rename it to whatever you want. The TargetName gets picked up from the corresponding General  property. My comments in the VLC thread go into more detail, but basically you can just enter %appdata% in a File Explorer window and then follow the rest of what I assign in this command, creating the plugin folder if necessary.

You might get confused if you build while Corona is running (with the plugin loaded, anyway), since it will fail. Just make sure to Ctrl+W or whatever first.  :slight_smile:

Hi StarCrunch,

Thank you very much for detailed information :slight_smile:

Will post update on my progress here.

Alex