csplugincommon/directx/directdetection.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 1998 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library 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 GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_DIRECTDETECTION_H__ 00020 #define __CS_DIRECTDETECTION_H__ 00021 00022 #include "csextern_dx.h" 00023 00024 #include <windows.h> 00025 #include <ddraw.h> 00026 00033 00034 class CS_CSPLUGINCOMMON_DX_EXPORT DirectDetectionDevice 00035 { 00036 public: 00037 DirectDetectionDevice() : Windowed(false), IsPrimary2D(true), 00038 DeviceName2D(0), DeviceDescription2D(0) 00039 { 00040 ZeroMemory (&Guid2D, sizeof(GUID)); 00041 } 00042 DirectDetectionDevice (const DirectDetectionDevice& other) : 00043 Windowed (other.Windowed), IsPrimary2D (other.IsPrimary2D) 00044 { 00045 memcpy (&Guid2D, &other.Guid2D, sizeof (GUID)); 00046 DeviceName2D = csStrNew (other.DeviceName2D); 00047 DeviceDescription2D = csStrNew (other.DeviceDescription2D); 00048 } 00049 ~DirectDetectionDevice() 00050 { 00051 delete[] DeviceName2D; 00052 delete[] DeviceDescription2D; 00053 } 00054 00056 GUID Guid2D; 00058 bool Windowed; 00060 bool IsPrimary2D; 00062 char * DeviceName2D; 00064 char * DeviceDescription2D; 00065 }; 00066 00068 class CS_CSPLUGINCOMMON_DX_EXPORT DirectDetection 00069 { 00070 public: 00071 bool Have2DDevice(); 00072 DirectDetection(); 00073 virtual ~DirectDetection(); 00074 const DirectDetectionDevice* FindBestDevice (int displayNumber = 0); 00075 int AddDevice (const DirectDetectionDevice& dd2d); 00076 bool CheckDevices(); 00077 bool CheckDevices2D(); 00078 00079 void ReportResult (int severity, char *str, HRESULT hRes); 00080 void SystemFatalError (char *str, HRESULT hRes); 00081 00083 csArray<DirectDetectionDevice> Devices; 00084 iObjectRegistry* object_reg; 00085 }; 00086 00089 #endif // __CS_DIRECTDETECTION_H__
Generated for Crystal Space by doxygen 1.4.6