LWJGL
May 21, 2013, 11:54:59
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
LWJGL is now using GitHub
Home
Help
Search
Login
Register
LWJGL
>
Programming
>
Lightweight Java Library Game Development
>
Use LWJGL and Graphics2D
Pages: [
1
]
« previous
next »
Print
Author
Topic: Use LWJGL and Graphics2D (Read 2322 times)
floyd82
Newbie
Posts: 2
Use LWJGL and Graphics2D
«
on:
September 24, 2011, 04:07:09 »
Hi,
I'm currently developing a game inside a JFrame with java.awt.Canvas and heavy use of java2d (Graphics2D).
But now I find that the swing mouse and keyboard functions are insufficient for my purposes, because it is event based and I want to use polling. Can I use the LWJGL Mouse and Keyboard functions together with my JFrame and java.awt.Canvas?
I already tried using it but got "Display must be created." errors. It seems that I must have a LWJGL display to use the mouse and keyboard. I also found Display.setParent() and AWTGLCanvas, but I can't get it running...
Is it possible to use LWJGL and Graphics2D together?
Thank you very much in advance!
Stefan
Logged
princec
Nerdus Imperius
Posts: 1868
Re: Use LWJGL and Graphics2D
«
Reply #1 on:
September 24, 2011, 14:32:02 »
You could just use Jinput. Or really, as you're using AWT anyway, you should find that the event-based system is no more or less effective than polling.
Cas
Logged
Puppygames - Play Revenge of the Titans here!
floyd82
Newbie
Posts: 2
Re: Use LWJGL and Graphics2D
«
Reply #2 on:
September 24, 2011, 15:53:12 »
Thanks for your answer!
I'll take a look at jinput...
I had the assumption, that the event based input handling is slower because of a lot of locking to get it thread safe via synchronized {}... With polling no synchronization is necessary and therefor faster (as said, only an assumption)...
Logged
Chuck
Newbie
Posts: 42
aka sproingie on freenode
Re: Use LWJGL and Graphics2D
«
Reply #3 on:
September 25, 2011, 11:17:55 »
LWJGL's polling is synchronized too, but the locks disappear in a single-threaded app (which any swing app is unlikely to be). I think you'll find just about anything is faster than AWT's input handling though, so JInput should be way more than fast enough.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Programming
-----------------------------
=> Lightweight Java Library Game Development
=> LWJGL Documentation
=> Bug Reports / RFE
=> OpenGL
=> OpenAL
=> General Java Game Development
-----------------------------
Archive
-----------------------------
=> Resolved Bugs/RFE
=> DirectX
=> DevIL
=> FMOD
Loading...