uint height = 64;
Texture texture = new Texture(TextureType.TEXTURE_2D, PixelFormat.RGBA8888, width, height);
uint bufferSize = width * height * 4;\r
- PixelData pixelData = new PixelData(null, bufferSize, width, height, PixelFormat.RGBA8888, PixelData.ReleaseFunction.Free);\r
+ byte[] buffer = new byte[bufferSize];\r
+ PixelData pixelData = new PixelData(buffer, bufferSize, width, height, PixelFormat.RGBA8888, PixelData.ReleaseFunction.Free);\r
texture.Upload(pixelData);
}
catch (Exception e)
uint height = 64;
Texture texture = new Texture(TextureType.TEXTURE_2D, PixelFormat.RGBA8888, width, height);
uint bufferSize = width * height * 2;\r
- PixelData pixelData = new PixelData(null, bufferSize, width, height, PixelFormat.RGBA8888, PixelData.ReleaseFunction.Free);
+ byte[] buffer = new byte[bufferSize];\r
+ PixelData pixelData = new PixelData(buffer, bufferSize, width, height, PixelFormat.RGBA8888, PixelData.ReleaseFunction.Free);
texture.Upload(pixelData, 0u, 0u, width / 2, height / 2, width / 2, height / 2);
}
catch (Exception e)