From ba7155add818096030b773de442da0513ce54773 Mon Sep 17 00:00:00 2001 From: Szymon Wilczek Date: Wed, 27 Aug 2008 13:37:19 +0000 Subject: [PATCH] Many mouse and tablet linux test file added --- test/Makefile.in | 4 ++- test/testmmousetablet.c | 60 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 test/testmmousetablet.c diff --git a/test/Makefile.in b/test/Makefile.in index 723ee65cf..23ded53f3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -7,7 +7,7 @@ EXE = @EXE@ CFLAGS = @CFLAGS@ LIBS = @LIBS@ -TARGETS = checkkeys$(EXE) graywin$(EXE) loopwave$(EXE) testaudioinfo$(EXE) testmultiaudio$(EXE) testalpha$(EXE) testbitmap$(EXE) testblitspeed$(EXE) testcdrom$(EXE) testcursor$(EXE) testdyngl$(EXE) testerror$(EXE) testfile$(EXE) testgamma$(EXE) testgl$(EXE) testgl2$(EXE) testhread$(EXE) testiconv$(EXE) testjoystick$(EXE) testkeys$(EXE) testlock$(EXE) testoverlay2$(EXE) testoverlay$(EXE) testpalette$(EXE) testplatform$(EXE) testsem$(EXE) testsprite$(EXE) testsprite2$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm$(EXE) testwm2$(EXE) threadwin$(EXE) torturethread$(EXE) testloadso$(EXE) testhaptic$(EXE) +TARGETS = checkkeys$(EXE) graywin$(EXE) loopwave$(EXE) testaudioinfo$(EXE) testmultiaudio$(EXE) testalpha$(EXE) testbitmap$(EXE) testblitspeed$(EXE) testcdrom$(EXE) testcursor$(EXE) testdyngl$(EXE) testerror$(EXE) testfile$(EXE) testgamma$(EXE) testgl$(EXE) testgl2$(EXE) testhread$(EXE) testiconv$(EXE) testjoystick$(EXE) testkeys$(EXE) testlock$(EXE) testoverlay2$(EXE) testoverlay$(EXE) testpalette$(EXE) testplatform$(EXE) testsem$(EXE) testsprite$(EXE) testsprite2$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm$(EXE) testwm2$(EXE) threadwin$(EXE) torturethread$(EXE) testloadso$(EXE) testhaptic$(EXE) testmmousetablet$(EXE) all: Makefile $(TARGETS) @@ -128,6 +128,8 @@ testloadso$(EXE): $(srcdir)/testloadso.c testhaptic$(EXE): $(srcdir)/testhaptic.c $(CC) -o $@ $? $(CFLAGS) $(LIBS) +testmmousetablet$(EXE): $(srcdir)/testmmousetablet.c + $(CC) -o $@ $? $(CFLAGS) $(LIBS) clean: rm -f $(TARGETS) diff --git a/test/testmmousetablet.c b/test/testmmousetablet.c new file mode 100644 index 000000000..0cc70f3b6 --- /dev/null +++ b/test/testmmousetablet.c @@ -0,0 +1,60 @@ +#include +#include "SDL.h" + +SDL_Surface* screen; +int quit=0; + +int main() +{ + SDL_Event event; + int mice; + int i; + printf("Initing...\n"); + if (SDL_Init(0)!=0) { + return 1; + } + if (SDL_InitSubSystem(SDL_INIT_VIDEO)!=0) { + return 1; + } + else { + screen = SDL_SetVideoMode(640, 480, 32, SDL_DOUBLEBUF); + } + mice = SDL_GetNumMice(); + printf("%d pointing devices found\n", mice); + for(i=0; i