Jump to content


Photo

Tablet Dll


  • Please log in to reply
34 replies to this topic

#1 npc3232

npc3232

    GMC Member

  • GMC Member
  • 125 posts
  • Version:Unknown

Posted 12 October 2007 - 03:32 AM

This is simple dll based off of the code from here. It reads the data from the pen/touch tablet, such as pressure, xyz, etc. It should be compatible with most or all tablets, although some may not output data for all functions. I will probably add more features later on but the following are the current functions:
tabletInitDLL
tabletInit
tabletUpdate
tabletId
tabletType
tabletButtons
tabletX
tabletY
tabletZ
tabletPressure
tabletTpressure
Download (52kbyte) - fixed Oct 08, 2008

Edited by npc3232, 29 December 2011 - 12:26 AM.

  • 0

#2 dark_master4

dark_master4

    GMC Member

  • GMC Member
  • 1176 posts
  • Version:GM:Studio

Posted 12 October 2007 - 06:32 AM

OMGOMGOMGOMGOMGOMGOMGOMGOMGOMGOMGOMGOMG YOU'RE MY SAVIOR! I didn't think you could do that OMG I'm just amazed!! YOU are the best!!

Are you a girl or a guy? If you're a girl, I hug you and kiss you everywhere!!! If you're a guy well, I hug you and kiss you on the cheeks!! You... You're my new best friend! :GM044:

As I decided to go commercial, I find it pretty outraging since you did the MIDI DLL and the tablet DLL... I must give you credit and if I get to a finished product and really want to sell it, part of the profits too.

Keep up the excelent work!!

OMG I just tried the example even though it's only numbers it makes me all excited!

Guys reading this, npc3232 is my idol! Try this DLL and use it for every drawing applications or anything that requires mouse control!


...Awsome...

[edit]
You're CRAZY!

[edit2]
Question ;) What are the following functions for exactly? {tabletId, tabletType, tabletButtons, tabletTPressure}

Suggestion: tabletUpdate stores the {x,y,z,pressure} to local variables {tablet_x,tablet_y,tablet_z,tablet_pressure} to dodge excessive DLL calls. I read somewhere that Wintab API calls are CPU expensive. I'm not sure about tpressure so I didn't mention it.

[edit3]
Oh wait, tpressure is tangeant pressure! ... But I still don't know what it's for.. Lol!

Edited by dark_master4, 12 October 2007 - 09:08 AM.

  • 0

#3 zedman1000

zedman1000

    GMC Member

  • New Member
  • 715 posts

Posted 12 October 2007 - 06:50 AM

*Gets sedative for dark_master4 ready*
  • 1

#4 dark_master4

dark_master4

    GMC Member

  • GMC Member
  • 1176 posts
  • Version:GM:Studio

Posted 12 October 2007 - 06:59 AM

You won't get meeeeeeeee!! *Runs as fast as he can...*

*Zedman1000 receives a phone call* YOU'LL NEVER FIND ME!! *click*

Hey npc3232! I found a glitch and a work around! :GM046: When I try to update the pressure at a room_speed of 100, it returns 0 once every half step. I worked around updating it only 50 times per second even at room_speed of 100 so it's ok!

You're sick! ;)

[edit]
Oh BTW I'm done implementing the DLL in my engine! Now the only thing that's needed is an GUI! You've made my day! No wait... My year!! And maybe a couple of Eclipse's shows! :GM023: If not all :GM044:

Edited by dark_master4, 12 October 2007 - 07:01 AM.

  • 0

#5 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 12 October 2007 - 08:01 AM

hahaha dark_master4 calm down!

Heya, I was actually going to wrap one lib I had found and make a similar dll, (it actually had more functions like getting the tilt and eraser feel) well it seems that'll save me the work. ;) Going to test on my home computer with my tablet.

Edited by Sindarin, 12 October 2007 - 08:28 AM.

  • 0

#6 zephroelectro

zephroelectro

    GMC Member

  • New Member
  • 265 posts

Posted 12 October 2007 - 02:25 PM

heck that was a fast DLL release O.O
  • 0

#7 npc3232

npc3232

    GMC Member

  • GMC Member
  • 125 posts
  • Version:Unknown

Posted 12 October 2007 - 05:57 PM

dark_master4: Your excitement is a little over the top. You don't have to pay me anything for the dlls, and I am male, to answer your question. Honestly, I do not know the exact user of this data ("tabletId, tabletType, tabletButtons, tabletTPressure"), but I figured I would add them anyway as someone may want them. As for that little glitch that you are finding, it is not related to the work-arround, it is an issue that the data isn't updated by the hardware as fast you are checking. I tested it, and it seams that it is update 60 times per second, or most likely the monitors refresh rate. The work-around fixes an issue where the tablet data isn't read once the game loses focus, the only side-effect of this, is the first click from the tablet may be ignored after the window regains focus. The performance of the dll is not bad when called 30 times a second (<2% cpu). The dll updates variables when you call the tabletUpdate, and the other functions simply return the data.

