Hi there,
I'm kind of stuck with something: I want to create an ITexture from pixel data (aka bytearray, or byte pointer, etc.). As described here, I could create an IImage first, and load an ITexture from it then. However, this has 2 disadvantages. First, it’s a waste of memory, and second it doesn't work with threads in OpenGL (at least addTexture fails when used in a thread, and Irrlicht was initialized with OpenGL)
So, any better ideas?
So long,
Kernle
Converting pixeldata to ITexture?
Re: Converting pixeldata to ITexture?
False. If you drop the IImage as soon as you've created the texture from it, it will delete itself and you'll get the memory back. See IReferenceCounted, a base class of IImage (and most other classes in Irrlicht) which implements reference counting.Kernle 32DLL wrote:First, it’s a waste of memory.
Generally speaking, you can't perform ops which involve the GPU (such as loading/unloading textures, vertex buffers, rendering, etc.) in multiple threads. This isn't unique to Irrlicht - you'll find this to be the case pretty much anywhere. It's a DirectX and OpenGL problem (though IIRC DX11 is beginning to implement real multi-threaded rendering).Kernle 32DLL wrote:and second it doesn't work with threads in OpenGL (at least addTexture fails when used in a thread, and Irrlicht was initialized with OpenGL)
-
- Posts: 10
- Joined: Thu Oct 21, 2010 9:18 pm