Директ икс сдк. Установка DirectX SDK и directx end-user runtimes

What"s New in the February 2010 DirectX SDK

This version of the DirectX SDK contains the following new features, tools, and documentation.

Improvements to PIX

PIX has much-improved support for analysis of programs that use Direct3D 11 features, including compute shaders, tessellation, and dynamic shader class linkage. PIX features such as pixel history, the shader debugger, the mesh viewer, frame counters, and screenshots now work for these Direct3D 11 programs.

The new "Playback Device" control in the Events pane enables the user to force PIX Direct3D playback to use the REF device.

Mesh viewer data can be exported to a CSV file by right-clicking the data tables displayed in the PreVS, PostVS, or PostGS views.

The texture viewer now supports the following additional formats:

  • DXGI_FORMAT_D24_UNORM_S8_UINT
  • DXGI_FORMAT_R24G8_TYPELESS
  • DXGI_FORMAT_BC1_UNORM_SRGB
  • DXGI_FORMAT_BC2_UNORM_SRGB
  • DXGI_FORMAT_BC3_UNORM_SRGB
XNAMath C++ SIMD Math Library

A minor revision to the library (version 2.02), includes a number of customer-reported fixes, optimizations, and improvements. Included are notable fixes to XMStoreColor() , XMQuaternionRotationMatrix() , XMVectorATan2() , and XMVectorATan2Est() .

Direct3D 11 Deployment

The Direct3D 11 Deployment for Game Developers article and D3D11InstallHelper Sample have been updated to include guidance for corporate network users in a locally managed Windows Server Update Services (WSUS) environment. For these developers, is not applicable and they should refer to instead.

Enhancements to Voice Reuse Scenarios

Implementation changes to simplify voice reuse were made to IXAudio2SourceVoice::FlushSourceBuffers , IXAudio2SourceVoice::SetSourceSamplingRate , and IXAudio2SourceVoice::Stop . These changes enable titles to minimize the performance cost of creating and destroying multiple voices during the game.

Reverb and Mixing Performance Optimizations

We have optimized the codepaths for several of the less common channel mixing scenarios for mixing within the audio graph.

Previous Releases

For a description of what was added in previous releases, see Features Introduced in Previous Releases in the DirectX SDK documentation.

Known Issues with the February 2010 SDK

Message: The DirectX component "d3d10sdklayers.dll" is currently in use by other applications

The following message sometimes appears during setup or uninstall:

The DirectX component "d3d10sdklayers.dll" is current in use by other applications

If you encounter this message, select Ignore and reboot your system after setup or uninstall is complete. This issue occurs only on Windows 7 and Windows Server 2008 R2.

PIX Crashes on Call to GetImmediateContext

In the February 2010 release, PIX crashes if the target application calls D3D11CreateDevice() or D3D11CreateDeviceAndSwapChain() with a NULL ppImmediateContext , then later calls GetImmediateContext() to get the immediate context. To work around the issue, pass a non-NULL pointer for ppImmediateContext. This issue will be corrected in an upcoming release.

Support for Visual Studio 2005 and Visual Studio 2010

In the next release, the DirectX SDK will add support for Visual Studio 2010. At that time, the DirectX SDK will no longer support Visual Studio 2005; the February 2010 release will be the last release to support Visual Studio 2005. The next release will continue to support Visual Studio 2008.

Support for DirectSetup

Beginning with the next release of the DirectX SDK, DirectSetup will no longer support operating systems earlier than Windows XP Service Pack 2 and Windows Server 2003 Service Pack 1.

Direct3D 11 Runtime

To obtain the Direct3D 11 runtime, please obtain an RTM version of Windows 7 or follow the procedure described in (or for corporate network users). For more details, see Direct3D 11 Deployment for Game Developers .

Effects 11

The Effects runtime for Direct3D 11 (FX11) is available as shared source in the DirectX SDK. For more information, please refer to Effects (Direct3D 11) and Effect System Interfaces (Direct3D 11) in the Windows Graphics documentation. The Effects 11 source is now located in the samples directory.

DirectX 11 Runtime Symbols

The modern DirectX Runtime is part of the operating system (OS), and symbols for the DirectX components (Direct3D, DirectInput, DirectSound, etc.) are provided as part of the OS symbol packages. DirectX 11 Runtime symbols are included in the Windows 7 and Windows Server 2008 R2 symbols packages available on the Microsoft website. However, we recommend using the Microsoft symbols server instead for the most current and correct set of symbols when debugging DirectX applications.

Note that DirectX 11 Runtime symbols for the down-level and update for Windows Vista and Windows Server 2008 are not included in the OS offline symbols package. They can be obtained from the Microsoft symbol server.

The Provided D3D9D.dll for Windows XP is Versioned for Service Pack 2

The D3D9D.dll that is included in the February 2010 DirectX SDK is versioned for Windows XP SP2. If you use this DLL on Windows XP SP3 with an application that uses the Windows Presentation Framework (WPF), the code in the DLL will assert. This issue does not occur on Windows Vista or Windows 7. If you require only debug output, that is, you do not require symbols, you could also use the checked version of D3D9.dll, which is compatible with Windows XP SP3. Just rename the checked D3D9.dll to D3D9D.dll. The checked version of D3D9.dll is available to MSDN subscribers.

