Jump to content
  • Advertisement
Sign in to follow this  

DX11 (SOLVED)Error during device creation (D3DERR_NOTAVAILABLE)

This topic is 2219 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to convert the SlimDX device creation tutorial from DX11 to DX9. It is a very simple tutorial where you create a windows add a dx9 device and fill the screen with a solid color. However I am getting a D3DERR_NOTAVAILABLE error thrown when I try and create the device. All the code seems to make sense and it looks very similar to the C# code used in the samples. Any Ideas? NOTE: I create a instance of the BaseDisplayclass and call the InitSlimDX method in another class.

[source lang="vb"]Imports SlimDX.Windows
Imports SlimDX.Direct3D9
Imports SlimDX
Imports Device = SlimDX.Direct3D9.Device
Imports Resource = SlimDX.Direct3D9.Resource
Imports System.Windows.Forms.ThreadExceptionDialog
Imports System.IO

Public Class BaseDisplay
Inherits RenderForm

'SlimDX Class Vars
Protected device As Device = Nothing
Protected backBuffer As Surface
Protected presentParams As PresentParameters

Public Sub New()
End Sub

Public Sub InitSlimDX()
Dim d3d As Direct3D = New Direct3D()
Dim primaryAdaptor As AdapterInformation = d3d.Adapters().First()

presentParams = New PresentParameters()
With presentParams
.BackBufferWidth = Me.ClientSize.Width
.BackBufferHeight = Me.ClientSize.Height
End With

Me.device = New Device(d3d, primaryAdaptor.Adapter, DeviceType.Hardware, Me.Handle, CreateFlags.HardwareVertexProcessing, presentParams)
backBuffer = device.GetBackBuffer(0, 0)
Me.device.ColorFill(backBuffer, New Color4(Color.CornflowerBlue))
End Sub

Public Overloads Sub Dispose()
End Sub
End Class[/source]

Share this post

Link to post
Share on other sites
I figured out what my problem was. Earlier I was messing with my DX9 settings in the DirectX control panel and for some reason I enabled the "Software Only" setting which disabled hardware acceleration. disabling this option fixed the issue. Thanks.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!