Debian Codegraph @

2dlib/screen.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /descent3/main/2dlib/screen.cpp $
21 * $Revision: 12 $
22 * $Date: 6/16/97 5:16p $
23 * $Author: Jason $
24 *
25 * Screen creation class
26 *
27 * $Log: /descent3/main/2dlib/screen.cpp $
28 *
29 * 12 6/16/97 5:16p Jason
30 * added renderer.h header
31 *
32 * 11 6/16/97 4:52p Samir
33 * If a renderer, then call rendflip instead.
34 *
35 * 10 6/13/97 3:00p Samir
36 * Only flip if screen has a backbuffer.
37 *
38 * 9 6/12/97 6:29p Samir
39 * DDGR v2.0 Changes in 2d system implemented.
40 *
41 * 8 1/30/97 6:01p Samir
42 * The partition of memory and os surfaces as well as the change in
43 * ddgr_surface structure and all related changes.
44 *
45 * $NoKeywords: $
46 */
47
48 #include "gr.h"
49 #include "pserror.h"
50 #include "renderer.h"
51
52 // ---------------------------------------------------------------------------
53 // grSurface constructor and destructor
54 // ---------------------------------------------------------------------------
55
56 grScreen::grScreen(int w, int h, int bpp, const char *name)
57 : grSurface(w, h, bpp, SURFTYPE_VIDEOSCREEN, SURFFLAG_BACKBUFFER, name) {}
58
59 grScreen::~grScreen() {}
60
61 // ---------------------------------------------------------------------------
62 // screen refresh routines
63 // ---------------------------------------------------------------------------
64
65 void grScreen::flip() {
66 ASSERT(surf_init());
67 if (ddsfObj.flags & SURFFLAG_BACKBUFFER)
68 ddgr_surf_FlipVideo(&ddsfObj);
69 else if (ddsfObj.flags & SURFFLAG_RENDERER)
70 rend_Flip();
71 }