LWJGL Forum

Programming => OpenGL => Topic started by: Nop on May 21, 2007, 21:04:57

Title: SPGL no longer runs with LWJGL 1.1
Post by: Nop on May 21, 2007, 21:04:57

I am using the Shaven Puppy lib and I have just tried to move to LWJGL 1.1

I get the Exception

Exception in thread "main" java.lang.IllegalAccessError: tried to access method org.lwjgl.opengl.Display.getContext()Lorg/lwjgl/opengl/Context; from class com.shavenpuppy.jglib.opengl.GLResource
   at com.shavenpuppy.jglib.opengl.GLResource.doCreate(GLResource.java:76)
   at com.shavenpuppy.jglib.Resources.allocate(Resources.java:400)
   at com.shavenpuppy.jglib.Resource.create(Resource.java:210)

It seems that the getContext() method was changed to private.

Is there a workaround for this?
Title: Re: SPGL no longer runs with LWJGL 1.1
Post by: Matzon on May 21, 2007, 23:05:27
have shavenpuppy lib not access that ? :)
alternatively heavy use of reflection
Title: Re: SPGL no longer runs with LWJGL 1.1
Post by: Nop on May 22, 2007, 04:45:47

Quotehave shavenpuppy lib not access that

Gladly. :-)

So if Display.getContext() is private now, what would be the proper public call to replace it with?
Title: Re: SPGL no longer runs with LWJGL 1.1
Post by: Nop on May 23, 2007, 07:38:33

Just kept commenting out code until it compiled. Seems to work anyway for now...
Title: Re: SPGL no longer runs with LWJGL 1.1
Post by: cornholio on May 27, 2007, 21:06:50
Quote from: Nop on May 23, 2007, 07:38:33

Just kept commenting out code until it compiled. Seems to work anyway for now...

hehe ... this is how they build a release at microsoft  ;)
Title: Re: SPGL no longer runs with LWJGL 1.1
Post by: Orangy Tang on June 06, 2007, 13:08:41
I seem to have the same problem now. From what I can tell it's just using the return object of getContext() to make sure things are being properly created and destroyed in the same context/thread - the actual Context object itself isn't being manipulated in any way.

I assume it was made private to stop people messing around with the Context, would it be possible to get some kind of replacement for the above functionality? Maybe an isCurrent() call along with makeCurrent()?
Title: Re: SPGL no longer runs with LWJGL 1.1
Post by: elias on June 06, 2007, 13:55:07
Sorry about that. You can replace the Display.getContext() call with Display.getDrawable().getContext().

  - elias
Title: Re: SPGL no longer runs with LWJGL 1.1
Post by: Orangy Tang on June 06, 2007, 14:12:26
Ahaha, I was just wondering what the new Drawable was.  ;D

Thanks