Allow (basic) SetData with TextureSliceData

fixes wrong stride when first creating UL window
This commit is contained in:
Simon Lübeß
2024-11-03 14:35:15 +01:00
parent 3555198ffc
commit 139cd6e6e5
3 changed files with 101 additions and 8 deletions
@@ -83,12 +83,10 @@ abstract class UltralightWindow
{
void* pixels = ulBitmapLockPixels(bitmap);
// TODO: before first resize the stride is larger than expected
uint32 width = ulBitmapGetWidth(bitmap);
uint32 height = ulBitmapGetHeight(bitmap);
uint32 stride = ulBitmapGetRowBytes(bitmap);
_texture.SetData<uint32>((.)pixels, 0, 0, width, height, 0, 0);
_texture.SetData(TextureSliceData(pixels, stride, stride * height));
ulBitmapUnlockPixels(bitmap);
}