User:Raul Miller/OpenGL
Update: these notes are old, and somewhat obsolete. I have been studying http://greggman.github.io/webgl-fundamentals/ and want to write some relatively small and interesting tools based on that information. Until I properly absorb the API and browser issues, though, I'll just recommend studying those pages.
These notes were originally written when J's opengl interface was being upgraded. In other words, some of the examples won't work with J601c
(They were originally written under J601 j beta, and were editted to work under the k beta. Hopefully, within a few days of Jan 7, 2007, these pages will be updated to reflect the production code.)
These are some notes on opengl programming with J.
At the moment, things are in transition between the opengl support of J5 and the future opengl support of J6. J6 has seen some changes, and more changes are promised. So I will probably need to come back and change things later.
Here's some of J's documentation on opengl:
J wiki J6/OpenGL docs
Some notes on the some interface features of the jzopengl support http://www.jsoftware.com/help/user/opengl.htm
Some example code http://www.jsoftware.com/jwiki/Studio/OpenGL
Overall, the J materials are fairly sketchy and presume a decent understanding of opengl (and of J)
Here's some more comprehensive documentation on opengl http://www.opengl.org/documentation/
These docs are extremely comprehensive, but much does not apply to J (the promised rewrite should allow any available opengl feature to be accessed from inside J).
To bridge this gap, at least for myself, I'm recording some simple notes.
First, here's the mechanism to test whether opengl is properly installed:
testogl=: 3 : 0 try. require'jzopengl' ogl=.''conew'jzopengl' alloc__ogl 4 4 destroy__ogl'' 1 catch. if._1<nc<'ogl'do.destroy__ogl ::]''end. 0 end. )
testogl returns 1 if opengl is properly installed and available to J, and returns 0 if not.
Other (simple) notes:
[[../../Raul Miller/OpenGL/Page0|opengl applications, and opengl color]], and some additional notes about [[../../Raul Miller/OpenGL/Color|color]]
[[../../Raul Miller/OpenGL/Page1|window coordinates]]
[[../../Raul Miller/OpenGL/Page2|opengl coordinates]]
[[../../Raul Miller/OpenGL/Page3|stale notes about shaders]] this issue has been fixed in j6.02, I need to upgrade my notes