Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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  
  .display( GLAutoDrawable d ) only called after initialisation or reshape  (Read 2768 times)
0 Members and 1 Guest are viewing this topic.
Offline Bucky

Junior Newbie

« Posted 2007-08-26 18:21:31 »

Hi everyone,

Newby to Jogl but not to programming and Java.

I'm learning the basics by drawing coordinate axes. My program can already make it appear on the screen so I'm trying to rotate the scene with my mouse and make the axes turn.

I've studied many demos. These two especially:
Gears at
Example 11 at

They compile and work just fine on my computer. But my attempts at replicating a rotating 3D space keep failing.  Angry

This much I know: my axes are drawn only when my program starts and when I reshape the window. My GLEventListener, MouseListener, MouseMotionListener all work and fire when needed. (I detect changes to the mouse's buttons and when it's being dragged.)

But .display( GLAutoDrawable d ) is never called when the mouse is being dragged.

Any suggestions?

Thanks. Smiley

Offline emzic

Senior Devvie

« Reply #1 - Posted 2007-08-26 22:06:23 »

display is automatically called from an awt-thread. what you should do is to update variables when you mouse is dragged and use them inside the display-loop to update your camera or coordinate system.
Offline cylab

JGO Kernel

Medals: 180

« Reply #2 - Posted 2007-08-27 01:38:45 »

Do you set up and start an animator like it is done in the Gears main()-method?

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lhkbob

JGO Knight

Medals: 32

« Reply #3 - Posted 2007-08-27 04:51:45 »

If you look at the api, you can call .display() on a GLCanvas and GLJPanel to start the necessary actions that eventually cause a .display(GLAutodrawable) method to get called.  So if you don't want to use Animator (or FPSAnimator) you can just call that on the GLCanvas/JPanel that you're using when you want the frame to get updated.

Offline Bucky

Junior Newbie

« Reply #4 - Posted 2007-08-27 05:03:46 »

A big thank you to all three of you.

.display is automatic. (One you've told it to start.)  Shocked

I was able to make it work with the animator. Will try with lhkbob idea later.

Offline lhkbob

JGO Knight

Medals: 32

« Reply #5 - Posted 2007-08-27 14:55:59 »

.display is automatic. (One you've told it to start.)  Shocked

.display() isn't automatic.  .display(GLAutoDrawable) is.  I said look at the API, there's a difference.

In the API for GLAutoDrawable, you find:
void display()
Causes OpenGL rendering to be performed for this GLAutoDrawable by calling display for all registered GLEventListeners.

If you got it to work with Animators, thats great, but this was only so you didn't mistake what I had said before.

Pages: [1]
  ignore  |  Print  

EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (27 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (210 views)
2018-05-13 18:23:11

nelsongames (127 views)
2018-04-24 18:15:36

nelsongames (126 views)
2018-04-24 18:14:32

ivj94 (867 views)
2018-03-24 14:47:39

ivj94 (128 views)
2018-03-24 14:46:31

ivj94 (779 views)
2018-03-24 14:43:53

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!