Yesterday, I wrote:
> Example session:
> require 'jzopengl'
> wd 'pc Frm;xywh 0 0 99 99;cc Ctl isigraph opengl;pas 0 0'
> ogl=: ''conew'jzopengl'
> wd 'pshow'
> glGetString__ogl GL_VERSION__ogl
> +-+----+
> |0|7938|
> +-+----+
Today I tried this on a different machine, and got the same
behavior -- this was with different opengl drivers from a
different vendor.
I also found that if I changed the first wd line to
wd 'pc Frm;xywh 0 0 99 99;cc Ctl isigraph opengl rightmove
bottommove;pas 0 0'
that it would run without error (generating a non-null string pointer for
the result from glGetString).
Further testing showed that using rightmove without bottommove and using
bottommove without using rightmove would eventually mess up that
particular j session such that it would return the error result even with
both rightmove and bottommove. I do not know what to make of that.
For now, I'm going to always use rightmove and bottommove in the
hopes that that will prevent this error case from happening.
In other words, my "temporary opengl" psuedonoun looks like
this:
tempogl=:1 :0
require'jzopengl'
wd'pc Frm;xywh 0 0 9 9;cc Ctl isigraph opengl rightmove bottommove;pas 0 0'
ogl=:''conew'jzopengl'
wd'pshow'
r=.u ogl
wd'pclose'
coerase ogl
r
)
Example use:
memrd=: ] (15!:[EMAIL PROTECTED] [EMAIL PROTECTED])@, 0 0 _1 }.~ #
version=:3 :0
memrd 0{::glGetString__y GL_VERSION__y
)
extensions=:3 :0
memrd 0{::glGetString__y GL_EXTENSIONS__y
)
version tempogl
2.1.1
extensions tempogl
...
(In a final program I would not bother creating a temporary opengl
context, but for one liners and exploratory programming I find this
approach appealing.)
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm