Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

libGDX weird SpriteBatch error

4: Adsense

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   

186
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.


#2 Serapth   Members   

6670
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   

186
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.