LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Illari on August 21, 2019, 13:53:18

Title: NanoVG arc becomes rectangle when drawing to renderbuffer
Post by: Illari on August 21, 2019, 13:53:18
Hi,

I changed the drawing code of my application recently so that everything is drawn to a Framebuffer Object with a Renderbuffer Object attached. The arcs it draws with NanoVG became rectangles. Perhaps there is something about setting up the Renderbuffer Object that needs to be done for it to work properly? It also flickers weirdly when hovering over the band, but that might be outside to scope of this topic. The arrow makes the window slightly larger. The window is drawn in two chunks that get combined using blitting after changing the window size. There was a problem with the Framebuffer Object cropping its contents to the window dimensions otherwise.

(https://i.postimg.cc/PqqLzxd5/ohjelma.png)
Title: Re: NanoVG arc becomes rectangle when drawing to renderbuffer
Post by: spasi on August 21, 2019, 14:40:51
Does the framebuffer object have a GL_STENCIL_ATTACHMENT? A stencil buffer is required for correct NanoVG rendering.
Title: Re: NanoVG arc becomes rectangle when drawing to renderbuffer
Post by: Illari on August 21, 2019, 18:01:02
Thank you, it is working again.