Control Panel for DirectX 9 Debug Output is Specific to 32-bit or 64-bit Applications

In order to turn DirectX 9 debug output on or off, you must use the DirectX control panel appropriate to the application being debugged. Use the 64-bit DirectX control panel for 64-bit applications and the x86 DirectX control panel for 32-bit applications.

D3DCompiler_42.dll Moved to New Cab

Beginning in the August 2009 DirectX SDK release, D3DCompiler_42.dll has been moved out of the D3DX CAB to a new CAB: D3DCompiler_42_*.CAB. The D3D_Compiler functionality implements the offline HLSL compiler for D3D 9, 10, or 11. This change decouples compiler from D3DX.

HLSL Runtime Compiling for Shader Models that Do Not Allow NaN or Infinity Literals

When compiling code that looks like the following:

Pow(max(0, f), e)

If the result of max(0,f) is 0, the statement will be evaluated as exp(-inf * e), which may cause the following error message: (error X4579: NaN and infinity literals not allowed by shader model). This is because pow(0, e) will be expanded to exp(log(0) * e), which will evaluated as exp(-inf * e).

The workaround for compiling code like this, for a shader model that does not allow NaN or infinity literals, is to change 0 in max(0, f) to 0.00001f, or some other acceptably small non-zero value.

This scenario typically fails during a call to ID3DXEffectCompiler when compiling for shader models that do not allow NaN and infinity literals (such as DX9 shader targets). It is a regression from the November 2008 release. The result may show up when debugging a game that exits at startup and generates an error message such as "nonzero reference count" or "an error occurred in the device creation callback function".

New Warning X3206: Implicit Truncation of Vector Type

Beginning in the August 2009 release of the DirectX SDK, the HLSL compiler will warn when an implicit truncation of a vector type occurs. For example, the follow code would elicit the warning.

Float2 vLightMax = vLightPos + g_fFilterSize;

If (bTextured) In.vDiffColor.xyz *= DiffuseTex.Sample (DiffuseSampler, In.vTCoord);

To avoid the warning, swizzle out the vector components as shown below.

Float4 FastShadow (float3 vLightPos, float4 vDiffColor)

Float2 vLightMax = vLightPos.xy + g_fFilterSize;

If (bTextured) In.vDiffColor.xyz *= DiffuseTex.Sample (DiffuseSampler, In.vTCoord).xyz;

IXACT3Engine::PrepareWave Doesn"t Support xWMA

In the March 2008 and later SDKs, the IXACT3Engine::PrepareWave doesn"t support xWMA. If you want to use xWMA in XACT, you can prepare those waves by calling one of the following methods:

  • IXACT3WaveBank::Prepare
  • IXACT3SoundBank::Prepare
  • IXACT3Engine::PrepareInMemoryWave
  • IXACT3Engine::PrepareStreamingWave
Building Samples Using the Visual Studio 2005 Project Files Results In Harmless Warning

Developers who build the samples may see the following harmless warning:

Manifest authoring warning 81010002: Unrecognized Element "requestedPrivileges" in namespace "urn:schemas-сайт:asm.v2".

This is a known issue with the manifest tool (mt.exe) that ships in Visual Studio 2005 SP1. To remove this warning, developers should update their versions of mt.exe to the version that ships in the Windows SDK. Developers should update the instances of mt.exe that ship in Visual Studio 2005 SP1, found in the following three locations:

  • VC\bin\
  • Common7\tools\bin\
  • SDK\v2.0\bin\
Symbols for DirectX

The latest and most complete source for debugging symbols is the Microsoft Symbol Server. We recommend using the symbol server rather than using the included partial symbols package. For instructions about using the Microsoft Symbol Server, see .

Installation Notes for All Platforms

  • This SDK is supported on the most recent service packs of the following operating systems: Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7. This SDK supports Visual Studio 2005 and Visual Studio 2008.
  • Before installing the current DirectX SDK, remove previous versions of the DirectX SDK.
  • Use the Samples Browser to install samples included with the DirectX SDK.
  • Some samples require that you have installed the latest Microsoft Windows SDK on your system.
  • If you are using Visual Studio and run the Platform SDK Integration tool, all custom include and library paths will be erased, including those added by the DirectX SDK. To fix the issue, developers need to either reinstall the DirectX SDK or manually add the paths to Visual Studio.
  • If you encounter compilation issues related to the DirectX headers, make sure that the include directories in Visual Studio are set correctly. On the Win32 platform, make sure that there is a reference to the DirectX headers. "$(DXSDK_DIR)include" should appear in the include directory "$(VCInstallDir)Include."
  • Several virus protection software applications interfere with SDK installation. They may require you to disable virus protection software until SDK installation is completed.
  • Your system may be corrupted, or cryptographic services may be disabled, if you encounter the following error message during installation: "A cabinet file is necessary for installation and cannot be trusted." To resolve the problem, try the following:
    1. Enable cryptographic services. On the Start menu, right-click My Computer , and then click Manage . The Computer Management window appears. In the left navigation pane, click Services and Applications . In the right pane, double-click Services , and then double-click Cryptographic Services . The Cryptographic Services Properties property sheet appears. On the General tab, ensure that Service Status is Started, and that Startup Type is Automatic.
    2. If you are running Windows on a FAT32 drive, run scandisk.
    3. Try the resolution steps in .
    4. Try the resolution steps in .
    5. Remove temporary files in the %temp% folder. If you are installing an end-user runtime, also remove "%windir%\system32\directx\websetup Error."
  • External firewall programs may indicate that the file InstallDeveloperFiles.exe wants to access the Internet. This is by design, and should be enabled.
