Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  First Time with Libgdx ( NetBeans user )  (Read 4090 times)
0 Members and 1 Guest are viewing this topic.
Offline Andre Lopes
« Posted 2013-05-02 13:13:14 »

Hi Guys!
I downloaded the API and inserted the zip into the libraries.
Well, netbeans had issues finding the packages so i added each .jar separately.Well it kinda worked but, now this error happens :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
CODE: SELECT ALL
run:
org.lwjgl.LWJGLException: Could not locate OpenAL library.
   at org.lwjgl.openal.AL.create(AL.java:151)
   at org.lwjgl.openal.AL.create(AL.java:102)
   at org.lwjgl.openal.AL.create(AL.java:201)
   at com.badlogic.gdx.backends.openal.OpenALAudio.<init>(OpenALAudio.java:70)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:80)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:64)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:56)
   at Main.Main.main(Main.java:29)
Tyrian: Creating game
Tyrian: Resizing game to: 800 x 480
FPSLogger: fps: 61
FPSLogger: fps: 60
Tyrian: Pausing game
Tyrian: Disposing game
Java Result: -1
CONSTRU├ŹDO COM SUCESSO (tempo total: 2 segundos)



Im unsure on how to "install" or add this to my netbeans library, so i was wondering if anyone could give me a hand.
Ty

Ah, just to be clear, i know how to add libraries to my projects Tongue


Im following a tutorial, this is the two classes that the tutorial are using :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
package Main;

/**
 *

 */

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL20;
 
/**
 * The game's main class, called as application events are fired.
 */

public class Tyrian
    implements
        ApplicationListener
{
    // constant useful for logging
   public static final String LOG = Tyrian.class.getSimpleName();
 
    // a libgdx helper class that logs the current FPS each second
   private FPSLogger fpsLogger;
 
    @Override
    public void create()
    {
        Gdx.app.log( Tyrian.LOG, "Creating game" );
        fpsLogger = new FPSLogger();
    }
 
    @Override
    public void resize(
        int width,
        int height )
    {
        Gdx.app.log( Tyrian.LOG, "Resizing game to: " + width + " x " + height );
    }
 
    @Override
    public void render()
    {
        // the following code clears the screen with the given RGB color (green)
       Gdx.gl.glClearColor( 0f, 1f, 0f, 1f );
        Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );
 
        // output the current FPS
       fpsLogger.log();
    }
 
    @Override
    public void pause()
    {
        Gdx.app.log( Tyrian.LOG, "Pausing game" );
    }
 
    @Override
    public void resume()
    {
        Gdx.app.log( Tyrian.LOG, "Resuming game" );
    }
 
    @Override
    public void dispose()
    {
        Gdx.app.log( Tyrian.LOG, "Disposing game" );
    }
}


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
package Main;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.Audio;

/**
 *
 */


public class Main
{

    public static void main(String args[])
    {
           // create the listener that will receive the application events
       ApplicationListener listener = new Tyrian();
 
        // define the window's title
       String title = "Tyrian";
 
        // define the window's size
       int width = 800, height = 480;
 
        // whether to use OpenGL ES 2.0
       boolean useOpenGLES2 = false;
        // create the game
       LwjglApplication lwjglApplication = new LwjglApplication( listener, title, width, height, useOpenGLES2 );
   
       
    }

}
Offline Andre Lopes
« Reply #1 - Posted 2013-05-02 18:00:24 »

Ok.
I found this :
http://www.youtube.com/watch?v=vLx_72qxK_0&feature=player_embedded

Gonna try it and will post again afterwards.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #2 - Posted 2013-05-02 19:10:11 »

Word of warning, that is Gustavo Steigert's code, not yours, you should not put @author with your own name.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #3 - Posted 2013-05-02 19:13:17 »

I hardly see any code.

Offline Andre Lopes
« Reply #4 - Posted 2013-05-02 21:33:40 »

I didnt do it on purpose. I create the class and netbeans already inserted it.
But thanks anyway.
Offline Andre Lopes
« Reply #5 - Posted 2013-05-02 21:34:15 »

Thanks for your help.
Offline Andre Lopes
« Reply #6 - Posted 2013-05-02 21:47:43 »

Anyone can give me a hand ?
I guess the image speaks for itself :

Link to full resolution : http://img833.imageshack.us/img833/3614/javagameerror.jpg

Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2013-05-02 22:22:24 »

That is a file in gdx-natives.jar that libgdx extracts and then loads as a native.

Offline Andre Lopes
« Reply #8 - Posted 2013-05-02 22:27:34 »

Its there.But it doesnt work. I used the libgdx setup and tested it using its libs but still nothing.
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #9 - Posted 2013-05-02 22:34:05 »

Use eclipse:)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Andre Lopes
« Reply #10 - Posted 2013-05-02 22:43:34 »

Err... i dont think the IDE is the issue...
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #11 - Posted 2013-05-02 23:03:49 »

Debug through LwjglNativesLoader and see if it extracts the OpenAL lib and sets the system property correctly. If it does, I don't know why LWJGL can't find it. libgdx just updated LWJGL to the latest.

