aspose file tools*
The moose likes Java in General and the fly likes JOGL 1 vs JOGL 2.0? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JOGL 1 vs JOGL 2.0?" Watch "JOGL 1 vs JOGL 2.0?" New topic
Author

JOGL 1 vs JOGL 2.0?

Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Anyone have any opinions on which you like better? I've been reading some stuff from about a year ago saying it's a bit unstable... Thoughts?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

I don't use JOGL at all. I've been dabbling a bit with jMonkeyEngine, which is based on LWJGL, which is maintained much more frequently than JOGL and also contains an OpenAL API.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

I basically have a premade program, that i'm converting to Java, that has open GL code in it. I'm not creating a hardcore game or anything like that. Could you explain more about it? Would I be able to do the normal open GL code in it? I have the files for JOGL 2.0 right now, haven't done much with it, but nothing has gone wrong per say...
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

LWJGL should be able to do exactly the same stuff, but if you already have JOGL then just go with that, if all you're doing is making a port. As long as you're not running into problems, just go with what you have.

JOGL 2 has had a recent beta release, I think, so I'm sure they're working on stability as well. Don't worry, I'm pretty sure the code wouldn't be that hard to refactor if you do decide to switch to something else. Most OpenGL wrapper libraries provide a bunch of static methods anyway.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

I was just looking up lwjgl it looks like the code is the same? A lot of people seem to favor it over JOGL. I haven't started any code with JOGL itself. I also saw a lot of people talking about an Engine called JMonkey, thoughts?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

Well, you said that you're not busy making any games, so jMonkeyEngine may be overkill for what you want to do. If you're planning on getting into creating games, it will be useful to learn about jMonkeyEngine, but if not, then all you really need is an OpenGL wrapper for Java. Either JOGL or LWJGL will do just fine. People favor LWJGL because it's more current and provides more than just OpenGL.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

JMonkey is like netbeans haha :P. I'm actually creating a 3D dice game, but it's not going to be anything "Hardcore..."



Also can you use swing with lwjgl? I was reading up that you use AWT only?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

Yeah, it's easier to integrate JOGL into Swing components. Especially useful if you want to have 3D animation in a simple desktop GUI. LWJGL is more suited for AWT components and full-screen mode.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Stephan van Hulst wrote:Yeah, it's easier to integrate JOGL into Swing components. Especially useful if you want to have 3D animation in a simple desktop GUI. LWJGL is more suited for AWT components and full-screen mode.


Yeah.... Why wouldn't LWJGL use swing, isn't it better than AWT in terms of graphics and performance(Even though we are running the Open GL using them...) Does LWJGL have to be in full screen, doesn't seem like it's a mandatory thing...
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Jay Orsaw wrote:
Stephan van Hulst wrote:Yeah, it's easier to integrate JOGL into Swing components. Especially useful if you want to have 3D animation in a simple desktop GUI. LWJGL is more suited for AWT components and full-screen mode.


Yeah.... Why wouldn't LWJGL use swing, isn't it better than AWT in terms of graphics and performance(Even though we are running the Open GL using them...) Does LWJGL have to be in full screen, doesn't seem like it's a mandatory thing...



Also is there any way to print via JOGL or LWJGL?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

LWJGL doesn't use Swing, because OpenGL is easier to use on heavyweight components. JOGL also mostly uses AWT, but provides a GLJPanel class that integrates with Swing, at a somewhat lower performance.

It's not necessary to use full-screen mode with LWJGL, it's just what's mostly associated with a graphics library like OpenGL.

I don't understand what you mean when you talk about printing.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Stephan van Hulst wrote:LWJGL doesn't use Swing, because OpenGL is easier to use on heavyweight components. JOGL also mostly uses AWT, but provides a GLJPanel class that integrates with Swing, at a somewhat lower performance.

It's not necessary to use full-screen mode with LWJGL, it's just what's mostly associated with a graphics library like OpenGL.

I don't understand what you mean when you talk about printing.



Like as in print a page with a printer.... I've heard there is an issue with trying to print out things in Open GL.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

Where have you heard this? Can you quote your source?

