LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
Linux x64, Linux arm64, Linux arm32, macOS x64, macOS arm64, Windows x64, Windows x86, Windows arm64
JDK
OpenJDK 17
Module
Nuklear
Bug description
The nk_font_atlas_bake doesn't handle format NK_FONT_ATLAS_RGBA32 properly. On a NK_FONT_ATLAS_ALPHA8 output, the byte buffer is exactly width * height, but on NK_FONT_ATLAS_RGBA32 output it should be width * height * 4. The current implementation works only for the ALPHA8 format:
@Nullable
@NativeType("void const *")
public static ByteBuffer nk_font_atlas_bake(@NativeType("struct nk_font_atlas *") NkFontAtlas atlas, @NativeType("int *") IntBuffer width, @NativeType("int *") IntBuffer height, @NativeType("enum nk_font_atlas_format") int fmt) {
if (CHECKS) {
check(width, 1);
check(height, 1);
}
long __result = nnk_font_atlas_bake(atlas.address(), memAddress(width), memAddress(height), fmt);
return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position())); // <- This can be *4
}
Version
3.3.2
Platform
Linux x64, Linux arm64, Linux arm32, macOS x64, macOS arm64, Windows x64, Windows x86, Windows arm64
JDK
OpenJDK 17
Module
Nuklear
Bug description
The
nk_font_atlas_bake
doesn't handle formatNK_FONT_ATLAS_RGBA32
properly. On aNK_FONT_ATLAS_ALPHA8
output, the byte buffer is exactlywidth * height
, but onNK_FONT_ATLAS_RGBA32
output it should bewidth * height * 4
. The current implementation works only for theALPHA8
format:Stacktrace or crash log output
No response