graphics at the core of windows 8 -...
TRANSCRIPT
Graphics at the Core of Windows 8
Microsoft Confidential 3
2D Graphics 3D
Graphics
Segoe UIFonts, Text
Analysis, Layout
Image & Video
Decoding
HTML5, CSS3,
XAML, Direct2D
Direct3D
Segoe UIHTML5, CSS3,
XAML
WinRT, HTML5, XAML,
Player Framework
auto p = make_shared<Circle>(42);
shared_ptr<Shape> shape = loadShape();
shape.get(); // get the raw pointer
for_each(begin(vw), end(vw),
[&](shared_ptr<Circle>& s) {
if( s && *s == *p ) cout << “Match!”;
} );
Synchronous?
• App stays responsive to many requests
• Takes advantage of more CPUs
• Operations can be canceled
then
then
task<int> t([]()
{
return fib(40);
});
task<int> t2 = t.then([](){ return anotherTask(); });
t2.get(); // blocking, will wait until t2 is done
Return types
must match
• Set of language extensions and libraries to allow direct consumption and authoring of Windows Runtime types• Strongly-typed system for Windows Runtime
• Automatically reference counted
• Exception-based
• Deep integration with STL
• Well defined binary contract across module boundaries
Key Bindings Feature Summary
Data Types Ref class Reference type
Value class Value type
Interface class Interface
Property Property with get/set
Event Delegate property with
add/remove/raise
Delegate Type-safe function pointer
Generic Type-safe generics
Allocation Ref new Reference-counted allocation
Pointer &
Reference
^ Strong pointer (“hat” or “handle”)
demo
Initialize
• Called on
application
launch
• Register
application
events here
SetWindow
• OS assigned
CoreWindow to
your app
• Register
window events
here
Load
• Parameter tells
us from where
the app was
launched
Run
• Put your
rendering loop
in here
• <5 seconds to
get here to
start handling
events
Uninitialize
• Rarely executed
• Usually left
empty
demo
Complex 2D/3D graphics, text
Image effects
ISwapChainBackgroundPanelNative
panelNative->SetSwapChain(m_swapChain.Get());
demo