App structure options Select feature levels to support D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_1 }; UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;

Download Report

Transcript App structure options Select feature levels to support D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_1 }; UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;

App structure options
Select feature levels to support
D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_9_1
};
UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
Create the device and context
ComPtr<ID3D11Device>
ComPtr<ID3D11DeviceContext>
nullptr
// use the default adapter
// use 0 unless a software device
// defined above
// what app will support
//
//
//
//
should always be D3D11_SDK_VERSION
created device
feature level of the device
corresponding immediate context
DirectX control panel
http://msdn.microsoft.com/en-us/library/windows/apps/jj262110.aspx
Task object library
#include <ppl.h>
#include <ppltasks.h>
using namespace Concurrency;
float f = 1.0f;
// task defined with capturing lambda
task<int>([=]()
{
return foo(f);
}).then([](int x) // continuation lambda argument is return value of previous
{
bar(x);
}).then(baz);
// continuation using existing function baz()
C++ Dev Camp: Async-made-simple-with-Cpp-PPL
IAsyncAction WorkItem =
Windows.System.Threading.ThreadPool.RunAsync(
ExampleWorkItemHandler, WorkItemPriority.Normal);
Createthread for Windows Store apps
http://msdn.microsoft.com/enus/library/windows/desktop/ms684841(v=vs.85).aspx
http://msdn.microsoft.com/enus/library/windows/desktop/ee416321(v=vs.85).aspx
http://msdn.microsoft.com/en-us/magazine/cc163327.aspx
http://msdn.microsoft.com/en-us/magazine/cc163405.aspx
window->PointerCursor = nullptr;
window->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0);
DirectX Shooting Game sample
DirectX touch input sample
// for mouse-only use
// register handler for relative mouse movement events
Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved +=
ref new TypedEventHandler<MouseDevice^, MouseEventArgs^>
(this, &MoveLookController::OnMouseMoved);
// Handle Mouse Input via dedicated relative movement handler
void MoveLookController::OnMouseMoved(
_In_ MouseDevice^ mouseDevice,
_In_ MouseEventArgs^ args
)
{
float2 pointerDelta;
pointerDelta.x = static_cast<float>(args->MouseDelta.X);
pointerDelta.y = static_cast<float>(args->MouseDelta.Y);
. . .
Relative
mouse
handler


Creating another FrameworkView
m_dxView = Windows::ApplicationModel::Core::CoreApplication::
CreateNewView("GameScreen.DirectXView","Example Entrypoint String");
Lets you have a full XAML environment for UI-heavy menus, options, etc.
Then have a separate DirectX-only screen
Yet another approach to XAML interop beyond SwapChainBackgroundPanel
Decision – Rotation
Rotation preferences
{
DisplayOrientations::None;
// Enable rotation by OS/Accelerometer
DisplayOrientations::Landscape;
// Lock rotation by OS/Accelerometer
DisplayOrientations::LandscapeFlipped; //
and enable this orientation
DisplayOrientations::Portrait;
DisplayOrientations::PortraitFlipped;
}
using namespace Windows::Graphics::Display;
DisplayProperties::AutoRotationPreferences = DisplayOrientations::Landscape;
|
DisplayOrientations::LandscapeFlipped;
Copying additional assets to AppData/Local
void myGame::OnActivated(CoreApplicationView^ applicationView,
IActivatedEventArgs^ args)
{
CoreWindow::GetForCurrentThread()->Activate();
if(args->Kind == ActivationKind::File)
{
auto item = safe_cast<FileActivatedEventArgs^>(args)->Files->GetAt(0);
if(item->Name == "texturepack.MyGame_wad")
{
safe_cast<StorageFile^>(item)->CopyAsync(
ApplicationData::Current->LocalFolder,
"data.wad",
NameCollisionOption::ReplaceExisting );
}
}
}
Your move.
Get started
Check out the DirectX Samples:
Visual Studio project templates
Direct3D Tutorial Sample
DirectX Touch Input Sample
Direct3D Sprite Sample
Direct3D Resource Loading Sample
Direct3D Bump Mapping Sample
DirectX Marble Maze Game Sample
DirectX 3D Shooting Game Sample
…
File->New Project->C++->DirectX
D3DTutorial
Simple3DTouch
Simple3DSprites
Direct3DResourceLoading
BumpMapping
Marble Maze
Simple3DGame
Get your app onto the Windows Store
May 2012 Camp: Developing Windows Store Apps in C++
Link to more detailed talks referenced:
May 2012 Camp: Developing Windows Store Apps in C++
Please submit session evals on the Build Windows 8 App
or at http://aka.ms/BuildSessions
http://msdn.microsoft.com/enUS/windows/apps/br229512
http://design.windows.com/
http://code.msdn.microsoft.com/windows
apps/Windows-8-Modern-Style-AppSamples
http://channel9.msdn.com/Windows
http://aka.ms/BuildSessions