Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (591)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-21 09:10:05
It's ok ; requestFocus and consume methods are working fine ... I was just using the wrong jar file ...  Roll Eyes

For other people information
- when using a JDialog in an applet, you should give the parent frame the focus back with requestFocus when closing the dialog.
- when dealing with MouseWheelEvents, you should consume the event after it processing so that the browser doesnt get it and scroll the page up and down. This working may be different depending on the browser I guess...



2  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-20 08:16:52
I did checkout your projet ; it sure will be helpfull. Your ant file is so complexe !  Grin

I still have a few askings ; I did a few search on the net, but wasn't able to find something
- my application opens a modal dialog (JDialog) ; when it closes, the parent "frame" and glcanvas lose the focus ; I have to manually give it back (by clicking).
- events (mouse wheel down and up) are caught by my applet (it's all right with this) but also by the browser that scrolls the page up and down for example that is very annoying. I tried the "consume" method but it doesn't work.
3  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-14 17:13:01
It's ok now, with jogl 2.0 b23 it's running fine, both jnlp and applet (with fireforx)
I had hard times particulary cause I thought I had to use a local newt-all-awt.jnlp, but actually, only jar in the resources tag are needed to be at the same location that the jnlp file ; for an extension, an online version is all right.

I also had troubles getting the good things, libraries, source codes and so on the jogamp web site ; it's a bit messy (or am'i getting old ? mdr) ... that's one of the reason why I was still using jogl 1.1, cause I felt a bit lost  Tongue

Nevertheless, it's working !!! Thanks all ! I learnt a lot of things (still have a lot to improve ; ant or maven using for example mdr)
4  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-14 07:51:55
Man, you're right and wise man.

Misunderstandings led to confusion.
My apologizes to gouessej (but please stop using size=20 response mdr)
5  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-13 15:46:45
Please stop flooding my thread ; your responses are useless for me. So please, let other people with interesting things to write ; you look better in writing lybian restaurant tour mdr

I insulted you ? Who first lacked respect to the other ? You with size=20 response.

kappa had really intersting responses ; let him and others posts. You are not intersted in helping people, you're just interested in showing you're right


6  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-13 14:03:24
I have never wanted to port my game into an applet as I have realized by myself that the support of applet is quite poor on some browsers especially on Google Chrome/Chromium and Opera.
liar Wink Dont try to fool me, you gave up because you were not able to make your applet run ! I rode your posts on forums (java-fr I think) this week-end, where you had similar issues that the one I had (caching issues I guess)
Short memory or selective memory ? mdr

Your posts are REALLY useless Smiley for the applet programming domain at least
7  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-13 13:19:17
I already told you that you are using an obsolete version.
Huh

.... you just dont even succeed in porting your game in an applet and encountered troubles like mine ... your post was really useless ; you'd better shut up

this trouble is not linked to the jnlp usage but to my code. I like to understand what lies behind troubles, if you dont, this is your problem ; I dont change of version "just to" ...
Now I can understand what happened and could eventually help other people

8  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-13 10:14:59
Holly s**t ...  Grin

The GearsApplet contains
1  
import javax.media.opengl.awt.GLCanvas;


my applet contains
1  
import javax.media.opengl.GLCanvas;


some version issue I guess ...
9  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-13 10:09:11
Thanks, this will be VERY useful !

I modified the gearsapplet to use my Applet

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  
<?xml version="1.0" encoding="utf-8"?>
<jnlp href="file:/F:/work/site/gearsapplet/builder5.jnlp">
  <information>
    <title>JOGL JNLP Applet Gears Demo</title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <homepage href="http://jogl-demos.dev.java.net/"/>
    <description>Gears Demo</description>
    <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description>
    <offline-allowed/>
  </information>

    <resources>
      <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
      <property name="sun.java2d.noddraw" value="true"/>
      <jar href="file:/F:/work/site/gearsapplet/builder5.jar" main="true"/>
      <jar href="file:/F:/work/site/gearsapplet/jogl-demos-util.jar"/>
      <extension name="jogl-all-awt" href="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-all-awt.jnlp" />
    </resources>

  <applet-desc
      name="Gears-Applet"
      main-class="launchers.MyAppletLauncher"
      width="640"
      height="480">
  </applet-desc>
