Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Moving from Gl4java to Jogl  (Read 2506 times)
0 Members and 1 Guest are viewing this topic.
Bornter
Guest
« Posted 2003-07-03 16:45:36 »

With Gl4java I've done some mini OpenGL apps. Now I'd like to move to Jogl. The short note http://jogl.dev.java.net/source/browse/jogl/doc/differences-from-gl4java.txt is helpful, but there a few problems I don't understand.
    [*]"No more GLAnimCanvas/GLAnimJPanel variants. To perform animation, attach an Animator to a GLDrawable."
    Ok, that's clear. However, with Gl4java's GLAnimCanvas one could do:
    1  
    2  
    3  
    GLAnimCanvas canv = GLDrawableFactory.getFactory().createGLAnimCanvas(...);
    canv.setUseRepaint(false);
    canv.setAnimateFps(25);

    When, for example, 25 frames per second did do the job.
    Is such fine tuning also possible with Jogl? Or does Jogl's Animator just call diplay() as often as possible? (Which is ok for most model-view-controller-games.)[/list]
      [*]"GLContext is no longer exposed in the public API."
      Ok, no problem, expect: at the end of the display() methode in Gl4java one swaped the double buffer via:
      1  
      2  
      GLContext mycont;
      mycont.gljSwap();

      How do you do this in Jogl?
      Also, on this topic: when in Jogl I issue these lines:
      1  
      2  
      3  
      4  
      GLCapabilities kap = new GLCapabilities();
      kap.setDoubleBuffered(true);
      kap.setStereo(false);
      GlKanvas mycanv = GLDrawableFactory.getFactory().createGLCanvas(kap);

      Then does Jogl use double buffering? When mycanv is in a full-screen windows, does this mean the good old Hardware page flipping we all know and love from C(++) OpenGL? :-)
      [/list]
        [*]"No GLEnum class. Use GL.[GL_CONSTANT_NAME]."
         Whoops. Ok, this is more Java? I don't know, I'm no expert. :-)  However I liked the GLEnum class much, because it reads more OpenGL like. But so what. It's nice to see Jogl growing. Good job, you people doing it.
        [/list]

        Oh, so many questions. Thanks in advance.

        -ric
        Offline Orangy Tang

        JGO Kernel


        Medals: 56
        Projects: 11


        Monkey for a head


        « Reply #1 - Posted 2003-07-04 07:21:55 »

        Animator triggers the swapBuffers call after display returns. This one caught me out, the docs aren't very clear on this. Animator currently runs as fast as possible, but i guess it wouldn't be too difficult to crowbar in a well-placed sleep() call depending on a target fps.

        Double buffer is automagic i think, i don't recall having to do anything special for it. Since the buffers already live in vRam for a GLCanvas, it'll be good old pointer swap/page flipping Smiley Probably doesn't apply to the Swing canvas though.


        [ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
        Bornter
        Guest
        « Reply #2 - Posted 2003-07-04 13:16:30 »

        Quote
        Animator triggers the swapBuffers call after display returns. This one caught me out, the docs aren't very clear on this.

        Yes, me too. :-)  But indeed that makes sense. Well then, no more manually Glu.SwapBuffers - that's ok.

        Quote
        Animator currently runs as fast as possible,

        That makes sense, too.

        Quote
        but i guess it wouldn't be too difficult to crowbar in a well-placed sleep() call depending on a target fps.

        Would be a nice-to-have feature in the future.

        Quote
        Double buffer is automagic i think, i don't recall having to do anything special for it. Since the buffers already live in vRam for a GLCanvas, it'll be good old pointer swap/page flipping :) Probably doesn't apply to the Swing canvas though.

        Sounds great!
        Many thanks for your answer.
        Games published by our own members! Check 'em out!
        Legends of Yore - The Casual Retro Roguelike
        Bornter
        Guest
        « Reply #3 - Posted 2003-07-05 06:00:49 »

        Double buffer is enabled by default. According to
        http://jogl.dev.java.net/unbranded-source/browse/*checkout*/jogl/doc/userguide/index.html?rev=1.2

        "A GLCapabilities object specifies the OpenGL parameters for a newly-created widget, such as the color, alpha, z-buffer and accumulation buffer bit depths and whether the widget is double-buffered. The default capabilities are loosely specified but provide for truecolor RGB, a reasonably large depth buffer, double-buffered, with no alpha, stencil, or accumulation buffers. "
        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.

        Dwinin (19 views)
        2014-09-12 09:08:26

        Norakomi (54 views)
        2014-09-10 13:57:51

        TehJavaDev (63 views)
        2014-09-10 06:39:09

        Tekkerue (31 views)
        2014-09-09 02:24:56

        mitcheeb (53 views)
        2014-09-08 06:06:29

        BurntPizza (37 views)
        2014-09-07 01:13:42

        Longarmx (23 views)
        2014-09-07 01:12:14

        Longarmx (26 views)
        2014-09-07 01:11:22

        Longarmx (26 views)
        2014-09-07 01:10:19

        mitcheeb (34 views)
        2014-09-04 23:08:59
        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

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

        HotSpot Options
        by dleskov
        2014-07-08 01:59:08
        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!