Documentation Organization

This release provides a "Windows DirectX Graphics" documentation collection which includes the Direct3D 9, Direct3D 10.x, Direct3D 11, D3DX, DXGI, and HLSL content formerly located in the main DirectX SDK documentation collection.

Дата создания: 2009-03-31 15:25:43
Последний раз редактировалось: 2012-02-08 08:19:22

    Ссылки на программы:
  1. DirectX End-User Runtimes (directx для запуска игр ) июнь 2010. Скачать (95 мегабайт) .
  2. directx для программирования ) июнь 2010. Скачать (2 мегабайта) .

DirectX - набор библиотек, предназначенных прежде всего для вывода графики.

Для того чтобы писать программы, в которых используется DirectX, нужно установить Directx sdk. Для запуска программ написанных с использованием DirectX, необходимо установить directx end-user runtimes. В данном уроке мы рассмотрим установку обоих компонентов.

Для разных версий DirectX используются одни и те же файлы: DirectX 9.0c на Windows XP, DirectX 10 на Windows Vista и DirectX 11 на Windows 7 - для всех этих версий подходят одни и те же установочные файлы. Т.е. для всех версий Windows нужен один и тот же архив с установочными файлами DirectX End-User Runtimes или DirectX SDK.

Установка DirectX End-User Runtimes (directx для запуска игр)

Для запуска игр и программ, написанных с использованием библиотеки Directx нужно установить directx end-user runtimes.

На вашем компьютере уже установлена одна из версий DirecX end-user runtimes. Для программ, которые мы будем создавать, вполне достаточно и старых версий, и если вам не нужна последняя версия DirectX end-user runtimes, можете переходить к следующему пункту.

Последняя на данный момент (июль 2010) версия directx end-user runtimes вышла в июне 2010г. Найти последнюю версию можно на диске с какой-нибудь недавно вышедшей игрой или скачать по ссылке в начале урока.

После того как вы скачали и запустили файл directx_jun2010_redist.exe, появится окно с лицензионным соглашением:

После нажатия на кнопку Yes, нужно будет ввести путь к временной папке, куда будет распакован архив:

После того как архив распаковался, нужно перейти в указанную вами временную папку и запустить файл DXSETUP.exe. Откроется вот такое окно:

Всё. С установкой DirectX end-user runtimes мы закончили. Теперь, для того чтобы создавать программы, использующие возможности directx, нужно установить . Но сначала небольшой урок истории:

Немного истории directx sdk

Прежде чем приступать к чтению уроков из данного раздела (DirectX), вы должны были изучить большую часть материалов из раздела C++. Скорее всего у вас возник ряд вопросов. И самый главный из них: как используя изученный материал, начать создавать свою игру? Ниже я попытаюсь ответить на него. По крайней мере, вы узнаете теорию. Практикой же мы займёмся позже.

До сих пор наши программы работали в досовской консоли. При этом мы использовали язык C++.

C++ - это основа. Не зная этого языка, вы не сможете создать какую-нибудь игру. Конечно адепты Паскаля, Бейсика или Фортрана (если такие есть:)) могут возразить, что на этих языка тоже можно создавать о-го-го какие игры!!! Только о-го-го какими, они были в середине восьмидесятых. Тогда, да, они выглядели очень круто.

Сейчас я расскажу вам очень важную вещь. Она простая, и возможно вы её уже знаете. По крайней мере, если бы кто-нибудь объяснил мне это лет десять назад, возможно вся моя жизнь сложилась бы по-другому.

Итак: "у компьютеров есть слои" (С) Шрек. :) Извините, не сдержался.

У компьютеров есть уровни. Самый низкий уровень - уровень физических элементов (транзисторы и провода). Самый высокий (из тех, что мы пока знаем) - это язык C++. Именно поэтому он называется языком высокого уровня. Между этими уровнями расположено ещё несколько: микроархитектурный уровень (на этом уровне идёт общение с процессором), уровень операционной системы, уровень языка ассемблера (ассемблер - язык низкого уровня).

Когда мы начинаем выполнение программы, команды на языке C++ переводятся на более низкие уровни. На самом нижнем уровне эти команды выполняются непосредственно электрическим сигналом. Одна команда более высокого уровня может состоять из нескольких команд более низкого.

Для простоты понимания, считайте, что каждая команда более высокого уровня состоит из нескольких команд более низкого. Т.е. более высокий уровень - это всего лишь абстракция над более низким.