</jnlp>


my applet is launched but I still get a
Quote
java.lang.NoClassDefFoundError: javax/media/opengl/GLCanvas
The jvm can't find jogl.jar ... Why ? The
1  
<extension name="jogl-all-awt" href="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-all-awt.jnlp" />
should do it ... Why the appletgears can find this jar and not my applet ?
10  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-13 09:27:57
Changing the jnlp name file (and the associate href value in the jnlp tag) was "enougth" to solve the trouble ... but I guess A LOT of my past troubles were due to some caching issue.
So if you know how to flush ALL the cash stuff, [size=10pt]please [/size]  Grin let me know...

Now I will try to get my own applet running...
11  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-13 09:23:18
Me again

I'm getting crazy

I try to make the gearsapplet run in "local mode" : has shown on http://download.java.net/media/jogl/demos/www/applettest-jnlp.html I created a jnlp file, downloaded the jogl-demos.jar and jodl-demos-util.jar (utility of this one for the gearsappet ?), changed the href values but ...

I ran it once with a bad value for the href attribute of the jnlp tag (utility of this href ? a href that links to its file ?)
1  
<jnlp href="gearsapplet.jnlp">

JVM console says the href value is wrong. I already had this error so I know that the href value must contain the path to the jnlp file. SO I change it ... and I still have the same error... Some caching issue I guess ... how to flush the cach ?
12  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-12 14:57:01
Nope, thats wrong, JOGL is a third party library and is not part of the JRE or JDK.
Really ? That's weird ... I was pretty sure of it cause I've the same issue when running jogl application from eclipse and I have to put the jdk at the bottom of the "Order list" in the class path tab ...
I may have confused and copied dll and jar in the jdk installation directory ...

Thanks all. It's not running yet, but I will get it !!! Cheesy
13  Java Game APIs & Engines / JOGL Development / Re: JOGL in an applet on: 2011-04-12 14:20:41
Thanks guys for your responses
Hmm, i think your confusing concepts here a little as the jre doesn't contain a jogl package. Unless of course you put jogl files into the jre directory which you should never do.
You're right : it's not the jre but the jdk 1.6 that contains a jogl distribution (I checked it on my disk). My JAVA_HOME env variable is set to the JDK directory so ... could this be the issue with it ?

Jogl requires native files (*.dll files on windows) to be able to function, these need to be downloaded and loaded by the jvm before it can function as an applet. One way to load natives in an applet is using the appletlauncher which will start as an applet (before the normal applet), download and load the natives for you before loading the normal applet. The other method to do this is through jnlp (java 1.6.0_10+).
So, using the applet launcher, you dont have to put jogl.jar and dll in the jar to deploy, am'i right ?
Ok this makes sens ... but developping the jnlp file is not so easy (i already tried it) and i didn't find good articles or tutorials on it. Would you know some ?

Trying to adapt the jnlp file from the GearsDemo but I get some ClassNotFoundException. Looks like the jar file is not found. Here follow my jnlp file

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  
<?xml version="1.0" encoding="utf-8"?>
<jnlp href="file:///F:\work\site\test.jnlp">   // location of the jnlp file
  <information>
    <title>JOGL JNLP Applet Gears Demo</title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <homepage href="http://jogl-demos.dev.java.net/"/>
    <description>Gears Demo</description>
    <description kind="short">Brian Paul's Gears demo ported to Java and JOGL.</description>
    <offline-allowed/>
  </information>

    <resources>
      <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
      <property name="sun.java2d.noddraw" value="true"/>
      <jar href="file:///F:/work/site/builder.jar" main="true"/>   // location of the jar file
      <extension name="jogl-all-awt" href="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-all-awt.jnlp" />
    </resources>

  <applet-desc
      name="Gears-Applet"
      main-class="launchers.simpleLauncher.class"
      width="640"
      height="480">
  </applet-desc>
</jnlp>

14  Java Game APIs & Engines / JOGL Development / JOGL in an applet on: 2011-04-12 13:29:50
Hi all,

