Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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  
  Some doubts in LWJGL  (Read 538 times)
0 Members and 1 Guest are viewing this topic.
Offline SHC
« Posted 2013-07-05 15:28:21 »

Hello guys. Now I'm converting my java 2d based game engine to use lwjgl and I've ran into some doubts.

  • How can I embed the natives into the JAR file of my library jar?
  • How to convert
    KeyEvent
    constants to LWJGL?

Thanks.

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 75
Projects: 15


★★★★★


« Reply #1 - Posted 2013-07-05 15:54:29 »

How can I embed the natives into the JAR file of my library jar?
There are a few tools that will allow you to do this like JarSplice, OneJar, etc.

How to convert
KeyEvent
constants to LWJGL?
You can't convert them since they are for a different toolkit, you can however use the LWJGL's own key codes as listed here (technically if you really must use AWT key codes then you could create a wrapper class that maps them to the equivalent LWJGL key codes).

I would also recommend that you have a read of the input tutorial found on the wiki here.
Offline bilznatch

Senior Member


Medals: 8
Projects: 2
Exp: 1 year


I'm bad, I'm bad, I'm really... really bad T_T


« Reply #2 - Posted 2013-07-06 04:20:25 »

Or you can go yet another step further and get slick, and use it's keyboard function, which names all the keys right out.
it looks sorta like:
1  
Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)

and its mouse code looks like:
1  
Mouse.isButtonDown(0)

and you can use
1  
Mouse.getX()
and
1  
Mouse.getY()
for mouse coordinates.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline NegativeZero

JGO Knight


Medals: 30
Projects: 2
Exp: 3 years


Zero but not.


« Reply #3 - Posted 2013-07-06 06:03:01 »

Or you can go yet another step further and get slick, and use it's keyboard function, which names all the keys right out.
it looks sorta like:
1  
Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)

and its mouse code looks like:
1  
Mouse.isButtonDown(0)

and you can use
1  
Mouse.getX()
and
1  
Mouse.getY()
for mouse coordinates.

That's also how LWJGL does it.
That code was inherited from LWJGL, not built into Slick.

Also, Slick is being phased out, as it seems to not be dev'd for anymore. It seems to be that people who are using it in their existing projects are staying with it, but starting a new project with it at this point in time doesn't sound to be the best of ideas.
Offline tyeeeee1
« Reply #4 - Posted 2013-07-06 14:56:51 »

Just use "Gdx.input." for keys, mouse positions, etc... It's worked for everything I've done but I haven't been able to figure out how to use the mouse wheel with it.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #5 - Posted 2013-07-06 16:47:52 »

Just use "Gdx.input." for keys, mouse positions, etc... It's worked for everything I've done but I haven't been able to figure out how to use the mouse wheel with it.
That's LibGDX Pointing
Offline tyeeeee1
« Reply #6 - Posted 2013-07-06 17:14:44 »

Just use "Gdx.input." for keys, mouse positions, etc... It's worked for everything I've done but I haven't been able to figure out how to use the mouse wheel with it.
That's LibGDX Pointing

Oh derp... I always mix those two up. >.<
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (13 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (44 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org 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‑gaming.org
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!