How to convert image data generated in C ++ to image data on Javascript?

174 views Asked by At

I make image data by using Vulkan and glfw and made a DLL that sends the image to the Electron side by using node-ffi.

However, I can't express the image data is generated this DLL.

What should i do?

Current Source code on the Electron side.

Image data generated in C ++ is made up of an array of chars.

var ffi = require('ffi-napi')
var ref = require('ref-napi');

const ccPtr = ref.refType(ref.types.char);

//start:Function to start vulkan
//end:Function to end vulkan
//main_loop:Function to generate Image Data
//sending image:Function to send Image Data

var nyanko = ffi.Library( 'DllHelloVulkan.dll',
                          { 'start': ['void', [] ],
                            'end': ['void', [] ],
                            'main_loop': ['bool', [] ],
                            'send_image': [ccPtr, [] ]
                          } 
                        );
0

There are 0 answers