ztellman / penumbra

not under active development - idiomatic opengl bindings for clojure
354 stars 43 forks source link

Enabling blend and writing text to screen doesn't work. #24

Closed tgk closed 11 years ago

tgk commented 14 years ago

With blend enabled it's impossible to both draw vertices and write text to the screen. If the vertices are defined before the text writing, they will be drawn the first time the window is drawn, but they will not be redrawn. A small example demonstrating the error. I suspect it's this call in penumbra.text to blend-func that ruins it, as it doesn't restore the blend function.

Platform was java 1.6, clojure and clojure.contrib 1.1, penumbra 0.5 on mac os x 1.5.8.

ztellman commented 14 years ago

The code you're linking to is in version 0.6. You were entirely correct that there was an issue with not restoring the blend function, but there's no call to @blend-func@ in 0.5. I was able to reproduce and fix this issue in 0.6, but the same fix doesn't seem to work in 0.5.

I can try and play around with this some more, but the text rendering stuff is a bit of a black box for me. Is there any reason you're not using 0.6?

tgk commented 14 years ago

If I understand correctly 0.6 is for clojure 1.2 and I haven't switched to that yet (lein seems to have some problems with it at the moment). I'll switch to 0.6 later; you can probably ignore the bug in 0.5 as most people will probably start using 1.2 soon.

Thanks for resolving the issue so fast. Sorry I linked to the wrong source; my guess about what the error was was wrong.

ztellman commented 14 years ago

No, you were pretty spot on; your suggestion fixed the exact behavior you were seeing in 0.6. Unfortunately, there seems to be some further issues with 0.5. I haven't actively worked on 0.5 in six months; I'd suggest upgrading to Leiningen 1.2, which should have no issues with Clojure 1.2.

Thanks for the bug reports. Keep them coming.