I don't think printing and OpenGL have anything to do with one another.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Stephan van Hulst wrote:Where have you heard this? Can you quote your source?

I don't think printing and OpenGL have anything to do with one another.


I'm not sure, that's what I'm asking... I want to know can you take an object like a quad created in open gl and send it to a printer to print out onto a page? I've heard it's possible, just not sure how per say....
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

In JOGL, you can render your 3D model on a GLPBuffer, and then convert the buffer to a BufferedImage using Screenshot. Then I'm pretty sure there are plenty of ways to get the BufferedImage to print in a way you want.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Stephan van Hulst wrote:In JOGL, you can render your 3D model on a GLPBuffer, and then convert the buffer to a BufferedImage using Screenshot. Then I'm pretty sure there are plenty of ways to get the BufferedImage to print in a way you want.


I forgot to mention that I've heard of Screen shotting before, but that it kills quality/resolution is that true?

What I'm being told is that I need the buffer to be a very high resolution (3000x3000 or bigger) and then print that buffer itself. Screen Shotting will kill all that apparently...
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

I was talking about the Screenshot class, which provides a method to convert from GLDrawable to BufferedImage. I can't imagine it compresses the image.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Stephan van Hulst wrote:I was talking about the Screenshot class, which provides a method to convert from GLDrawable to BufferedImage. I can't imagine it compresses the image.


Ok sweet, the person I was speaking to uses another language, I would hope nothing goes wrong.


I looked for the "Screenshot" class, but I couldn't find a class called that; however I found a bunch of examples from a class called "Robot" but it seems that takes the size of the screen, takes a shot, then converts it? Am I able to adjust resolution/Quality and such of the GLDrawable, or of the buffer itself?

Thanks again for all of your help, I appreciate it greatly!
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

Screenshot is a class in the JOGL API, not the standard API ;)
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Stephan van Hulst wrote:Screenshot is a class in the JOGL API, not the standard API ;)


meh I guess I'll be sticking with JOGL if LWJGL doesn't have something like this...
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

Why are you jumping to conclusions? LWJGL can capture image data through a pbuffer just as well.

Just do a google search for whatever technology you want to use, and BufferedImage. You're bound to find something.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Stephan van Hulst wrote:Why are you jumping to conclusions? LWJGL can capture image data through a pbuffer just as well.

Just do a google search for whatever technology you want to use, and BufferedImage. You're bound to find something.


I didn't jump anywhere, I said IF LWJGL didn't have something like this... I'll look up "Pbuffer..."


Would you say that mixing both JOgl and LWJGL together would be a bad idea or pointless? It seems like from what you've Said JOGL is for simpler things and non-gaming related, and the LWJGL is specifically made for gaming; however using JOGL for gaming wouldn't be horrible, nor would LWJGL for non-game related tasks be bad either...
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

LWJGL and JOGL are pretty much the same in the OpenGL department, except that JOGL is easier to integrate with Swing. LWJGL on the other hand also provides OpenAL and OpenCL wrappers, as well as libraries to handle game controllers.

Mixing the two is mostly pointless, unless you want to use LWJGL's extra libraries on top of JOGL's graphics library.

I don't know how much more I can tell you. If you have more questions, I suggest you read their respective wikis.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Thanks! So I am trying to take a screen shot of the display, but for some reason I keep getting errors... I have to start a new thread which I named as a class called "screenShot" Problem is that I'm having an issue placing the new thread, because there seems to be an issue with the Display and it's updating... I used the lwjgl tuts.




There was also one time when I was using the JOGL ScreenShot class it saved a black picture, without the rectangle... Not sure how I got this, I checked a little bit later and found a saved file...



http://lwjgl.org/wiki/index.php?title=LWJGL_Basics_3_(The_Quad)

http://lwjgl.org/wiki/index.php?title=Taking_Screen_Shots


I tried doing a JOGL 2.0 example and using the screen shot class and I got another blank screen.. weird .


I did whatI needed to using jogl, I was using a writetargafile and it was using a "Fast screen shot" so it was only blank...

Okay the Targa file works now weird...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JOGL 1 vs JOGL 2.0?