LWJGL / lwjgl3

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.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.83k stars 642 forks source link

wrong point count for nk_fill_polygon, nk_stroke_polygon, and nk_stroke_polyline #978

Closed wedesoft closed 5 months ago

wedesoft commented 6 months ago

Version

3.3.3

Platform

Linux x64

JDK

openjdk 17.0.11 2024-04-16

Module

Nuklear

Bug description

I suspect that the array size instead of the number of points (= array size divided by two) is passed to Nuklear. Here is a Clojure snippet using a float buffer of size 6.

image

Instead of rendering a blue triangle and a white polyline, the polygon seems to be connected to the point (0, 0):

image

The nk_fill_polygon and similar methods need to be passed a point count.

This issue also has been reported here.

Stacktrace or crash log output

No response

wedesoft commented 6 months ago

Seems that points.remaining() is passed here.

Spasi commented 5 months ago

Thanks @wedesoft!