Java-Gaming.org
Java4K winners:
[
by our judges
|
by the community
]
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members
News
: Read the
Java Gaming Resources
, or peek at
the official Java tutorials
Home
Help
Search
Login
Register
Java-Gaming.org
>
Java Game APIs & Engines
>
OpenGL Development
>
JOGL Development
>
Jogl & Swing
Pages: [
1
]
Print
Jogl & Swing
(Read 2856 times)
0 Members and 1 Guest are viewing this topic.
paul
JGO n00b
Posts: 6
Java rocks!
Jogl & Swing
«
on:
2003-06-24 13:02:22
»
Anyone got even a simple jogl program to run with a Swing JFrame ?
I tried changing the Frame constructor in the gears demo to
JFrame frame = new JFrame()
frame.getRootPane.add( canvas )
The Frame appears on the screen but nothing is rendered, it appears that none of the GearRendered methods are called
Orangy Tang
JGO Kernel
Posts: 2960
Medals: 37
Monkey for a head
Re: Jogl & Swing
«
Reply #1 on:
2003-06-24 14:07:14
»
Try:
1
2
JFrame
frame
=
new
JFrame
();
frame
.
getContentPane
().
add
(
canvas
);
I have it working ok, but be careful with rearranging components - the access violation I described in another thread also crops up if i try and resize the frame after it is initially visible when i'm using a border layout. Hopefully these teething problems will be ironed out soon.
[
TriangularPixels.com
- Play Growth Spurt, Rescue Squad and Snowman Village ] [
Rebirth - game resource library
]
paul
JGO n00b
Posts: 6
Java rocks!
Re: Jogl & Swing
«
Reply #2 on:
2003-06-27 14:22:19
»
OK, I've found the cause of the problem I was seeing.....
When using a awt.Frame as the container the jogl GLEventListener init is called when the frame is shown.
When using a JFrame as the container the GLEventListener is not called when the frame is shown. Adding an Animator to the canvas forces the initialisation and everything renders correctly.
I'll check the docs carefully and figure out if this is a bug or a feature
Games published by our own members! Go get 'em!
Ken Russell
JGO Kernel
Posts: 3446
Medals: 3
Java games rock!
Re: Jogl & Swing
«
Reply #3 on:
2003-06-28 20:05:50
»
Sounds like a bug. Please boil it down to a small test case and file an issue on
http://jogl.dev.java.net/
.
vydias
Jr. Member
Posts: 52
Welcome to my world!
Re: Jogl & Swing
«
Reply #4 on:
2003-07-01 01:39:03
»
btw where are the docs for JOGL? I'm playing around with it and have added it to a JFrame with some mix results.
1) I notice some skips in the rendering where my 2d frame buffer shows for a split second every now and then. (the rendering loop for the 2d buffer is turned off when I switch over to the glCanvas).
2) I'm also having trouble closing down the glCanvas. I'm calling dispose on it and trying to switch back to my 2d rendering pipe with not much luck. It appears the canvas is being disposed but setting focus back to my JFrame and starting the 2d rendering loop back up isn't doing the trick.
Also should I remove my mouse listeners and keyboards listeners from my original Jframe? and reset them after I dipose of the glcanvas. It works without doing this so I'm wondering if it is a good idea or not.
Ken Russell
JGO Kernel
Posts: 3446
Medals: 3
Java games rock!
Re: Jogl & Swing
«
Reply #5 on:
2003-07-03 00:57:02
»
The documentation is currently minimal. There is an overview guide in the source tree at doc/userguide/index.html. The javadoc, however, should be pretty complete at least for the core JOGL package.
The issues around disposing of a GLCanvas haven't been 100% thought through yet. I believe Pepijn Van Eeckhoudt (pepijnve on java.net) is looking into bringing GL4Java's disposal handling into JOGL.
Without more knowledge of how your application is set up I can't guess why you might be seeing flickering of your 2D display over your 3D one.
Pages: [
1
]
Print
Jump to:
Please select a destination:
-----------------------------
Games Center
-----------------------------
=> Featured Games
=> Showcase
=> Contests
===> LWJGL16k - 2011
===> 4K Game Competition - 2012
===> JGO Comp Petite
===> Finished Contests
=====> 4K Game Competition - 2011
=====> 4K Game Competition - 2010
=====> 4K Game Competition - 2009
=====> 4K Game Competition - 2008
=====> 4K Game Competition - 2007
=====> 4K Game Competition - 2006
=====> 4K Game Competition - 2005
=====> Tiny Game 2010
=====> JGO Comp 2009
=====> 16K LWJGL Competition - 2005
=====> Java Technology Game Development Contest - 2004
-----------------------------
Discussions
-----------------------------
=> General Discussions
===> Suggestions
=> Business and Project Discussions
===> Jobs and Resumes
===> Community & Volunteer Projects
=> Miscellaneous Topics
-----------------------------
Game Development
-----------------------------
=> Newbie & Debugging Questions
=> Articles & tutorials
=> Game Play & Game Design
=> Game Mechanics
===> Artificial Intelligence
=> Networking & Multiplayer
=> Performance Tuning
=> Shared Code
-----------------------------
Java Game APIs & Engines
-----------------------------
=> Engines, Libraries and Tools
===> Java 3D
===> JInput
===> jMonkeyEngine
===> Xith3D Forums
===> Tools Discussion
=> Java 2D
===> JavaFX
=> OpenGL Development
===> JOGL Development
===> LWJGL Development
=> Java Sound & OpenAL
===> JOAL Development
=> Java on Mobile Devices
===> Android
===> J2ME
Loading...