Adding Image to Canvas using a Texture Source
I would like to add Images objects to my canvas using the C++ API. My application already has those source images uploaded to the GPU. Rather than downloading them to system memory and then having noesis upload, is it possible to create an image by passing in a texture source? (My textures are GL_TEXTURE_2D format)
I did see this comment in the release notes:
[Unity] Added support for changing Image.Source at runtime by creating a TextureSource from a UnityEngine.Texture2D.
If you have a code snippet that would be most ideal
Thanks
Don
I did see this comment in the release notes:
[Unity] Added support for changing Image.Source at runtime by creating a TextureSource from a UnityEngine.Texture2D.
If you have a code snippet that would be most ideal
Thanks
Don
Re: Adding Image to Canvas using a Texture Source
Yes, it is described at the end of the tutorial about images.
In your case you need to use a TextureSource whose ITexture2D is created this way:
where handle is the texture you have created.
In your case you need to use a TextureSource whose ITexture2D is created this way:
Code: Select all
Ptr<ITexture2D> texture = *new GLTexture2D(width, height, levels, handle);
Re: Adding Image to Canvas using a Texture Source
That worked.
Thanks
Don
Thanks
Don
Who is online
Users browsing this forum: Ahrefs [Bot], tuwi and 37 guests