Skip to content

Commit

Permalink
Make Image.stride also work for render-targets via hxcpp
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Jul 20, 2023
1 parent 4c75fe3 commit 77f92fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Backends/Kinc-hxcpp/kha/Image.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 77f92fa

Please sign in to comment.