heyx3 / Bplus.jl

A modern OpenGL 4.6 rendering framework, written in Julia.
Other
72 stars 3 forks source link

Cache the current status of `GL_PRIMITIVE_RESTART`, and only toggle if it necessary #29

Open heyx3 opened 1 year ago

heyx3 commented 1 year ago

Currently, in GL.render_mesh() in the file GL/drawing.jl, we always call glEnable(GL_PRIMITIVE_RESTART) and glDisable(GL_PRIMITIVE_RESTART). However, we should cache its current state in the context and only make those two calls when it's actually necessary.

Don't forget to also load the cached value when the context refreshes!