platformVideoInfo.h
Engine/source/platform/platformVideoInfo.h
Classes:
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _PLATFORM_VIDEOINFO_H_ 25#define _PLATFORM_VIDEOINFO_H_ 26 27#include "platform/platform.h" 28#include "core/util/str.h" 29#include "core/util/tVector.h" 30 31// The purpose of this class is to abstract the gathering of video adapter information. 32// This information is not specific to the API being used to do the rendering, or 33// the capabilities of that renderer. That information is queried in a different 34// class. 35 36class PlatformVideoInfo 37{ 38 // # of devices 39 // description 40 // manufacturer 41 // chip set 42 // driver version 43 // VRAM 44public: 45 enum PVIQueryType 46 { 47 PVI_QueryStart = 0, ///< Start of the enum for looping 48 49 // The NumAdapters query is the only non-adapter specific query, the following 50 // queries are all specific to an adapter. 51 PVI_NumDevices = 0, ///< Number of sub adapters 52 PVI_Description, ///< String description of the adapter 53 PVI_Name, ///< Card name string 54 PVI_ChipSet, ///< Chipset string 55 PVI_DriverVersion, ///< Driver version string 56 PVI_VRAM, ///< Dedicated video memory in megabytes 57 58 // Please add query types above this value 59 PVI_QueryCount, ///< Counter so that this enum can be looped over 60 PVI_NumAdapters, ///< Number of adapters on the system 61 }; 62 63 struct PVIAdapter 64 { 65 U32 numDevices; 66 String description; 67 String name; 68 String chipSet; 69 String driverVersion; 70 U32 vram; 71 }; 72 73private: 74 Vector<PVIAdapter> mAdapters; ///< Vector of adapters 75 76 /// Signal handling method for GFX signals 77 // bool processGFXSignal( GFXDevice::GFXDeviceEventType gfxEvent ); 78 79protected: 80 /// This method will be called before any queries are made. All initialization, 81 /// for example Win32 COM startup, should be done in this method. If the return 82 /// value is false, no querys will be made. 83 virtual bool _initialize() = 0; 84 85 /// This is the query method which subclasses must implement. The querys made 86 /// are all found in the PVIQueryType enum. If NULL is specified for outValue, 87 /// the sub class should simply return true if the query type is supported, and 88 /// false otherwise. 89 virtual bool _queryProperty( const PVIQueryType queryType, const U32 adapterId, String *outValue ) = 0; 90 91public: 92 PlatformVideoInfo(); 93 virtual ~PlatformVideoInfo(); 94 95 bool profileAdapters(); 96 97 const PVIAdapter &getAdapterInformation( const U32 adapterIndex ) const; 98}; 99 100#endif 101