Sdl Touchscreen Broken?


GernotFrisch

Member
Joined
Jan 2, 2007
Messages
445
Hi,

my code worked quite good until the other day. I have no idea why. Maybe the firmware upgrade.
Does anyone use SDL touchscreen on the Wiz? If it works, how do you initialize the screen and the input?
 
I use it in Blix2x, as a mouse:

Code:
// setup

int mouseX;
int mouseY;
int mouseTap;

SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER | SDL_INIT_AUDIO);
SDL_Surface* screen = SDL_SetVideoMode(320, 240, 16, SDL_SWSURFACE);

// called every game loop

SDL_Event event;
mouseTap = 0;

while(SDL_PollEvent(&event)) {
    switch(event.type) {
        case SDL_MOUSEMOTION:
            mouseX = event.button.x;
            mouseY = event.button.y;
        break;

        case SDL_MOUSEBUTTONDOWN:
            switch(event.button.button) {
                case SDL_BUTTON_LEFT:
                    mouseTap = 1;
                    mouseX = event.button.x;
                    mouseY = event.button.y;
                break;
            }
        break;

        case SDL_MOUSEBUTTONUP:
            switch(event.button.button) {
                case SDL_BUTTON_LEFT:
                    mouseX = event.button.x;
                    mouseY = event.button.y;
                break;
            }
        break;
    }
}

It seems to work fine with firmware 1.1.
 
Back
Top