В конце восьмидесятых - начале девяностых не существовало (точнее они ещё не получили широкого распространения) более высоких абстракций (уровней) чем язык программирования. В нашем случае - это C. Все приложения писались на языке высокого уровня: Pascal, C, Fortran. Создание графики и графических приложений происходило непосредственно на языке высокого уровня.

Тут что надо заметить! Большинство языков программирования высокого уровня обладают примерно равными возможностями. Будь то Pascal, Java или С++. Понятно, что у некоторых этих возможностей побольше, у других поменьше. Но у них много общего: у всех есть циклы и ветвления, функции, переменные.

Ходят слухи, что изучить C++ намного сложнее, чем Pascal или другие языки программирования. Надеюсь, что изучая материал из раздела C++, вы убедились, что это не так.

На мой взгляд, распространённое мнение о сложности C++ - это результат наглой и бессовестной диверсии со стороны адептов Delphi! На самом деле Pascal намного сложнее в изучении. Вы только подумайте, они вместо скобочек { } используют begin и end !!! А как они выполняют присваивание - оператором := (да-да, двоеточие и знак равенства). Короче, настоящий дурдом!

Когда появились видеоускорители, программистам приходилось писать отдельный код для каждого!!! Зайдите в любой интернет-магазин торгующий видеокартами и представьте, что Вам пришлось бы писать отдельный код для каждой видеокарты. В общем, перед программистами появилась серьёзная проблема.

В середине девяностых очень быстро начала распространяться операционная система Windows. Первоначально Windows была написана на C (не на C++, нет. Т.е. там не было классов). Windows до сих пор использует часть старого кода. Когда мы начнём создавать приложения под Windows, мы познакомимся с ещё более высоким уровнем - WinAPI (Windows API). WinAPI используют все приложения под Windows.

WinAPI (API - Application Programming Interface. Интерфейс программирования приложений) - представляет собой набор функций и структур, написанных на C.

В Windows использовалась (и используется) своя система вывода графики. Называется она - GDI (расшифровывается как Graphical Device Interface - интерфейс графического устройства, а не Global Defence Initiative как мог подумать особо проницательный и эрудированный читатель).

GDI в силу особенностей WinAPI не годилась для создания игр. Потому что GDI - оооочеееень меееедлеееннаааааяяя. Кстати, если заглянуть на форумы приспешников Delphi, можно обнаружить, что многие пытаются создавать игры с использованием GDI. Я же говорю, это больные люди. Так вот, разработчики игр не спешили создавать игры под Windows, им было привычнее работать под старой доброй DOS.

И тогда Microsoft создаёт DirectX. Первая версия была полным отстоем. Но время шло, и DirectX становился всё более надёжным. В новой операционной системе Windows 7 уже будет доступна одиннадцатая версия.

Мы будем разбирать примеры для девятой версии. Отличия между девятой и десятой существенные. Возможно, в будущем мы рассмотрим и десятую, хотя скорее всего, сразу перейдём на одиннадцатую.

Что же из себя представляет DirectX. Это высокоуровневая API, которая написана на С++, с использованием технологии COM (Component Object Model - компонентная модель объектов. Мы её кратко рассмотрим). DirectX предназначена для работы с драйверами видеокарт. Для каждой видеокарты создаются драйвера (язык команд, которые понимает видеокарта). Программисту больше не нужно писать отдельный код для каждого драйвера каждой видеокарты. Ему нужно только знать API DirectX. Всю низкоуровневую работу (взаимодействие с драйверами) берёт на себя DirectX.

Справедливости ради, нужно сказать, что существует ещё одна популярная библиотека - OpenGL. Принцип работы - примерно тот же: программист работает с API, а сама OpenGl работает с драйверами. Неоспоримое преимущество OpenGL - мультиплатформенность. Т.е. OpenGL будет работать на всех операционных системах. DirectX работает только на Windows. Преимущества DirectX мы рассмотрим позднее (а они есть, и они, на мой взгляд, гораздо существеннее).

Для того чтобы запускать программы, написанные с использованием DirectX, вам необходим DirectX End-User Runtimes (мы его установили в предыдущем пункте).

Чтобы писать приложения, использующие DirectX, нужно скачать DirectX SDK (Software Development Kit - набор инструментов разработки приложений).

У Вас на выбор два варианта установки directx sdk:

1. Скачивание DirectX SDK с сайта Microsoft. При этом Вы скачаете полный вариант со всеми примерами, документацией и дополнительными инструментами. Размер архива - примерно 580 мегабайт. При установке DirectX SDK займёт больше гигабайта.

2. Скачивание DirectX SDK с вашего любимого сайта (ссылка в начале урока). При этом Вы скачаете урезанный мной вариант, в котором я оставил только библиотечные/заголовочные файлы и один пример. Размер архива - 2 мегабайта (два мегабайта!!! ). Что называется, прочувствуй разницу! При установке, займёт двадцать семь мегабайт.

