diff options
author | dscho <dscho> | 2005-03-06 19:09:28 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-03-06 19:09:28 +0000 |
commit | a20d0817efe5fa169339372aa365e6fd2cd29faa (patch) | |
tree | e7fb6a3d97dd61c326eb7c2c9b9571e938e776ee /client_examples/SDLvncviewer.c | |
parent | 4301cdf1dfeac17224c15bfdfe4b43c1933ff316 (diff) | |
download | libtdevnc-a20d0817efe5fa169339372aa365e6fd2cd29faa.tar.gz libtdevnc-a20d0817efe5fa169339372aa365e6fd2cd29faa.zip |
fix for older SDL versions
Diffstat (limited to 'client_examples/SDLvncviewer.c')
-rw-r--r-- | client_examples/SDLvncviewer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client_examples/SDLvncviewer.c b/client_examples/SDLvncviewer.c index 9bfb1c9..f94fda7 100644 --- a/client_examples/SDLvncviewer.c +++ b/client_examples/SDLvncviewer.c @@ -3,7 +3,11 @@ static rfbBool resize(rfbClient* client) { static char first=TRUE; +#ifdef SDL_ASYNCBLIT int flags=SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL; +#else + int flags=SDL_HWSURFACE|SDL_HWACCEL; +#endif int width=client->width,height=client->height, depth=client->format.bitsPerPixel; rfbBool okay=SDL_VideoModeOK(width,height,depth,flags); @@ -250,17 +254,19 @@ int main(int argc,char** argv) { while(1) { if(SDL_PollEvent(&e)) switch(e.type) { +#if SDL_MAJOR_VERSION>1 || SDL_MINOR_VERSION>=2 case SDL_VIDEOEXPOSE: SendFramebufferUpdateRequest(cl,0,0,cl->width,cl->height,FALSE); break; +#endif case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEMOTION: { int x,y; int state=SDL_GetMouseState(&x,&y); struct { int sdl; int rfb; } buttonMapping[]={ - {SDL_BUTTON_LEFT, rfbButton1Mask}, - {SDL_BUTTON_RIGHT, rfbButton2Mask}, - {SDL_BUTTON_MIDDLE, rfbButton3Mask}, + {1, rfbButton1Mask}, + {3, rfbButton2Mask}, + {2, rfbButton3Mask}, {0,0} }; int i; |