Sindarin: The lib I'm using supports most of this I think. I will try to implement those things for the next version.

Edited by npc3232, 12 October 2007 - 05:57 PM.

  • 1

#8 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 12 October 2007 - 06:56 PM

Wht the bloody hell it doesn't work.
Its throws an error :- 'unable to defie external functions'
even though I checked for the file names..
  • 0

#9 npc3232

npc3232

    GMC Member

  • GMC Member
  • 125 posts
  • Version:Unknown

Posted 12 October 2007 - 07:30 PM

Please tell me your system specs. Like I warned, you need windows 2000 or better with .net framework 2.0 installed; this is the most common issue with VC2005 binaries. I am currently unable to compile the dll with mingw, but I will look for the required libraries.

Edited by npc3232, 12 October 2007 - 07:31 PM.

  • 0

#10 Rixeno

Rixeno

    The One 'n' Only

  • New Member
  • 513 posts

Posted 12 October 2007 - 07:36 PM

The download link didn't work for me :angry:, I don't have a tablet but I'd like to try it, can you post a mirror?
  • 0

#11 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 12 October 2007 - 08:27 PM

Please tell me your system specs. Like I warned, you need windows 2000 or better with .net framework 2.0 installed; this is the most common issue with VC2005 binaries. I am currently unable to compile the dll with mingw, but I will look for the required libraries.

<{POST_SNAPBACK}>


I have windows XP SP-2, .net framework 2.0 installed.
  • 0

#12 dark_master4

dark_master4

    GMC Member

  • GMC Member
  • 1176 posts
  • Version:GM:Studio

Posted 12 October 2007 - 09:17 PM

Rixeno: You can implement it without having a tablet, but if you don't, you won't be able to test the functionnalities you can get with it. Pressure, tangeant pressure (Still don't know what it's for), z position (distance from pen to tablet). Also, the origin when calling the [x,y] positions of the tablet (Which aren't the same as the mouse_x/y) have their origin placed at bottom left and range from 0 to 1 (1 being top or right).

ID I believe is the recorded ID the tablet sends when you connect it. Usually it would change per fabricant, but there's no enforcement that keeps one from putting Wacom there even if it's not a Wacom. Same thing for type.

Buttons I guess would be the number of buttons on the pen &| tablet.
  • 0

#13 npc3232

npc3232

    GMC Member

  • GMC Member
  • 125 posts
  • Version:Unknown

Posted 12 October 2007 - 10:03 PM

I have recompiled the dll with mingw, it should run on windows 98+. Download (52kbyte)


Freko: I don't know what the problem is exactly but now it should work now.

Rixeno: The link is fixed (mediafire likes changing things), I'll make a mirror soon though.
  • 0

#14 dark_master4

dark_master4

    GMC Member

  • GMC Member
  • 1176 posts
  • Version:GM:Studio

Posted 12 October 2007 - 10:13 PM

Great! No more .NET 2.0 boundary! You're the best.
  • 0

#15 Obiki_San

Obiki_San

    GMC Member

  • New Member
  • 136 posts

Posted 13 October 2007 - 03:49 AM

I didn't exactly try it, but I could see this as good use for a GM Nintendo DS clone. I should try that one day :angry:
  • 0

#16 Ruud v A

Ruud v A

    Games programmer

  • New Member
  • 417 posts

Posted 13 October 2007 - 11:02 AM

Wow, this is great :D

I have an Intuos3, which supports an eraser too, by turning your pen up-side-down. Is there a way to detect if the user is using the pen or eraser?

Great DLL :huh:.
  • 0

#17 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 13 October 2007 - 11:47 AM

Worked for my wacom tablet. :D
  • 0

#18 npc3232

npc3232

    GMC Member

  • GMC Member
  • 125 posts
  • Version:Unknown

Posted 13 October 2007 - 04:27 PM

It seems that the dll already supports the eraser/pen tips, and also gives a different reading for the mouse if included. Add the following line in the example's draw event and you'll see what i mean.
draw_text(0,48,"Press Type: "+string(tabletType()));

It would be useful for the gm nds clone, but if the clone wrapped Palib it would be even more useful.

Edited by npc3232, 13 October 2007 - 04:29 PM.

  • 0

#19 Ruud v A

Ruud v A

    Games programmer

  • New Member
  • 417 posts

Posted 13 October 2007 - 07:03 PM

I tried that myself already, but I didn't notice that :D
Great dll :huh:
  • 0

#20 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 21 October 2007 - 07:38 AM

Great one!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users