Внимание:
Если вы переустанавливаете DirectX SDK, то обязательно удалите предыдущую версию (через Установку и удаление программ). Устанавливать новую версию DirectX SDK поверх старой крайне нежелательно. Это замечание касается только полной версии DirectX SDK. Для урезанной версии достаточно заменить папки lib и include.

Установка directx sdk с сайта Microsoft

Откроется страница, с которой можно скачать последнюю на данный момент версию DirectX SDK - от девятого августа.

Итак, на следующей странице нажимаете на кнопку Download . Появится диалог сохранения файла и начнётся скачивание directx sdk:

Кстати, в одной из последних версий DirectX были добавлены технические обзоры двух новых технологий, которые будут использоваться в DirectX 11: Direct2D и DirectWrite. Если знаете английский, обязательно посмотрите соответствующие разделы в MSDN: Direct2d и DirectWrite . Я когда готовил урок, два часа в документации просидел. Жалко, что протестировать не удалось. Думаю, в будущем мы обязательно будем обсуждать данные технологии в рассылке.

После скачивания установочного файла запускаем его. Дальнейший процесс щёлканья на кнопку "Next" я проиллюстрирую картинками:

Скачать и установить DirectX SDK с сайта

Тут всё намного проще и быстрее. Щёлкаете по ссылке, расположенной в начале урока. Или в разделе Листинги и программы ищете "DirectX SDK", загружаете файл на свой компьютер и распаковываете. У себя я распаковал архив в корневой каталог диска D. В итоге установочная папка выглядит так: D:\directx\

Небольшое замечание: я много чего вырезал, чтобы уменьшить архив. В будущем, Вам нужно будет скачать ещё несколько файлов, о чём будет сообщено дополнительно. Они тоже будут небольшими.

После установки directx sdk

Напоследок давайте посмотрим, как оно работает.

Для того чтобы во время выполнения программы работали библиотеки DirectX, в программу нужно включить соответствующие заголовочные файлы. Кроме того необходимы библиотечные файлы. Что это такое? Мы с ними пока не сталкивались. Как мы знаем, в заголовочных файлах хранятся объявления функций. Тела функций обычно хранятся в другом месте. В уроке по многофайловым программам мы хранили тела функций в отдельных исходных файлах. В случае если вы приобретаете библиотеку функций и классов у кого-нибудь, вы получаете заголовочные файлы (где хранятся объявления) и библиотечные файлы (где хранятся определения). Библиотечные файлы имеют расширение.lib.

В данный момент IDE не знает о существовании DirectX. Нам нужно сообщить, где IDE Visual C++ 2008 должна искать заголовочные и библиотечные файлы.

Откройте пункт меню Tools → Options (Сервис → Параметры).

В левой части открывшегося окна выберите Projects and Solutions → VC++ Directories (Проекты и решения → Директории VC++):


В правой части в выпадающем списке Show directories for (Показать директории для:) выберите Include files (Включаемых файлов, за точное имя пункта на русском не ручаюсь, он там второй). Затем из панели инструментов выберите New Line (Новая строка) или щёлкните Ctrl+Ins. Для более наглядной иллюстрации смотрите картинку. Появится новая строка. Щёлкните на кнопку с тремя точками в конце строки

Откроется окно выбора директории. Перейдите в папку, где у вас установлен DirectX. И выберите папку Include.

Теперь в выпадающем списке (где вы выбирали Include files ) выберите Library files (библиотечные файлы) и повторите операцию добавления строки. Только теперь выберите папку Lib/x86 если у Вас 32-ух разрядная операционная система или Lib/x64 если 64-ёх разрядная. Иногда, при использовании 64-битных библиотек, во время запуска программ возникают ошибки, поэтому, если программа, использующая DirectX, у вас не запустилась, вернитесь к этому окну и для поля Library files выберите папку Lib/x86 .

Нажимаем OK. Теперь IDE знает, где искать заголовочные и библиотечные файлы DirectX SDK.

Запуск приложения

Теперь открываем проект File - Open - Project/Solution или щёлкаем Ctrl+Shift+O .

Если вы загружали SDK с сайта Microsoft, то пример находится в папке (D:\directx - папка, куда я установил свою версию):D:\directx\Samples\C++\Direct3D\Tutorials\Tut01_CreateDevice

Если вы загружали SDK с моего сайта, проект можно найти по адресу (D:\directx - папка, куда я установил свою версию): D:\directx\Samples\Tut01_CreateDevice

В папке лежат два решения: для Visual C++ 2005 и для Visual C++ 2008. Выберите решение, соответствующее вашей версии Visual C++.

Теперь нажимаем Ctrl+Alt+F7 и F5.

Вот она!!! Первая программа использующая DirectX.

Прежде чем закрывать IDE, давайте взглянем на код.

В обозревателе решений выберите файл CreateDevice.cpp. Если вы бегло просмотрите весь файл, то скорее всего ничего не поймёте.

Как это ни удивительно:), но структура программы очень похожа на то, что мы уже создавали: директивы #include, функции InitD3D(), CleanUp(), Render(), MsgProc().

Функция wWinMain - аналог main. С неё начинается выполнение программы в Windows.

В строках объявления переменных:
LPDIRECT3D9 g_pD3D = NULL; // Used to create the D3DDevice
LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; // Our rendering device

