+++ /dev/null
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#pragma once\r
-\r
-#include "Enums.h"\r
-#include "DisplayMode.h"\r
-#include "AdapterDetails.h"\r
-#include "Capabilities.h"\r
-#include "AdapterInformation.h"\r
-\r
-using System::Runtime::InteropServices::OutAttribute;\r
-\r
-namespace SlimDX\r
-{\r
- namespace Direct3D9\r
- {\r
- /// <summary>\r
- /// Used to create Microsoft Direct3D objects and set up the environment. This class \r
- /// includes methods for enumerating and retrieving capabilities of the device.\r
- /// </summary>\r
- /// <unmanaged>IDirect3D9</unmanaged>\r
- public ref class Direct3D : ComObject\r
- {\r
- COMOBJECT(IDirect3D9, Direct3D);\r
-\r
- private:\r
- AdapterCollection^ adapters;\r
-\r
- private protected:\r
- Direct3D( bool doNotConstruct );\r
-\r
- public:\r
- Direct3D();\r
-\r
- /// <summary>\r
- /// Gets or sets a value indicating whether Direct3D should check WHQL levels. If this value\r
- /// is set to <c>true</c>, Direct3D can connect to the internet in order to download\r
- /// new Microsoft Windows Hardware Quality Labs (WHQL) certificates.\r
- /// </summary>\r
- property bool CheckWhql;\r
-\r
- /// <summary>\r
- /// Gets a collection of installed adapters.\r
- /// </summary>\r
- property AdapterCollection^ Adapters\r
- {\r
- AdapterCollection^ get() { return adapters; }\r
- private protected:\r
- void set( AdapterCollection^ value ) { adapters = value; }\r
- }\r
-\r
- /// <summary>\r
- /// Gets the number of adapters on the system.\r
- /// </summary>\r
- property int AdapterCount\r
- {\r
- int get() { return InternalPointer->GetAdapterCount(); }\r
- }\r
-\r
- /// <summary>\r
- /// Tests the device to see if it supports conversion from one display format to another.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="sourceFormat">Source adapter format.</param>\r
- /// <param name="targetFormat">Destination adapter format.</param>\r
- /// <param name="result">When the method completes, contains a <see cref="SlimDX::Result"/> object describing the result of the operation.</param>\r
- /// <returns><c>true</c> if the conversion is possible; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceFormatConversion(int adapter, DeviceType deviceType, Format sourceFormat, Format targetFormat, [Out] Result% result);\r
-\r
- /// <summary>\r
- /// Tests the device to see if it supports conversion from one display format to another.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="sourceFormat">Source adapter format.</param>\r
- /// <param name="targetFormat">Destination adapter format.</param>\r
- /// <returns><c>true</c> if the conversion is possible; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceFormatConversion(int adapter, DeviceType deviceType, Format sourceFormat, Format targetFormat);\r
-\r
- /// <summary>\r
- /// Determines whether a surface format is available as a specified resource type and can be\r
- /// used as a texture, depth-stencil buffer, or render target, or any combination of the three,\r
- /// on a device representing this adapter.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="adapterFormat">Format of the display mode into which the adapter will be placed.</param>\r
- /// <param name="usage">Requested usage options for the surface.</param>\r
- /// <param name="resourceType">Resource type requested for use with the queried format.</param>\r
- /// <param name="checkFormat">The format that will be checked for compatibility.</param>\r
- /// <param name="result">When the method completes, contains a <see cref="SlimDX::Result"/> object describing the result of the operation.</param>\r
- /// <returns><c>true</c> if the format is compatible with the specified device; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceFormat( int adapter, DeviceType deviceType, Format adapterFormat, Usage usage, ResourceType resourceType, Format checkFormat, [Out] Result% result );\r
- \r
- /// <summary>\r
- /// Determines whether a surface format is available as a specified resource type and can be\r
- /// used as a texture, depth-stencil buffer, or render target, or any combination of the three,\r
- /// on a device representing this adapter.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="adapterFormat">Format of the display mode into which the adapter will be placed.</param>\r
- /// <param name="usage">Requested usage options for the surface.</param>\r
- /// <param name="resourceType">Resource type requested for use with the queried format.</param>\r
- /// <param name="checkFormat">The format that will be checked for compatibility.</param>\r
- /// <returns><c>true</c> if the format is compatible with the specified device; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceFormat( int adapter, DeviceType deviceType, Format adapterFormat, Usage usage, ResourceType resourceType, Format checkFormat );\r
-\r
- /// <summary>\r
- /// Verifies whether a hardware accelerated device type can be used on this adapter.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="adapterFormat">Format of the display mode into which the adapter will be placed.</param>\r
- /// <param name="backBufferFormat">Format of the back buffer.</param>\r
- /// <param name="windowed">Value indicating whether the device type will be used in full-screen or windowed mode.</param>\r
- /// <param name="result">When the method completes, contains a <see cref="SlimDX::Result"/> object describing the result of the operation.</param>\r
- /// <returns><c>true</c> if the device can be used with the specified settings; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceType( int adapter, DeviceType deviceType, Format adapterFormat, Format backBufferFormat, bool windowed, [Out] Result% result );\r
- \r
- /// <summary>\r
- /// Verifies whether a hardware accelerated device type can be used on this adapter.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="adapterFormat">Format of the display mode into which the adapter will be placed.</param>\r
- /// <param name="backBufferFormat">Format of the back buffer.</param>\r
- /// <param name="windowed">Value indicating whether the device type will be used in full-screen or windowed mode.</param>\r
- /// <returns><c>true</c> if the device can be used with the specified settings; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceType( int adapter, DeviceType deviceType, Format adapterFormat, Format backBufferFormat, bool windowed );\r
-\r
- /// <summary>\r
- /// Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="adapterFormat">Format of the display mode into which the adapter will be placed.</param>\r
- /// <param name="renderTargetFormat">Format of the render target surface.</param>\r
- /// <param name="depthStencilFormat">Format of the depth-stencil surface.</param>\r
- /// <param name="result">When the method completes, contains a <see cref="SlimDX::Result"/> object describing the result of the operation.</param>\r
- /// <returns><c>true</c> if the depth-stencil surface is compatible with the render target format; otherwise, <c>false</c>.</returns>\r
- bool CheckDepthStencilMatch( int adapter, DeviceType deviceType, Format adapterFormat, Format renderTargetFormat, Format depthStencilFormat, [Out] Result% result );\r
- \r
- /// <summary>\r
- /// Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="adapterFormat">Format of the display mode into which the adapter will be placed.</param>\r
- /// <param name="renderTargetFormat">Format of the render target surface.</param>\r
- /// <param name="depthStencilFormat">Format of the depth-stencil surface.</param>\r
- /// <returns><c>true</c> if the depth-stencil surface is compatible with the render target format; otherwise, <c>false</c>.</returns>\r
- bool CheckDepthStencilMatch( int adapter, DeviceType deviceType, Format adapterFormat, Format renderTargetFormat, Format depthStencilFormat );\r
-\r
- /// <summary>\r
- /// Determines if a multisampling technique is available on this device.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="surfaceFormat">Format of the surface to be multisampled.</param>\r
- /// <param name="windowed"><c>true</c> to inquire about windowed multisampling, <c>false</c> to inquire about fullscreen multisampling.</param>\r
- /// <param name="multisampleType">The multisampling technique to test.</param>\r
- /// <param name="qualityLevels">When the method completes, contains the number of quality stops available for a given multisample type.</param>\r
- /// <param name="result">When the method completes, contains a <see cref="SlimDX::Result"/> object describing the result of the operation.</param>\r
- /// <returns><c>true</c> if the device can perform the specified multisampling method; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceMultisampleType( int adapter, DeviceType deviceType, Format surfaceFormat, bool windowed, MultisampleType multisampleType, [Out] int% qualityLevels, [Out] Result% result );\r
- \r
- /// <summary>\r
- /// Determines if a multisampling technique is available on this device.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="surfaceFormat">Format of the surface to be multisampled.</param>\r
- /// <param name="windowed"><c>true</c> to inquire about windowed multisampling, <c>false</c> to inquire about fullscreen multisampling.</param>\r
- /// <param name="multisampleType">The multisampling technique to test.</param>\r
- /// <param name="qualityLevels">When the method completes, contains the number of quality stops available for a given multisample type.</param>\r
- /// <returns><c>true</c> if the device can perform the specified multisampling method; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceMultisampleType( int adapter, DeviceType deviceType, Format surfaceFormat, bool windowed, MultisampleType multisampleType, [Out] int% qualityLevels );\r
-\r
- /// <summary>\r
- /// Determines if a multisampling technique is available on this device.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <param name="surfaceFormat">Format of the surface to be multisampled.</param>\r
- /// <param name="windowed"><c>true</c> to inquire about windowed multisampling, <c>false</c> to inquire about fullscreen multisampling.</param>\r
- /// <param name="multisampleType">The multisampling technique to test.</param>\r
- /// <returns><c>true</c> if the device can perform the specified multisampling method; otherwise, <c>false</c>.</returns>\r
- bool CheckDeviceMultisampleType( int adapter, DeviceType deviceType, Format surfaceFormat, bool windowed, MultisampleType multisampleType );\r
-\r
- /// <summary>\r
- /// Retrieves the current display mode for the specified adapter.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <returns>The current display mode for the specified adapter.</returns>\r
- DisplayMode GetAdapterDisplayMode( int adapter );\r
-\r
- /// <summary>\r
- /// Retrieves information about the specified adapter.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <returns>Information about the specified adapter.</returns>\r
- AdapterDetails^ GetAdapterIdentifier( int adapter );\r
-\r
- /// <summary>\r
- /// Returns the number of display modes available on the specified adapter.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="format">Desired surface format.</param>\r
- /// <returns>The number of display modes available on the specified adapter.</returns>\r
- int GetAdapterModeCount( int adapter, Format format );\r
-\r
- /// <summary>\r
- /// Queries the device to determine whether the specified adapter supports the requested \r
- /// format and display mode.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="format">Desired surface format.</param>\r
- /// <param name="modeIndex">Index of the desired display mode.</param>\r
- /// <returns>The display mode that matches the specified information.</returns>\r
- DisplayMode EnumerateAdapterModes( int adapter, Format format, int modeIndex );\r
-\r
- /// <summary>\r
- /// Returns the handle of the monitor associated with the Direct3D object.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <returns>Handle of the monitor associated with the Direct3D object.</returns>\r
- System::IntPtr GetAdapterMonitor( int adapter );\r
-\r
- /// <summary>\r
- /// Retrieves device-specific information about a device.\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">Desired device type.</param>\r
- /// <returns>A <see cref="Capabilities"/> object containing the capabilities of the adapter.</returns>\r
- Capabilities^ GetDeviceCaps( int adapter, DeviceType deviceType );\r
-\r
- /// <summary>\r
- /// Determines whether the device supports Render-To-Vertex-Buffer (R2VB).\r
- /// </summary>\r
- /// <param name="adapter">Index of the adapter to use.</param>\r
- /// <param name="deviceType">The desired device type.</param>\r
- /// <returns><c>true</c> if the adapter supports R2VB; otherwise, <c>false</c>.</returns>\r
- bool SupportsR2VB( int adapter, DeviceType deviceType );\r
-\r
- Result RegisterSoftwareDevice( System::IntPtr entryPoint );\r
- };\r
- }\r
-}\r