I'm trying to get jogl running in an applet. My application runs well from Eclipse.
The jogl.jar, jogl.dll and so are in the jar file called by the applet, but I still have got an AccessDenied exception when manualy trying to load the library with a System.loadLibrary command (just to test if the jvm find the native libraries)

I think this issue is caused by the jre 1.6 that contains a bad distribution of jogl
In eclipse, I had the same kind of issue ; I resolved it puting the jre at the bottom of the list in the "Order and Export" Tab in the "Java build path" options.

But I dont know how to do the same with an applet (or using jvm parameters or so). How can I say my applet not to load jogl packages of the jre distribution ?


An other question is about the appletLauncher used in the GearsDemo for example.
I don't really understand how it works (it seems to be an applet loading another applet is it right ?) and why it's usefull
I undestood it uses the jnlp file, but all this seems more complicated than using a applet running the jar file ... What are the issues ?
15  Java Game APIs & Engines / JOGL Development / Re: 2 glCanvas in a JFrame on: 2011-01-27 11:35:49
Thanks all for your replies (and sorry for my approximate english writing)

It looks ok now ; my renderers were wrong and not dealing properly shared datas ; no troubles with multi-threading or so ! The code in my first post is ok. I'm sorry for making you waste your time.

I saw a previous thread on the same kind of trouble ; it was said in it to use a single animator for many canvases, and to deactivate autoSwapBuffering.
By the way, my GUI works with autoSwapBuffering enabled and with 2 animators, but that was an interesting way to explore.
However, I dont really understand the behaviour of all this. Where could I find some ressources on the subject ? How buffer swaping works or should work in a multi canvases context ?


do you need to use 2 canvas's? Why not just use multiple view ports?
I worked and thought on such a solution. However technics are much more complicated (i'm quite a beginner using opengl and dont want to go to far in it for now). And in my case, the idea was to create a GUI that mixes 3d rendering and other swing components (buttons, trees ... ) so that i dont have to re-create a 3d JTree-like component. I searched for a kind of jogl GUI "library", but couldn't find one.

Another question I cant find no response is about the "theory and technics" on the popup windows and dialogs in games.
Let's take Minecraft for example ; when you open the main menu, or the "material" menu : how does it work ? I guess he doesnt use a JFrame or JDialog ... Does he render the menu or dialog in a texture and rendering this texture over the main scene ? But with non modal dialogs how should this work ?

Thanks in advance
16  Java Game APIs & Engines / JOGL Development / 2 glCanvas in a JFrame on: 2011-01-26 15:46:02
Hi all,

I built a JFrame containing 2 glCanvases.
I linked each canvas with a different renderer, implementing the GLEventListener interface. Each renderer has its own Animator.

It doesn't work : rendering is weird. It looks like parts of rendering are past to the other glCanvas.

Any ideas ? is this GLContext or multi-threading issue ?

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  
/* Generated with neatbeans */
public class SelectorDialog extends javax.swing.JDialog {
....

    private GLCanvas canvas1;
    private GLCanvas canvas2;

    public GLCanvas getCanvas1() {
        return canvas1;
    }

    public GLCanvas getCanvas2() {
        return canvas2;
    }

}

public View1 implements GLEventListener {
...
}

public View2 implements GLEventListener {
...
}

public class MySelector extends Selector {

public MySelector() {

   GLCanvas canvas1 = getCanvas1();
   canvas1.setAutoSwapBufferMode(true);

   View1 view1 = new View1();
   canvas1.addGLEventListener(view1);
     
        FPSAnimator animator = new FPSAnimator( canvas1 , 60 );
        animator.setRunAsFastAsPossible(false);
        animator.start();
       
        GLCanvas canvas2 = getCanvas2();
        canvas2.setAutoSwapBufferMode(true);

   View2 view2 = new View2();
   canvas2.addGLEventListener(view2);
     
        FPSAnimator animator2 = new FPSAnimator( canvas2, 60 );
        animator2.setRunAsFastAsPossible(false);
        animator2.start();
       
        setVisible(true);
}

}


Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (34 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (66 views)
2014-11-07 19:57:14

TehJavaDev (70 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (83 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

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

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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!