Встречаются новые типы. На самом деле они переопределены с помощью typedef (который мы уже рассматривали) из стандартных типов.

Кое-что нам не знакомо:
g_pD3D->CreateDevice
Здесь, g_pD3D - объект, а CreateDevice() - метод. Почему используется синтаксис -> вместо привычной для нас точки мы узнаем в одном из следующих уроков.

Да, здесь используется много новых типов, много новых функций, но всё же за всей этой мишурой можно угадать уже привычный (надеюсь, что это действительно так) для нас C++.

What"s New in the June 2010 DirectX SDK

This version of the DirectX SDK contains the following new features, tools, and documentation.

Visual Studio 2010 Support

The June 2010 DirectX SDK includes support for Visual Studio 2010. The DirectX SDK will continue to support Visual Studio 2008 as well. However, Visual Studio 2005 will no longer be supported.

PIX: Object Naming Support

The June 2010 version of PIX supports naming for most resource objects in Direct3D (D3D). Direct3D enables developers to attach arbitrary data to objects in D3D code using the SetPrivateData API for application-specific usage. PIX will now display specific string data for objects in the Object Table and other user interface elements where a human-readable object name will provide a much more effective experience for the user.

PIX: Usability Improvements

The June 2010 version of PIX includes improvements to the PIX user interface:

  • The Object Table shows the size and shader model for each shader.
  • In the Shader Debugger, there is a new toolbar button that enables the display of all constant registers/variables immediately, rather than the first time they are read.
  • In the Shader Debugger, it is possible to copy register and variable data to the clipboard.
  • The Summary pane has a new Direct3D Information section, that shows details about what Direct3D capabilities are present on the computer.
XNAMath C++ SIMD Math Library

The June 2010 release updates XNAMath to version 2.03, which includes the following changes:

  • Addition of XMVectorDivide to optimize SSE2 vector division operations
  • Unified handling of floating-point specials between the Windows SSE2 and no-intrinsics implementations
  • Use of Visual Studio style SAL annotations
  • Modifications to the C++ declarations for XMFLOAT2A/3A/4A/4X3A/4X4A to better support these types in C++ templates
Version-less Naming of Cross-Runtime Data Types

The June 2010 DirectX SDK removes versioning from several Direct3D data types that cross runtime versions. This change makes legacy data-type names equivalent to the new version-less data-type names. Therefore, you can use either legacy or version-less names. However, your code will be cleaner and easier to maintain if you use the version-less names.

New D3DCreateBlob Function

The June 2010 DirectX SDK includes a D3dcompiler_43.dll that exports the new D3DCreateBlob function. Therefore, you are no longer required to use D3d10.dll to create and use an arbitrary length data object.

New ID3D11ShaderReflection Method

The June 2010 DirectX SDK adds the following new method to the ID3D11ShaderReflection interface:

  • GetThreadGroupSize
New HLSL Language fixes and features

HLSL has been updated with the following fixes and features:

  • The frexp intrinsic function has been updated to return a mantissa in the range of .
  • New intrinsic functions have been added for better debugging support.
    • printf -- submits custom shader messages to the information queue.
    • errorf -- submits custom shader error messages to the information queue.
    • abort -- submits custom shader error messages to the information queue and terminates the current draw or dispatch call being executed.
  • Left-Hand-Side typecasting is now illegal and will cause a compile error.
    • Expressions such as (int)myFloat = myInt; are no longer valid. Use myFloat = (float)myInt; type syntax instead.
New HLSL Compiler fixes and features

The HLSL Effects compiler (fxc.exe) has been updated with the following fixes and features:

  • No-optimization (/Od) compiles will produce less-optimized code than before in order to provide improved debugging.
  • No-optimization (/Od) now implies (/Gfp).
  • New compression (/compress) and decompression (/decompress) options have been added to enable the bundling and unbundling of shader files.
  • A new numbering instructions (/Ni) flag has been added to turn on numbering of instructions in shader disassembly.
  • Fxc.exe has a new @command.option.file feature for specifying command options in a file. This enables the /compress and /decompress options to be used on many files at once.
New D3D11 HLSL Format Conversion Functions

The new D3DX_DXGIFormatConvert.inl inline header includes light-weight conversion functions for use in Compute Shaders or Pixel Shaders on D3D11 Hardware that can be useful when applications need to simultaneously read and write to textures, such as in-place editing scenarios.

Documentation Enhancements

The June 2010 DirectX SDK includes the following documentation enhancements:

  • Added links to descriptions of data types for parameters and return values to help developers locate related types.
  • Added additional header and lib information to reference pages for APIs implemented in DirectX samples.
Previous Releases

For a description of what was added in previous releases, see Features Introduced in Previous Releases in the DirectX SDK documentation.

Known Issues with the June 2010 DirectX SDK

Support for Visual Studio 2010 and Visual Studio 2005

Beginning with the June 2010 release, the DirectX SDK supports Visual Studio 2010. The June 2010 release continues to support Visual Studio 2008 Service Pack 1. The DirectX SDK no longer supports Visual Studio 2005; the February 2010 release was the last release to support Visual Studio 2005.

