Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I don't like LWJGL in some cases, so I prefer to use Swing. The thing is that Swing doesn't have OpenGL. I have tried JOGL and it's a mess to install, needs external jars, and I have yet to get it working. So I was wondering if I could just make an OpenGL class that uses opengl32.DLL and put the graphics into a window made with Swing? Also, is opengl32.DLL able to be called with a 64 bit Java program?

share|improve this question

2 Answers 2

If you use a build system like MAVEN it is actually fairly easy to use JOGL. (But it is indeed stupidly hard to configure without it).

Just add this to your POM file

 <dependencies>
   <dependency>
     <groupId>org.jogamp.gluegen</groupId>
     <artifactId>gluegen-rt-main</artifactId>
     <version>2.0-rc11</version>
   </dependency>
   <dependency>
     <groupId>org.jogamp.jogl</groupId>
     <artifactId>jogl-all-main</artifactId>
     <version>2.0-rc11</version>
   </dependency>
 </dependencies>
share|improve this answer

JOGL does just that, but makes it easier for you. If you have trouble installing JOGL, you will have a lot more trouble trying to do it yourself. If you still insinst on doing it yourself, search for JNI and/or JNA.

share|improve this answer
1  
This is not really a helpful answer, it just says "try harder because it's the easiest think to do". Well... it's not the easiest thing to do. On the other hand, Roy actually gives some input. –  Liosan Apr 22 '13 at 10:18
    
@Liosan If he has problems with JOGL, I would be happy to help. However in the question he said he doesn't want to use it and I tried to convince him that he should anyway, because I believe JOGL is the correct solution. If you think there is an easier solution for Swing-OpenGL interoperability, I would like to hear about it, as I agree JOGL is quite hard to setup for the first time. –  msell Apr 22 '13 at 10:46
    
Fair enough, but still - Roy's answer actually adds something. Maybe the -1 was unnecessary, but I can't remove it now, it's "locked" :( As for alternatives, the OP stated that he doesn't like LWJGL, so there's not much more I can offer :) –  Liosan Apr 22 '13 at 11:01
    
"This is not really a helpful answer" - but it's correct nonetheless. –  Darth Satan Apr 22 '13 at 12:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.