Hi Guys,
I'm trying to use the StretchRectangle of DirectX3D in window mode, and it throws and exception.
Any ideas?
Here is the relevant code parts:
d3dpp.Windowed = true;
m_localDevice = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, m_owner, CreateFlags.SoftwareVertexProcessing, d3dpp);
---------------------------
m_deviceSurface = m_localDevice.GetBackBuffer(0, 0, BackBufferType.Mono);
Bitmap bmpLayout = new Bitmap("layout.png");
// make sure we have the background viewed
m_srfcLayout = new Surface(m_localDevice, bmpLayout, Pool.Default);
----------------------------------------------------
m_localDevice.BeginScene();
//viewBmp(ref m_srfcLayout, 0, 0);
m_localDevice.Clear(ClearFlags.Target, Color.Blue, 0, 0);
//m_localDevice.StretchRectangle(m_srfcLayout, new Rectangle(1, 1, 100, 100), m_deviceSurface, new Rectangle(m_owner.Left + 100, m_owner.Top + 20, 100, 100), TextureFilter.None);
m_localDevice.StretchRectangle(m_srfcLayout, new Rectangle(1, 1, 100, 100), m_deviceSurface, new Rectangle(100, 20, 100, 100), TextureFilter.None);
m_localDevice.EndScene();
m_localDevice.Present();
I'm trying to use the StretchRectangle of DirectX3D in window mode, and it throws and exception.
Any ideas?
Here is the relevant code parts:
d3dpp.Windowed = true;
m_localDevice = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, m_owner, CreateFlags.SoftwareVertexProcessing, d3dpp);
---------------------------
m_deviceSurface = m_localDevice.GetBackBuffer(0, 0, BackBufferType.Mono);
Bitmap bmpLayout = new Bitmap("layout.png");
// make sure we have the background viewed
m_srfcLayout = new Surface(m_localDevice, bmpLayout, Pool.Default);
----------------------------------------------------
m_localDevice.BeginScene();
//viewBmp(ref m_srfcLayout, 0, 0);
m_localDevice.Clear(ClearFlags.Target, Color.Blue, 0, 0);
//m_localDevice.StretchRectangle(m_srfcLayout, new Rectangle(1, 1, 100, 100), m_deviceSurface, new Rectangle(m_owner.Left + 100, m_owner.Top + 20, 100, 100), TextureFilter.None);
m_localDevice.StretchRectangle(m_srfcLayout, new Rectangle(1, 1, 100, 100), m_deviceSurface, new Rectangle(100, 20, 100, 100), TextureFilter.None);
m_localDevice.EndScene();
m_localDevice.Present();