зеркало из https://github.com/microsoft/DirectXTK.git
Added RAII link
Родитель
f63d492706
Коммит
b8673803c7
|
@ -10,7 +10,7 @@ Construction requires a Direct3D 11 device.
|
|||
|
||||
std::unique_ptr<AlphaTestEffect> effect(new AlphaTestEffect(device));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Interfaces
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Construction requires a Direct3D 11 device.
|
|||
|
||||
std::unique_ptr<BasicEffect> effect(new BasicEffect(device));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Interfaces
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ The CommonStates constructor requires a Direct3D 11 device.
|
|||
|
||||
std::unique_ptr<CommonStates> states(new CommonStates(device));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Using this helper to set device state
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ Construction requires a Direct3D 11 device and a _pixelShader_ instance.
|
|||
|
||||
If the _pixelShader_ instance is null, it uses one of the three built-in default materials: _Unlit_, _Lambert_, and _Phong_. This class assumes the pixel shader provided is signature compatible with the built-in DGSL vertex shader, and will work for the feature level of the device.
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Interfaces
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Construction requires a Direct3D 11 device.
|
|||
|
||||
std::unique_ptr<DualTextureEffect> effect(new DualTextureEffect(device));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Interfaces
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
This is a helper object primarily used by the [[Model]] loader implementations to provide sharing of material instances of [[Effects]] and textures. This can be used standalone as well, and allows access to any existing ‘materials’ definitions already created.
|
||||
This is a helper object primarily used by the [[Model]] loader implementations to provide sharing of material instances of [[Effects]] and textures. This can be used standalone as well, and allows access to any existing ‘materials’ definitions already created.
|
||||
|
||||
It uses a simple case-sensitive string-based (wide-character) map for finding effect and texture instances that have already been created by the factory, which avoid duplication of texture and effect resources in complex models and scenes.
|
||||
|
||||
|
@ -14,7 +14,7 @@ The **EffectFactory** and **DGSLEffectFactory** constructor require a Direct3D 1
|
|||
|
||||
std::unique_ptr<DGSLEffectFactory> fxFactory( new DGSLEffectFactory( device ) )
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Creating effects
|
||||
Fill out the EffectInfo structure, then call **CreateEffect** to obtain an [[Effects]] instance. If the _info.name_ string is provided then any already created effect from the factory that has the same name will be returned as a shared instance rather than a new instance created. If there is a name match, then all the other parameters in the EffectInfo are ignored. Otherwise a new effect is created from the provided EffectInfo parameters, and CreateTexture is called automatically if the _info.texture_ or _info.texture2_ string is provided. Remember that the use of a texture or _info.perVertexColor_ will result in a varying the input layout requirements for the resulting Effect.
|
||||
|
|
|
@ -23,7 +23,7 @@ The built-in effect constructors requires a Direct3D 11 device.
|
|||
|
||||
std::unique_ptr<BasicEffect> effect(new BasicEffect(device));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Set effect parameters
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Construction requires a Direct3D 11 device.
|
|||
|
||||
std::unique_ptr<EnvironmentMapEffect> effect(new EnvironmentMapEffect(device));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Interfaces
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ GamePad is a singleton.
|
|||
|
||||
std::unique_ptr<GamePad> gamePad( new GamePad );
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr``.
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr``.
|
||||
|
||||
# Basic use
|
||||
**GetState** queries the controller status given a _player_ index. If connected, it returns the status of the buttons (A, B, X, Y, left & right stick, left & right shoulder, back, and start), the directional pad (DPAD), the left & right thumb sticks, and the left & right triggers.
|
||||
|
|
|
@ -25,7 +25,7 @@ The GeometryPrimitive class must be created from a factory method which takes th
|
|||
std::unique_ptr<GeometricPrimitive> shape(
|
||||
GeometricPrimitive::CreateTeapot(deviceContext) );
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr``.
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr``.
|
||||
|
||||
* **CreateCube**( deviceContext, float size = 1): Creates a [cube](http://en.wikipedia.org/wiki/Cube) (also known as a [hexahedron](http://en.wikipedia.org/wiki/Hexahedron)) of the given size.
|
||||
* **CreateSphere**( deviceContext, float diameter = 1, size_t tessellation = 16): Creates a uv-[sphere](http://en.wikipedia.org/wiki/Sphere) of given diameter with the given tessellation factor.
|
||||
|
|
|
@ -8,7 +8,7 @@ Keyboard is a singleton.
|
|||
|
||||
std::unique_ptr<Keyboard> keyboard( new Keyboard );
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr``.
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr``.
|
||||
|
||||
# Integration
|
||||
For Windows desktop applications, the application needs to make the appropriate calls during the main **WndProc** message processing:
|
||||
|
|
2
Mouse.md
2
Mouse.md
|
@ -8,7 +8,7 @@ Mouse is a singleton.
|
|||
|
||||
std::unique_ptr<Mouse> mouse( new Mouse );
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr``.
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr``.
|
||||
|
||||
# Integration
|
||||
For Windows desktop applications, the application needs to make the appropriate calls during the main **WndProc** message processing:
|
||||
|
|
|
@ -10,7 +10,7 @@ Construction requires a Direct3D 11 device.
|
|||
|
||||
std::unique_ptr<SkinnedEffect> effect(new SkinnedEffect(device));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Interfaces
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ The SpriteBatch class requires a Direct3D 11 device context for drawing.
|
|||
|
||||
std::unique_ptr<SpriteBatch> spriteBatch(new SpriteBatch(deviceContext));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Simple drawing
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ The SpriteFont class requires a [[SpriteBatch]] instance and a ``.spritefont`` b
|
|||
std::unique_ptr<SpriteFont> spriteFont(new SpriteFont(device,
|
||||
L"myfile.spritefont"));
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
# Simple drawing
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ _Note: DirectXTK for Audio uses XAudio 2.8 or XAudio 2.7. It does not make use o
|
|||
std::unique_ptr<WaveBank> wb( new WaveBank( audEngine.get(),
|
||||
L"wavebank.xwb" ) );
|
||||
|
||||
For exception safety, it is recommended you make use of the C++ RAII pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
For exception safety, it is recommended you make use of the C++ [RAII](http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) pattern and use a ``std::unique_ptr`` or ``std::shared_ptr``
|
||||
|
||||
Note that in-memory banks may still be loading the wave data asynchronously after the return of this constructor. You can see if the wave data has completed loading by calling **IsPrepared**. If you call **Play** or **CreateInstance** before the wave data has loaded, then the thread will wait until the load is complete before returning.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче