Descent3/2dlib/screen.cpp

74 lines
2.1 KiB
C++
Raw Normal View History

/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2024-04-16 03:43:29 +00:00
/*
* $Logfile: /descent3/main/2dlib/screen.cpp $
* $Revision: 12 $
* $Date: 6/16/97 5:16p $
* $Author: Jason $
*
* Screen creation class
*
* $Log: /descent3/main/2dlib/screen.cpp $
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 12 6/16/97 5:16p Jason
* added renderer.h header
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 11 6/16/97 4:52p Samir
* If a renderer, then call rendflip instead.
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 10 6/13/97 3:00p Samir
* Only flip if screen has a backbuffer.
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 9 6/12/97 6:29p Samir
* DDGR v2.0 Changes in 2d system implemented.
2024-04-16 18:56:40 +00:00
*
2024-04-16 03:43:29 +00:00
* 8 1/30/97 6:01p Samir
* The partition of memory and os surfaces as well as the change in
* ddgr_surface structure and all related changes.
*
* $NoKeywords: $
*/
#include <string.h>
#include "gr.h"
#include "pserror.h"
#include "renderer.h"
// ---------------------------------------------------------------------------
// grSurface constructor and destructor
// ---------------------------------------------------------------------------
grScreen::grScreen(int w, int h, int bpp, const char *name)
2024-04-16 18:56:40 +00:00
: grSurface(w, h, bpp, SURFTYPE_VIDEOSCREEN, SURFFLAG_BACKBUFFER, name) {}
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
grScreen::~grScreen() {}
2024-04-16 03:43:29 +00:00
// ---------------------------------------------------------------------------
// screen refresh routines
// ---------------------------------------------------------------------------
2024-04-16 18:56:40 +00:00
void grScreen::flip() {
ASSERT(surf_init());
if (ddsfObj.flags & SURFFLAG_BACKBUFFER)
ddgr_surf_FlipVideo(&ddsfObj);
else if (ddsfObj.flags & SURFFLAG_RENDERER)
rend_Flip();
2024-04-16 03:43:29 +00:00
}