Use SDL_GL_SWAP_CONTROL for vertical sync
[neverball] / share / sync.c
1 /*
2  * Copyright (C) 2003 Robert Kooima
3  *
4  * NEVERBALL is  free software; you can redistribute  it and/or modify
5  * it under the  terms of the GNU General  Public License as published
6  * by the Free  Software Foundation; either version 2  of the License,
7  * or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
11  * MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
12  * General Public License for more details.
13  */
14
15 /*---------------------------------------------------------------------------*/
16
17 #ifdef __APPLE__
18 #include <OpenGL/OpenGL.h>
19 #endif
20
21 void sync_init(void)
22 {
23 #ifdef __APPLE__
24     long swap = 1;
25     CGLSetParameter(CGLGetCurrentContext(),  kCGLCPSwapInterval, &swap);
26 #endif
27     return;
28 }
29
30 /*---------------------------------------------------------------------------*/