+void wait_vsync(void)
+{
+ unsigned long start = SDL_GetTicks();
+ unsigned long until = (start | 0xf) + 1;
+ while(SDL_GetTicks() <= until);
+}
+
+void swap_buffers(void *pixels)
+{
+ /* do nothing, all pointers point to the same buffer */
+ if(opt.vsync) {
+ wait_vsync();
+ }
+}
+
+static int bnmask(int sdlbn)
+{
+ switch(sdlbn) {
+ case SDL_BUTTON_LEFT:
+ return MOUSE_BN_LEFT;
+ case SDL_BUTTON_RIGHT:
+ return MOUSE_BN_RIGHT;
+ case SDL_BUTTON_MIDDLE:
+ return MOUSE_BN_MIDDLE;
+ default:
+ break;
+ }
+ return 0;
+}
+