Descent3/2dlib/screen.cpp

56 lines
1.4 KiB
C++
Raw Normal View History

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
}