From 77f92fa1d964b73084a612c57fdc60d06cb3884f Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 21 Jul 2023 01:21:56 +0200 Subject: [PATCH] Make Image.stride also work for render-targets via hxcpp --- Backends/Kinc-hxcpp/kha/Image.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backends/Kinc-hxcpp/kha/Image.hx b/Backends/Kinc-hxcpp/kha/Image.hx index 6e8271e41..42bffcdd0 100644 --- a/Backends/Kinc-hxcpp/kha/Image.hx +++ b/Backends/Kinc-hxcpp/kha/Image.hx @@ -552,7 +552,7 @@ class Image implements Canvas implements Resource { public var stride(get, never): Int; - @:functionCode("return kinc_g4_texture_stride(&texture);") + @:functionCode("if (imageType == KhaImageTypeTexture) return kinc_g4_texture_stride(&texture); else if (imageType == KhaImageTypeRenderTarget) return formatByteSize(myFormat) * renderTarget.width; else return 0;") function get_stride(): Int { return 0; }