Jump to content

  • Log In with Google      Sign In   
  • Create Account


libGDX weird SpriteBatch error


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 lavalamp360   Members   -  Reputation: 114

Like
0Likes
Like

Posted 01 May 2014 - 06:24 PM

I started using libGDX recently and started making a Pong clone to start with it (its how i get used to/learn new frameworks).

 

Every time I try to create a SpriteBatch object like so:

SpriteBatch batch = new SpriteBatch();

I get this bizzare compiler error:

 

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(I)Ljava/nio/ByteBuffer;

at com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(Native Method)

at com.badlogic.gdx.utils.BufferUtils.newUnsafeByteBuffer(BufferUtils.java:517)

at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:59)

at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:50)

at com.badlogic.gdx.graphics.Mesh.<init>(Mesh.java:145)

at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:93)

at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:72)

at com.********.**********.GameMaster.<init>(GameMaster.java:18)

at com.********.**********.Main.main(Main.java:18)

 

I cant seem to figure out what the issue is. I've included all necessary .jar files to the build path too.


Edited by lavalamp360, 01 May 2014 - 06:41 PM.


Sponsor:

#2 Serapth   Crossbones+   -  Reputation: 5178

Like
0Likes
Like

Posted 01 May 2014 - 08:58 PM

I started using libGDX recently and started making a Pong clone to start with it (its how i get used to/learn new frameworks).

 

Every time I try to create a SpriteBatch object like so:

SpriteBatch batch = new SpriteBatch();

I get this bizzare compiler error:

 

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(I)Ljava/nio/ByteBuffer;

at com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(Native Method)

at com.badlogic.gdx.utils.BufferUtils.newUnsafeByteBuffer(BufferUtils.java:517)

at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:59)

at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:50)

at com.badlogic.gdx.graphics.Mesh.<init>(Mesh.java:145)

at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:93)

at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:72)

at com.********.**********.GameMaster.<init>(GameMaster.java:18)

at com.********.**********.Main.main(Main.java:18)

 

I cant seem to figure out what the issue is. I've included all necessary .jar files to the build path too.

 

You are missing a dependency.  Did you create your project using the setupUI?



#3 lavalamp360   Members   -  Reputation: 114

Like
1Likes
Like

Posted 01 May 2014 - 10:19 PM

Nevermind. I figured it out. Just in case anyone else experiences the same problem, you apparently cannot initialize libGDX objects in this way. You must initialize them in the create() method which is basically a replacement for the constructor. 






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS