add setImage method to set texture image directly from buffer
This commit is contained in:
@@ -879,6 +879,31 @@ bool Texture_loadImage(
|
||||
pixelDataType.value,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Bool Function(
|
||||
ffi.Pointer<TEngine>,
|
||||
ffi.Pointer<TTexture>,
|
||||
ffi.Uint32,
|
||||
ffi.Pointer<ffi.Uint8>,
|
||||
ffi.Size,
|
||||
ffi.Uint32,
|
||||
ffi.Uint32,
|
||||
ffi.Uint32,
|
||||
ffi.Uint32,
|
||||
ffi.Uint32)>(isLeaf: true)
|
||||
external bool Texture_setImage(
|
||||
ffi.Pointer<TEngine> tEngine,
|
||||
ffi.Pointer<TTexture> tTexture,
|
||||
int level,
|
||||
ffi.Pointer<ffi.Uint8> data,
|
||||
int size,
|
||||
int width,
|
||||
int height,
|
||||
int channels,
|
||||
int bufferFormat,
|
||||
int pixelDataType,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TLinearImage> Function(
|
||||
ffi.Uint32, ffi.Uint32, ffi.Uint32)>(isLeaf: true)
|
||||
|
||||
@@ -306,8 +306,8 @@ abstract class Texture {
|
||||
covariant LinearImage image, PixelDataFormat format, PixelDataType type);
|
||||
|
||||
/// Sets the image data for a 2D texture or a texture level
|
||||
Future setImage(
|
||||
int level, Uint8List buffer, PixelDataFormat format, PixelDataType type);
|
||||
Future setImage(int level, Uint8List buffer, int width, int height,
|
||||
int channels, PixelDataFormat format, PixelDataType type);
|
||||
|
||||
/// Sets the image data for a region of a 2D texture
|
||||
Future setSubImage(int level, int xOffset, int yOffset, int width, int height,
|
||||
|
||||
Reference in New Issue
Block a user