Author Topic: Using Mouse  (Read 5164 times)

Offline bigfishcatcher

  • byte
  • *
  • Posts: 17
    • View Profile
Using Mouse
« on: December 12, 2006, 02:19:58 am »
I was experimenting with FPS example and would like to add mouse movements to it.  Can it be done using only jpct or do you also have to use lwjgl also how do you do it.

Thanks
Nubee

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
    • http://www.iro.umontreal.ca/~blanchae
Using Mouse
« Reply #1 on: December 12, 2006, 10:11:35 am »
Hello, according to Egon, there is a mouse mapper in the paradroidz source code

http://www.jpct.net/forum/viewtopic.php?t=563&highlight=mousemapper

You should be able to do what you want wuith it.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Using Mouse
« Reply #2 on: December 12, 2006, 06:19:42 pm »
Yeah, especially if usingOGL render, using the common java MouseListeners is not a god idea, the results are awfull. In fact lwjgl comes with a Mouse class that can be used to do a MouseMapper like Egod did in paradroids.
Nada por ahora

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Using Mouse
« Reply #3 on: December 17, 2006, 11:18:26 am »
BTW: can I use a MouseMotionListener with OpenGL?

I guess no, but I dont want to create a MouseMapper and I just need the getX and getY methods, not so sophisticated, just to pick an object, nothing else!
Nada por ahora

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Using Mouse
« Reply #4 on: December 17, 2006, 11:23:28 am »
I declared a Mouse, then just used getDX() and getDY().

Do I need to use the Mouse constructor?
Nada por ahora

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Using Mouse
« Reply #5 on: December 17, 2006, 11:28:30 am »
I am making lot of spam, but I cant delete my dumb posts.

Anyway to use a Mouse Listener on OGL just declare a Mouse ej:Mouse M;. Mouse is class of lwjgl, then you can acces the Mouse methods like getX () or getDX () to get the movement, and things like that!
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Using Mouse
« Reply #6 on: December 17, 2006, 02:12:46 pm »
Yeah, Mouse is quite simple to use. The purpose of the MouseMapper was to offer the same functionality for all renderers, but if that isn't needed, Mouse itself is sufficient.