[slimdx] r2210 committed - Changing D3D9 Surface creation sharedHandle parameters to be ref inste...

22 views
Skip to first unread message

sli...@googlecode.com

unread,
Jan 23, 2013, 10:58:54 PM1/23/13
to slimdx...@googlegroups.com
Revision: 2210
Author: Mike.Po...@gmail.com
Date: Wed Jan 23 19:58:22 2013
Log: Changing D3D9 Surface creation sharedHandle parameters to be ref
instead of out. Resolves issue 886.
http://code.google.com/p/slimdx/source/detail?r=2210

Modified:
/trunk/build
/trunk/build/ReleaseNotes.txt
/trunk/source/direct3d9/Surface.cpp
/trunk/source/direct3d9/Surface.h

=======================================
--- /trunk/build/ReleaseNotes.txt Sat Sep 15 21:15:48 2012
+++ /trunk/build/ReleaseNotes.txt Wed Jan 23 19:58:22 2013
@@ -17,6 +17,7 @@
* Fixed the DeviceEx.FromPointer method.
* Fixed text encoding issue in XFile parsing.
* Added Set/GetPrivateData to Resource class.
+ * Changed surface creation sharedHandle parameters to be ref instead of
out.

Direct3D 10
* Added missing StateBlockMask constructor.
=======================================
--- /trunk/source/direct3d9/Surface.cpp Sat Jan 28 10:03:11 2012
+++ /trunk/source/direct3d9/Surface.cpp Wed Jan 23 19:58:22 2013
@@ -106,10 +106,10 @@
}

Surface^ Surface::CreateRenderTarget( SlimDX::Direct3D9::Device^ device,
int width, int height, Format format,
- MultisampleType multiSampleType, int multiSampleQuality, bool lockable,
[Out] IntPtr% sharedHandle )
+ MultisampleType multiSampleType, int multiSampleQuality, bool lockable,
IntPtr% sharedHandle )
{
IDirect3DSurface9* surface = NULL;
- HANDLE sharedHandleNative = NULL;
+ HANDLE sharedHandleNative = sharedHandle.ToPointer();

HRESULT hr = device->InternalPointer->CreateRenderTarget( width, height,
static_cast<D3DFORMAT>( format ),
static_cast<D3DMULTISAMPLE_TYPE>( multiSampleType ),
multiSampleQuality, lockable, &surface, &sharedHandleNative );
@@ -124,10 +124,10 @@
}

Surface^ Surface::CreateOffscreenPlain( SlimDX::Direct3D9::Device^
device, int width, int height, Format format,
- Pool pool, [Out] IntPtr% sharedHandle )
+ Pool pool, IntPtr% sharedHandle )
{
IDirect3DSurface9* surface = NULL;
- HANDLE sharedHandleNative = NULL;
+ HANDLE sharedHandleNative = sharedHandle.ToPointer();

HRESULT hr = device->InternalPointer->CreateOffscreenPlainSurface(
width, height,
static_cast<D3DFORMAT>( format ), static_cast<D3DPOOL>( pool ),
&surface, &sharedHandleNative );
@@ -144,10 +144,10 @@
}

Surface^ Surface::CreateDepthStencil( SlimDX::Direct3D9::Device^ device,
int width, int height, Format format,
- MultisampleType multiSampleType, int multiSampleQuality, bool discard,
[Out] IntPtr% sharedHandle )
+ MultisampleType multiSampleType, int multiSampleQuality, bool discard,
IntPtr% sharedHandle )
{
IDirect3DSurface9* surface = NULL;
- HANDLE sharedHandleNative = NULL;
+ HANDLE sharedHandleNative = sharedHandle.ToPointer();

HRESULT hr = device->InternalPointer->CreateDepthStencilSurface( width,
height, static_cast<D3DFORMAT>( format ),
static_cast<D3DMULTISAMPLE_TYPE>( multiSampleType ),
multiSampleQuality, discard, &surface, &sharedHandleNative );
@@ -179,11 +179,10 @@
}