Support for DirectSetup

Beginning with the June 2010 DirectX SDK, DirectSetup no longer supports operating systems earlier than Windows XP Service Pack 2 and Windows Server 2003 Service Pack 1.

Visual Studio 2008 Path Registration Sometimes Fails

In the June 2010 release, the DirectX SDK installer will attempt to automatically register the executable, include, and library path settings needed for compilation of samples and other DirectX programs. In some circumstances, however, automatic registration fails and, therefore, attempts to include DirectX SDK headers result in errors. To work around this issue, manually add the proper path registration to Visual Studio. For more information, see the instructions in the topic "Installing DirectX with DirectSetup" in the section "Install the DirectX SDK".

DirectX SDK Does Not Register Include/Library Paths with Visual Studio 2010

With Visual Studio 2010, the model for adding include, library, and executable paths has changed. In Visual Studio 2008 and previous versions, paths were specified as global settings under Tools\Options . With Visual Studio 2010, paths are now specified on a per-project basis on a VC++ Directories page. All the Visual Studio 2010 projects for the DirectX SDK samples and tools include direct per-project references to the DirectX SDK--via the DXSDK_DIR environment variable--and will compile without any additional steps. New projects that make use of DirectX SDK headers, libraries, or tools should have these references added to the VC++ Directories property page. For more information, see the topic "Installing DirectX with DirectSetup" in the section titled "Install the DirectX SDK", as well as the Visual Studio team blog entry: Visual Studio 2010 C++ Project Upgrade Guide .

Samples Content Exporter Requires Visual Studio 2008

In the June 2010 DirectX SDK, the Samples Content Exporter is designed to use Autodesk FBX SDK 2010.2. The Samples Content Exporter does not work with later versions of the Autodesk FBX SDK (2011.x). Also, the Autodesk FBX SDK does not yet support Visual Studio 2010, and the DirectX SDK Visual Studio 2010 projects for the Samples Content Exporter therefore use the "v90" toolset provided with Visual Studio 2008. As a result, you must have Visual Studio 2008 installed in order to compile the Samples Content Exporter. For more information, see the Visual Studio team blog post entry: C++ Native Multi-Targeting .

Help Integration for Visual Studio 2010

The new Microsoft Help System (MHS), delivered via Visual Studio 2010, enables you to view documents on the MSDN Library using a standard browser. You can also select documents to download from the MSDN Online content publication web site (MSDN cloud) to your computer for viewing when a connection to the Internet is unavailable or undesirable. You can access this functionality from the Help Library Manager. To launch the Help Library Manager, select:

Start | All Programs | Visual Studio 2010 | Visual Studio Tools | Help Library Manager

The MHS is set to Online Mode by default. The first time you click a Help shortcut, you will be asked to confirm that you wish to connect to the Internet to view documentation in the MSDN cloud. If you wish to view documentation when a connection to the Internet is unavailable, you can import documentation sets (books) from the MSDN cloud and install these books to your computer. You can then switch to Offline Mode to view content on your computer by default.

  • To import content to your local computer for viewing in offline mode, select "Install Content from online" in Help Library Manager. For the DirectX SDK documentation, select the "Win32 and COM Development" content title.
  • To check for updated content in the MSDN cloud that you can import, select "Check for updates online" in Help Library Manager.
  • To remove imported content from your local computer, select "Remove content" in Help Library Manager.
If you import content to your local computer, use Help Library Manager to specify, "I want to use local help" to switch to Offline Mode.

Documentation Organization

Beginning with the August 2009 DirectX SDK, the Windows Graphics documentation is provided as a separate documentation collection from the main DirectX SDK documentation collection. The Windows graphics documentation collection includes content for Direct3D 9, Direct3D 10.x, Direct3D 11, D3DX, DXGI, and HLSL.

Direct2D Documentation

In the June 2010 release, the Direct2D documentation is incorrectly marked preliminary and subject to change. This is the official, release documentation for Direct2D; this warning can be safely ignored.

Direct3D 11 Runtime

To obtain the Direct3D 11 runtime, please install the release version of Windows 7 or Windows Server 2008 R2. Windows Vista users can follow the procedure described in (or for corporate network users). For more details, see Direct3D 11 Deployment for Game Developers .

Effects 11

The Effects runtime for Direct3D 11 (FX11) is available as shared source in the DirectX SDK. For more information, please refer to Effects (Direct3D 11) and Effect System Interfaces (Direct3D 11) in the Windows Graphics documentation. The Effects 11 source is now located in the samples directory(Samples\C++\Effects11).

DirectX 11 Runtime Symbols

The modern DirectX Runtime is part of the operating system (OS), and symbols for the DirectX components (Direct3D, DirectInput, DirectSound, etc.) are provided as part of the OS symbol packages. DirectX 11 Runtime symbols are included in the Windows 7 and Windows Server 2008 R2 symbols packages available on the Microsoft website. However, we recommend using the Microsoft symbols server instead for the most current and correct set of symbols when debugging DirectX applications.

