forked from sharpdx/SharpDX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSurface.cs
More file actions
35 lines (31 loc) · 1.05 KB
/
Surface.cs
File metadata and controls
35 lines (31 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpDX.Mathematics.Interop;
namespace SharpDX.DirectComposition
{
partial class Surface
{
public Surface(Device device, int width, int height, DXGI.Format format, DXGI.AlphaMode alphaMode) : base(IntPtr.Zero)
{
device.CreateSurface(width, height, format, alphaMode, this);
}
public Surface(Device2 device, int width, int height, DXGI.Format format, DXGI.AlphaMode alphaMode)
: base(IntPtr.Zero)
{
device.CreateSurface(width, height, format, alphaMode, this);
}
public Surface(SurfaceFactory factory, int initialWidth, int initialHeight, DXGI.Format format, DXGI.AlphaMode alphaMode)
: base(IntPtr.Zero)
{
factory.CreateSurface(initialWidth, initialHeight, format, alphaMode, this);
}
public T BeginDraw<T>(RawRectangle? updateRect, out RawPoint updateOffset) where T : ComObject
{
IntPtr temp;
BeginDraw(updateRect, Utilities.GetGuidFromType(typeof(T)), out temp, out updateOffset);
return ComObject.FromPointer<T>(temp);
}
}
}