DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
include/render.h
00001 /*
00002  *  Copyright (C) 2002-2015  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef DOSBOX_RENDER_H
00020 #define DOSBOX_RENDER_H
00021 
00022 // 0: complex scalers off, scaler cache off, some simple scalers off, memory requirements reduced
00023 // 1: complex scalers off, scaler cache off, all simple scalers on
00024 // 2: complex scalers off, scaler cache on
00025 // 3: complex scalers on
00026 #define RENDER_USE_ADVANCED_SCALERS 3
00027 
00028 #include "../src/gui/render_scalers.h"
00029 
00030 #define RENDER_SKIP_CACHE       16
00031 //Enable this for scalers to support 0 input for empty lines
00032 //#define RENDER_NULL_INPUT
00033 
00034 enum SCREEN_TYPES {
00035         SCREEN_SURFACE,
00036         SCREEN_OPENGL,
00037         SCREEN_DIRECT3D
00038 };
00039 
00040 typedef struct {
00041         struct { 
00042                 Bit8u red;
00043                 Bit8u green;
00044                 Bit8u blue;
00045                 Bit8u unused;
00046         } rgb[256];
00047         union {
00048                 Bit16u b16[256];
00049                 Bit32u b32[256];
00050         } lut;
00051         bool changed;
00052         Bit8u modified[256];
00053         Bitu first;
00054         Bitu last;
00055 } RenderPal_t;
00056 
00057 typedef struct {
00058         struct {
00059                 Bitu width, start;
00060                 Bitu height;
00061                 Bitu bpp;
00062                 bool dblw,dblh;
00063                 double ratio;
00064                 float fps;
00065                 double scrn_ratio;
00066         } src;
00067         struct {
00068                 Bitu count;
00069                 Bitu max;
00070                 Bitu index;
00071                 Bit8u hadSkip[RENDER_SKIP_CACHE];
00072         } frameskip;
00073         struct {
00074                 Bitu size;
00075                 scalerMode_t inMode;
00076                 scalerMode_t outMode;
00077                 scalerOperation_t op;
00078                 bool clearCache;
00079                 bool forced;
00080                 bool hardware;
00081                 ScalerLineHandler_t lineHandler;
00082                 ScalerLineHandler_t linePalHandler;
00083                 ScalerComplexHandler_t complexHandler;
00084                 Bitu blocks, lastBlock;
00085                 Bitu outPitch;
00086                 Bit8u *outWrite;
00087                 Bitu cachePitch;
00088                 Bit8u *cacheRead;
00089                 Bitu inHeight, inLine, outLine;
00090         } scale;
00091         RenderPal_t pal;
00092         bool updating;
00093         bool active;
00094         bool aspect;
00095         bool fullFrame;
00096         bool forceUpdate;
00097         bool autofit;
00098 } Render_t;
00099 
00100 extern Render_t render;
00101 extern Bitu last_gfx_flags;
00102 extern ScalerLineHandler_t RENDER_DrawLine;
00103 void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double scrn_ratio);
00104 bool RENDER_StartUpdate(void);
00105 void RENDER_EndUpdate(bool abort);
00106 void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue);
00107 
00108 
00109 #endif