Surface^ Surface::CreateRenderTargetEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format,
- MultisampleType multiSampleType, int multiSampleQuality, bool lockable,
Usage usage, [Out] IntPtr% sharedHandle )
+ MultisampleType multiSampleType, int multiSampleQuality, bool lockable,
Usage usage, IntPtr% sharedHandle )
{
IDirect3DSurface9* surface = NULL;
- HANDLE localHandle = NULL;
- sharedHandle = IntPtr::Zero;
+ HANDLE localHandle = sharedHandle.ToPointer();

HRESULT hr = device->InternalPointer->CreateRenderTargetEx( width,
height, static_cast<D3DFORMAT>( format ),
static_cast<D3DMULTISAMPLE_TYPE>( multiSampleType ),
multiSampleQuality, lockable,
@@ -218,11 +217,10 @@
}

Surface^ Surface::CreateOffscreenPlainEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height,
- Format format, Pool pool, Usage usage, [Out] IntPtr% sharedHandle )
+ Format format, Pool pool, Usage usage, IntPtr% sharedHandle )
{
IDirect3DSurface9* surface = NULL;
- HANDLE localHandle = NULL;
- sharedHandle = IntPtr::Zero;
+ HANDLE localHandle = sharedHandle.ToPointer();

HRESULT hr = device->InternalPointer->CreateOffscreenPlainSurfaceEx(
width, height,
static_cast<D3DFORMAT>( format ), static_cast<D3DPOOL>( pool ),
&surface,
@@ -257,11 +255,10 @@
}

Surface^ Surface::CreateDepthStencilEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format,
- MultisampleType multiSampleType, int multiSampleQuality, bool discard,
Usage usage, [Out] IntPtr% sharedHandle )
+ MultisampleType multiSampleType, int multiSampleQuality, bool discard,
Usage usage, IntPtr% sharedHandle )
{
IDirect3DSurface9* surface = NULL;
- HANDLE localHandle = NULL;
- sharedHandle = IntPtr::Zero;
+ HANDLE localHandle = sharedHandle.ToPointer();

HRESULT hr = device->InternalPointer->CreateDepthStencilSurfaceEx(
width, height, static_cast<D3DFORMAT>( format ),
static_cast<D3DMULTISAMPLE_TYPE>( multiSampleType ),
multiSampleQuality, discard,
=======================================
--- /trunk/source/direct3d9/Surface.h Sat Jan 28 10:03:11 2012
+++ /trunk/source/direct3d9/Surface.h Wed Jan 23 19:58:22 2013
@@ -96,7 +96,7 @@
/// <param name="lockable">Specifies whether this surface should be
lockable.</param>
/// <returns>A newly created render target surface.</returns>
/// <unmanaged>IDirect3DDevice9::CreateRenderTarget</unmanaged>
- static Surface^ CreateRenderTarget( SlimDX::Direct3D9::Device^ device,
int width, int height, Format format, MultisampleType multisampleType, int
multisampleQuality, bool lockable, [Out] System::IntPtr% sharedHandle );
+ static Surface^ CreateRenderTarget( SlimDX::Direct3D9::Device^ device,
int width, int height, Format format, MultisampleType multisampleType, int
multisampleQuality, bool lockable, System::IntPtr% sharedHandle );

/// <summary>Creates an offscreen surface that can optionally be
shared.</summary>
/// <param name="device">The device to use when creating the
surface.</param>
@@ -106,7 +106,7 @@
/// <param name="pool">The memory pool to create the surface in.</param>
/// <returns>A newly created offscreen surface..</returns>
/// <unmanaged>IDirect3DDevice9::CreateOffscreenPlainSurface</unmanaged>
- static Surface^ CreateOffscreenPlain( SlimDX::Direct3D9::Device^
device, int width, int height, Format format, Pool pool, [Out]
System::IntPtr% sharedHandle );
+ static Surface^ CreateOffscreenPlain( SlimDX::Direct3D9::Device^
device, int width, int height, Format format, Pool pool, System::IntPtr%
sharedHandle );

/// <summary>Creates a depth stencil surface that can optionally be
shared.</summary>
/// <param name="device">The device to use when creating the
surface.</param>
@@ -118,14 +118,14 @@
/// <param name="discard">Whether or not the contents of the surface
should be discarded after use.</param>
/// <returns>A newly created depth-stencil surface.</returns>
/// <unmanaged>IDirect3DDevice9::CreateDepthStencilSurface</unmanaged>
- static Surface^ CreateDepthStencil( SlimDX::Direct3D9::Device^ device,
int width, int height, Format format, MultisampleType multisampleType, int
multisampleQuality, bool discard, [Out] System::IntPtr% sharedHandle );
+ static Surface^ CreateDepthStencil( SlimDX::Direct3D9::Device^ device,
int width, int height, Format format, MultisampleType multisampleType, int
multisampleQuality, bool discard, System::IntPtr% sharedHandle );

static Surface^ CreateRenderTargetEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, MultisampleType
multisampleType, int multisampleQuality, bool lockable, Usage usage );
- static Surface^ CreateRenderTargetEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, MultisampleType
multisampleType, int multisampleQuality, bool lockable, Usage usage, [Out]
System::IntPtr% sharedHandle );
+ static Surface^ CreateRenderTargetEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, MultisampleType
multisampleType, int multisampleQuality, bool lockable, Usage usage,
System::IntPtr% sharedHandle );
static Surface^ CreateOffscreenPlainEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, Pool pool, Usage usage );
- static Surface^ CreateOffscreenPlainEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, Pool pool, Usage usage, [Out]
System::IntPtr% sharedHandle );
+ static Surface^ CreateOffscreenPlainEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, Pool pool, Usage usage,
System::IntPtr% sharedHandle );
static Surface^ CreateDepthStencilEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, MultisampleType
multisampleType, int multisampleQuality, bool discard, Usage usage );
- static Surface^ CreateDepthStencilEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, MultisampleType
multisampleType, int multisampleQuality, bool discard, Usage usage, [Out]
System::IntPtr% sharedHandle );
+ static Surface^ CreateDepthStencilEx( SlimDX::Direct3D9::DeviceEx^
device, int width, int height, Format format, MultisampleType
multisampleType, int multisampleQuality, bool discard, Usage usage,
System::IntPtr% sharedHandle );

/// <summary>Loads a surface from memory.</summary>
/// <param name="surface">The destination surface that will receive the
image.</param>
Reply all
Reply to author
Forward
0 new messages