Note that DirectX 11 Runtime symbols for the down-level and update for Windows Vista and Windows Server 2008 are not included in the OS offline symbols package. They can be obtained from the Microsoft symbol server.

The Provided D3D9D.dll for Windows XP is Versioned for Service Pack 2

The D3D9D.dll that is included in the February 2010 and later DirectX SDKs is versioned for Windows XP SP2. If you use this DLL on Windows XP SP3 with an application that uses the Windows Presentation Framework (WPF), the code in the DLL will assert. This issue does not occur on Windows Vista or Windows 7. If you require only debug output, that is, you do not require symbols, you could also use the checked version of D3D9.dll, which is compatible with Windows XP SP3. Just rename the checked D3D9.dll to D3D9D.dll. The checked version of D3D9.dll is available to MSDN subscribers.

Control Panel for DirectX 9 Debug Output is Specific to 32-bit or 64-bit Applications

In order to turn DirectX 9 debug output on or off, you must use the DirectX control panel appropriate to the application being debugged. Use the 64-bit DirectX control panel for 64-bit applications and the x86 DirectX control panel for 32-bit applications.

D3DCompiler_42.dll and D3DCompiler_43.dll Are in Their Own Cab

Beginning in the August 2009 DirectX SDK release, D3DCompiler_*.dll has been moved out of the D3DX CAB to a new CAB: D3DCompiler_*_*.CAB. The D3D_Compiler functionality implements the offline HLSL compiler for D3D 9, 10, or 11. This change decouples the compiler from D3DX.

New Warning X3206: Implicit Truncation of Vector Type

Beginning in the August 2009 release of the DirectX SDK, the HLSL compiler will warn when an implicit truncation of a vector type occurs. For example, the follow code would elicit the warning.

Float2 vLightMax = vLightPos + g_fFilterSize;

If (bTextured) In.vDiffColor.xyz *= DiffuseTex.Sample (DiffuseSampler, In.vTCoord);

To avoid the warning, swizzle out the vector components as shown below.

Float4 FastShadow (float3 vLightPos, float4 vDiffColor)

Float2 vLightMax = vLightPos.xy + g_fFilterSize;

If (bTextured) In.vDiffColor.xyz *= DiffuseTex.Sample (DiffuseSampler, In.vTCoord).xyz;

IXACT3Engine::PrepareWave Doesn"t Support xWMA

In the March 2008 and later SDKs, the IXACT3Engine::PrepareWave doesn"t support xWMA. If you want to use xWMA in XACT, you can prepare those waves by calling one of the following methods:

  • IXACT3WaveBank::Prepare
  • IXACT3SoundBank::Prepare
  • IXACT3Engine::PrepareInMemoryWave
  • IXACT3Engine::PrepareStreamingWave
Symbols for DirectX

The latest and most complete source for debugging symbols is the Microsoft Symbol Server. We recommend using the symbol server rather than using the included partial symbols package. For instructions about using the Microsoft Symbol Server, see .

Installation Notes for All Platforms

  • This SDK is supported on the most recent service packs of the following operating systems: Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, Windows 7, and Windows Server 2008 R2. This SDK supports Visual Studio 2008 Service Pack 1 and Visual Studio 2010.
  • Before installing the current DirectX SDK, remove previous versions of the DirectX SDK.
  • Use the Samples Browser to install samples included with the DirectX SDK.
  • Some samples require that you have installed the latest Microsoft Windows SDK on your system.
  • If you are using Visual Studio and run the Platform SDK Integration tool, all custom include and library paths will be erased for Visual Studio 2008, including those added by the DirectX SDK. To fix the issue, developers need to either reinstall the DirectX SDK or manually add the paths to Visual Studio 2008.
  • If you encounter compilation issues related to the DirectX headers, make sure that the include directories in Visual Studio 2008 are set correctly. On the Win32 platform, make sure that there is a reference to the DirectX headers. "$(DXSDK_DIR)include" should appear in the include directory "$(VCInstallDir)Include." In Visual Studio 2010, this directory should be added on a per-project basis in the VC++ Directories property page in the project properties dialog.
  • Several virus protection software applications interfere with SDK installation. They may require you to disable virus protection software until SDK installation is completed.
  • Your system may be corrupted, or cryptographic services may be disabled, if you encounter the following error message during installation: "A cabinet file is necessary for installation and cannot be trusted." To resolve the problem, try the following:
    1. Enable cryptographic services. On the Start menu, right-click My Computer , and then click Manage . The Computer Management window appears. In the left navigation pane, click Services and Applications . In the right pane, double-click Services , and then double-click Cryptographic Services . The Cryptographic Services Properties property sheet appears. On the General tab, ensure that Service Status is Started, and that Startup Type is Automatic.
    2. If you are running Windows on a FAT32 drive, run scandisk.
    3. Try the resolution steps in .
    4. Try the resolution steps in .
    5. Remove temporary files in the %temp% folder. If you are installing an end-user runtime, also remove "%windir%\system32\directx\websetup Error."
  • External firewall programs may indicate that the file InstallDeveloperFiles.exe wants to access the Internet. This is by design, and should be enabled.