I found this code some code that supposedly works for creating a context
that can be shared for multiple panels
http://www.javagaming.org/index.php/topic,19911.0.html

I can't seem to get a pbuffer create.  I believe I'm using the correct
Clojure syntax for these static methods (pasted below).  It could be a JOGL
issue, I guess, as the API has changed quite a bit recently and the
documentation is still pretty bad.

GLPBuffer sharedPBuffer = GLDrawableFactory.createGLPbuffer(...,1,1, null);

new GLJPanel(...,sharedPBuffer.getContext());
new GLCanvas(...,sharedPBuffer.getContext());



But I can't seem to call createGLPbuffer w/o getting an exception.

  (if (not gl-canvas-context)
       (let [sharedPbuffer (GLDrawableFactory/createGLPbuffer nil nil 1 1
nil)]
        (.paint sharedPbuffer)
        (println (.getContext sharedPbuffer))))

Caused by: java.lang.IllegalArgumentException: No matching method:
createGLPbuffer
        at clojure.lang.Compiler$StaticMethodExpr.<init>(Compiler.java:1255)
        at clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:763)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:4496)
        ... 45 more


I've tried this to get a suitable factory if that's required, but that
doesn't seem to work either.

  (let [factory (GLDrawableFactory/getFactory GLProfile/GL2)]
       (println factory))

Exception in thread "Main Thread" java.lang.ClassCastException:
java.lang.String (start.clj:0)
        at clojure.lang.Compiler.eval(Compiler.java:4543)
        at clojure.lang.Compiler.load(Compiler.java:4857)
        at clojure.lang.Compiler.loadFile(Compiler.java:4824)
        at clojure.main$load_script__5833.invoke(main.clj:206)
        at clojure.main$script_opt__5864.invoke(main.clj:258)
        at clojure.main$main__5888.doInvoke(main.clj:333)
        at clojure.lang.RestFn.invoke(RestFn.java:413)
        at clojure.lang.Var.invoke(Var.java:346)
        at clojure.lang.AFn.applyToHelper(AFn.java:173)
        at clojure.lang.Var.applyTo(Var.java:463)
        at clojure.main.main(main.java:39)
Caused by: java.lang.ClassCastException: java.lang.String
        at user$add_canvas__31.invoke(ui.clj:19)
        at user$eval__123.invoke(start.clj:12)
        at clojure.lang.Compiler.eval(Compiler.java:4532)
        ... 10 more



On Tue, Apr 20, 2010 at 2:11 AM, Joel Gluth <[email protected]> wrote:

> Further, from the JOGL user guide:
>
> "In the JSR-231 abstractions, a context is always associated with
> exactly one drawable."
>
> I guess that answers that question. So, while we certainly might want
> to share some of our GLish state between windows, the Context is not
> the right vehicle...
>
> J
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> [email protected]<clojure%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to