Odamex
Setting the Standard in Multiplayer Doom
client/sdl/hardware.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*- 
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: hardware.h 1999 2010-11-20 01:17:17Z hypereye $
00005 //
00006 // Copyright (C) 2006-2010 by The Odamex Team.
00007 //
00008 // This program is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU General Public License
00010 // as published by the Free Software Foundation; either version 2
00011 // of the License, or (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // DESCRIPTION:
00019 //      SDL hardware access for Video Rendering (?)
00020 //
00021 //-----------------------------------------------------------------------------
00022 
00023 
00024 #ifndef __HARDWARE_H__
00025 #define __HARDWARE_H__
00026 
00027 #include "i_video.h"
00028 
00029 class IVideo
00030 {
00031  public:
00032         virtual ~IVideo () {}
00033 
00034         virtual std::string GetVideoDriverName();
00035 
00036         virtual EDisplayType GetDisplayType ();
00037         virtual bool FullscreenChanged (bool fs);
00038         virtual void SetWindowedScale (float scale);
00039         virtual bool CanBlit ();
00040 
00041         virtual bool SetOverscan (float scale);
00042 
00043         virtual bool SetMode (int width, int height, int bits, bool fs);
00044         virtual void SetPalette (DWORD *palette);
00045         
00046         /* 12/3/06: HACK - Add SetOldPalette to accomodate classic redscreen - ML*/
00047         virtual void SetOldPalette (byte *doompalette);
00048                 
00049         virtual void UpdateScreen (DCanvas *canvas);
00050         virtual void ReadScreen (byte *block);
00051 
00052         virtual int GetModeCount ();
00053         virtual void StartModeIterator (int bits);
00054         virtual bool NextMode (int *width, int *height);
00055 
00056         virtual DCanvas *AllocateSurface (int width, int height, int bits, bool primary = false);
00057         virtual void ReleaseSurface (DCanvas *scrn);
00058         virtual void LockSurface (DCanvas *scrn);
00059         virtual void UnlockSurface (DCanvas *scrn);
00060         virtual bool Blit (DCanvas *src, int sx, int sy, int sw, int sh,
00061                                            DCanvas *dst, int dx, int dy, int dw, int dh);
00062 };
00063 
00064 class IInputDevice
00065 {
00066  public:
00067         virtual ~IInputDevice () {}
00068         virtual void ProcessInput (bool parm) = 0;
00069 };
00070 
00071 class IKeyboard : public IInputDevice
00072 {
00073  public:
00074         virtual void ProcessInput (bool consoleOpen) = 0;
00075         virtual void SetKeypadRemapping (bool remap) = 0;
00076         virtual void GetKeyRepeats (int &delay, int &rate)
00077                 {
00078                         delay = (250*TICRATE)/1000;
00079                         rate = TICRATE / 15;
00080                 }
00081 };
00082 
00083 class IMouse : public IInputDevice
00084 {
00085  public:
00086         virtual void SetGrabbed (bool grabbed) = 0;
00087         virtual void ProcessInput (bool active) = 0;
00088 };
00089 
00090 class IJoystick : public IInputDevice
00091 {
00092  public:
00093         enum EJoyProp
00094         {
00095                 JOYPROP_SpeedMultiplier,
00096                 JOYPROP_XSensitivity,
00097                 JOYPROP_YSensitivity,
00098                 JOYPROP_XThreshold,
00099                 JOYPROP_YThreshold
00100         };
00101         virtual void SetProperty (EJoyProp prop, float val) = 0;
00102 };
00103 
00104 void I_InitHardware ();
00105 void STACK_ARGS I_ShutdownHardware ();
00106 
00107 // [RH] M_ScreenShot now accepts a filename parameter.
00108 //              Pass a NULL to get the original behavior.
00109 void I_ScreenShot (const char *filename);
00110 
00111 #endif  // __HARDWARE_H__
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends