LWJGL
May 22, 2013, 16:22:00 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Mouse and Keyboard input for AWTGLCanvas  (Read 1084 times)
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« on: March 29, 2011, 09:51:45 »

How should I handle Mouse and Keyboard input when I've got an AWTGLCanvas running inside of a JFrame along with other components?

I get this error:

Code:
Mouse must be created before you can read events
at org.lwjgl.input.Mouse.next(Mouse.java:423)
Logged
kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #1 on: March 29, 2011, 10:09:28 »

don't think you can use LWJGL Mouse and Keyboard classes when using an AWTGLCanvas as they require lwjgl's native window to function (and in this case it doesn't exist). Instead you will have to use AWT's input classes.

If however you use want to embed with AWT and still use LWJGL Mouse and Keyboard classes you will have to use the Display.setParent(Canvas) method.
Logged
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« Reply #2 on: March 29, 2011, 10:18:56 »

Ah, I see. Yeah, I can't use Display.setParent(); I've got multiple AWTGLCanvases at once.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!