| 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"cxx . . $ `<file>/2dlib/gr.h`/ |
| 49 | #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/ |
| 50 | #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/ |
| 51 | |
| 52 | // --------------------------------------------------------------------------- |
| 53 | // grSurface constructor and destructor |
| 54 | // --------------------------------------------------------------------------- |
| 55 | |
| 56 | grScreencxx . . $ grScreen#::grScreencxx . . $ grScreen#grScreen(a29fdc847efe61dd).(int w, int h, int bpp, const char *name) |
| 57 | : grSurfacecxx . . $ grSurface#grSurface(589a245ae52835fb).(w, h, bpp, SURFTYPE_VIDEOSCREENcxx . . $ SURFTYPE_VIDEOSCREEN., SURFFLAG_BACKBUFFERcxx . . $ SURFFLAG_BACKBUFFER., name) {} |
| 58 | |
| 59 | grScreencxx . . $ grScreen#::~cxx . . $ grScreen#`~grScreen`(ced63f7c635d850d).grScreencxx . . $ grScreen#() {} |
| 60 | |
| 61 | // --------------------------------------------------------------------------- |
| 62 | // screen refresh routines |
| 63 | // --------------------------------------------------------------------------- |
| 64 | |
| 65 | void grScreencxx . . $ grScreen#::flipcxx . . $ grScreen#flip(49f6e7a06ebc5aa8).() { |
| 66 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(surf_init()); |
| 67 | if (ddsfObjcxx . . $ grSurface#ddsfObj..flagscxx . . $ ddgr_surface#flags. & SURFFLAG_BACKBUFFERcxx . . $ SURFFLAG_BACKBUFFER.) |
| 68 | ddgr_surf_FlipVideocxx . . $ ddgr_surf_FlipVideo(8a7e7c096868029c).(&ddsfObjcxx . . $ grSurface#ddsfObj.); |
| 69 | else if (ddsfObjcxx . . $ grSurface#ddsfObj..flagscxx . . $ ddgr_surface#flags. & SURFFLAG_RENDERERcxx . . $ SURFFLAG_RENDERER.) |
| 70 | rend_Flipcxx . . $ rend_Flip(49f6e7a06ebc5aa8).(); |
| 71 | } |