Offline Andre Lopes
« Reply #12 - Posted 2013-05-03 06:13:29 »

This stupid library sucks.

Im hours awake trying to figure this crap out and nobody freaking answers in their forum. So screw this, im going sleep.

If anyone is able to figure this out, i will appreciate.
Offline Andre Lopes
« Reply #13 - Posted 2013-05-03 06:16:16 »

Oh well, before raging quitting i did this and the error stop occurring :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
package Test1;

import org.lwjgl.*;
import com.badlogic.gdx.*;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Audio;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.LifecycleListener;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.backends.jglfw.JglfwApplication;
import com.badlogic.gdx.backends.openal.OpenALAudio;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Clipboard;
import com.badlogic.gdx.utils.GdxRuntimeException;

/**
 * This class simply creates a desktop LWJGL application.
 */

public class Main {

    public static void main(String[] args) {
        // create the listener that will receive the application events
       ApplicationListener listener = new Tyrian();

        // define the window's title
       String title = "Tyrian";

        // define the window's size
       int width = 800, height = 480;

        // whether to use OpenGL ES 2.0
       boolean useOpenGLES2 = false;
       
        // create the game
       Application app = new JglfwApplication(listener, title, width, height, useOpenGLES2);
       
    }
}


Wtf is JglfwApplication
Im sorry for the F word, but im freaking pissed.
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #14 - Posted 2013-05-03 11:57:04 »

Ehm, 7 hours before you started name calling I told you how to debug the issue. Needless to say I am not inclined to help you further. Pro tip: people that could help you are not required to care about your problems. It is actually much easier not to care.
https://code.google.com/p/libgdx/wiki/GettingHelp#Attitude

Offline gimbal

JGO Knight


Medals: 25



« Reply #15 - Posted 2013-05-03 13:58:53 »

Wtf is JglfwApplication
Google? I input JglfwApplication and get the javadoc:

http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/backends/jglfw/JglfwApplication.html

Which simply states it wraps around GLWF. So back to a google for "glwf":

http://www.glfw.org/

About 10 seconds of effort.

Quote
Im sorry for the F word, but im freaking pissed.

You should consider going to do something that is not related to computers in any way before you hurt yourself.
Offline Andre Lopes
« Reply #16 - Posted 2013-05-03 15:04:29 »

Oh ty.

Sorry it was 2 AM in the morning and i was tired like hell.
Anyway, i made a ticket in their forum and i will re-install the JRE's and JDK's as well.
Offline Andre Lopes
« Reply #17 - Posted 2013-05-03 15:24:34 »

I did in Eclipse, and it didnt show any message.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
import org.lwjgl.*;
import com.badlogic.gdx.*;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Audio;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.LifecycleListener;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.openal.OpenALAudio;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Clipboard;
import com.badlogic.gdx.utils.GdxRuntimeException;

/**
 * This class simply creates a desktop LWJGL application.
 */

public class Main {

    public static void main(String[] args) {
        // create the listener that will receive the application events
       ApplicationListener listener = new Tyrian();

        // define the window's title
       String title = "Tyrian";

        // define the window's size
       int width = 800, height = 480;

        // whether to use OpenGL ES 2.0
       boolean useOpenGLES2 = false;
       
        // create the game
       Application lwapp = new LwjglApplication(listener, title, width, height, useOpenGLES2);
        //Application app = new JglfwApplication(listener, title, width, height, useOpenGLES2);
       
    }
}


Err... so it was netbeans all along ? Weird stuff. Anyway, i will take this foward to them.

Ty u guys Tongue
Offline Andre Lopes
« Reply #18 - Posted 2013-05-03 15:49:59 »

Ticket Created : https://netbeans.org/bugzilla/show_bug.cgi?id=229330
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #19 - Posted 2013-05-03 22:25:24 »

I actually had a solution (sort of) sorry i couldnt help with netbeans though Sad

Offline Andre Lopes
« Reply #20 - Posted 2013-05-04 04:25:14 »

Ah dont worry m8.
;
Err, can i ask you something?
Does libdx already have the mainthread to run gameupdate(); then gamerender();  or i have to do it myself ?

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #21 - Posted 2013-05-04 05:44:52 »

gameupdate() and gamerender() aren't libgdx methods.  Huh
However, libgdx calls render(), create(), destroy(), etc. for you automatically.
Offline Andre Lopes
« Reply #22 - Posted 2013-05-04 13:14:52 »

Oh, ok. So all i have to do is put the methods there.. well that helps a lot Cheesy
I will try to make something.

Hey, ty!!!!

Tongue

I would ask about the collisions with this API, but.. i dont want abuse >.>
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #23 - Posted 2013-05-04 17:57:32 »

Not abuse if you try to find the answer first. Anyways, with libgdx you can either choose to make your own collision system, or go with box2d, which is a popular 2d physics library originating from C++ (ships with libgdx). If you're going to use that I would also recommend Aurelien Ribon's Physics Body Editor that allows you to make more complex shapes easily in box2d.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36

Riven (46 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (32 views)
2014-07-23 20:56:16
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

Resources for WIP games
by CogWheelz
2014-08-01 18:19:50

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!