DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
include/video.h
00001 /*
00002  *  Copyright (C) 2002-2020  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 along
00015  *  with this program; if not, write to the Free Software Foundation, Inc.,
00016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 
00020 #ifndef DOSBOX_VIDEO_H
00021 #define DOSBOX_VIDEO_H
00022 
00023 #define REDUCE_JOYSTICK_POLLING
00024 
00025 typedef enum {
00026         GFX_CallBackReset,
00027         GFX_CallBackStop,
00028         GFX_CallBackRedraw
00029 } GFX_CallBackFunctions_t;
00030 
00031 typedef void (*GFX_CallBack_t)( GFX_CallBackFunctions_t function );
00032 
00033 struct GFX_PalEntry {
00034         Bit8u r;
00035         Bit8u g;
00036         Bit8u b;
00037         Bit8u unused;
00038 };
00039 
00040 #define GFX_CAN_8               0x0001u
00041 #define GFX_CAN_15              0x0002u
00042 #define GFX_CAN_16              0x0004u
00043 #define GFX_CAN_32              0x0008u
00044 
00045 #define GFX_LOVE_8              0x0010u
00046 #define GFX_LOVE_15             0x0020u
00047 #define GFX_LOVE_16             0x0040u
00048 #define GFX_LOVE_32             0x0080u
00049 
00050 #define GFX_RGBONLY             0x0100u
00051 
00052 #define GFX_SCALING             0x1000u
00053 #define GFX_HARDWARE    0x2000u
00054 
00055 #define GFX_CAN_RANDOM  0x4000u         //If the interface can also do random access surface
00056 
00057 void GFX_Events(void);
00058 void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries);
00059 Bitu GFX_GetBestMode(Bitu flags);
00060 Bitu GFX_GetRGB(Bit8u red,Bit8u green,Bit8u blue);
00061 Bitu GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,GFX_CallBack_t callback);
00062 void GFX_TearDown(void);
00063 
00064 void GFX_ResetScreen(void);
00065 void GFX_RestoreMode(void);
00066 void GFX_Start(void);
00067 void GFX_Stop(void);
00068 void GFX_SwitchFullScreen(void);
00069 bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch);
00070 void GFX_EndUpdate( const Bit16u *changedLines );
00071 void GFX_GetSize(int &width, int &height, bool &fullscreen);
00072 void GFX_LosingFocus(void);
00073 
00074 bool GFX_IsFullscreen(void);
00075 void GFX_SwitchLazyFullscreen(bool lazy);
00076 bool GFX_LazyFullscreenRequested(void);
00077 void GFX_SwitchFullscreenNoReset(void);
00078 void GFX_RestoreMode(void);
00079 void GFX_UpdateSDLCaptureState(void);
00080 
00081 #if defined (WIN32)
00082 bool GFX_SDLUsingWinDIB(void);
00083 #endif
00084 
00085 #if defined (REDUCE_JOYSTICK_POLLING)
00086 void MAPPER_UpdateJoysticks(void);
00087 #endif
00088 
00089 /* Mouse related */
00091 void GFX_CaptureMouse(void);
00093 void GFX_CaptureMouse(bool capture);
00095 void CaptureMouseNotify();
00097 void CaptureMouseNotify(bool capture);
00098 extern bool mouselocked; //true if mouse is confined to window
00099 
00100 #endif