1 /* bzflag
2 * Copyright (c) 1993-2021 Tim Riker
3 *
4 * This package is free software; you can redistribute it and/or
5 * modify it under the terms of the license found in the file
6 * named COPYING that should have accompanied this file.
7 *
8 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 */
12
13 // Own include
14 #include "SDL2Visual.h"
15
setDoubleBuffer(bool on)16 void SDLVisual::setDoubleBuffer(bool on)
17 {
18 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, on ? 1 : 0);
19 }
20
setRGBA(int minRed,int minGreen,int minBlue,int minAlpha)21 void SDLVisual::setRGBA(int minRed, int minGreen,
22 int minBlue, int minAlpha)
23 {
24 SDL_GL_SetAttribute(SDL_GL_RED_SIZE, minRed);
25 SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, minGreen);
26 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, minBlue);
27 SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, minAlpha);
28 }
29
setDepth(int minDepth)30 void SDLVisual::setDepth(int minDepth)
31 {
32 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, minDepth);
33 }
34
setStencil(int minDepth)35 void SDLVisual::setStencil(int minDepth)
36 {
37 SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, minDepth);
38 }
39
setStereo(bool on)40 void SDLVisual::setStereo(bool on)
41 {
42 SDL_GL_SetAttribute(SDL_GL_STEREO, on ? 1 : 0);
43 }
44
45 // Local Variables: ***
46 // mode: C++ ***
47 // tab-width: 4 ***
48 // c-basic-offset: 4 ***
49 // indent-tabs-mode: nil ***
50 // End: ***
51 // ex: shiftwidth=4 tabstop=4
52