Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

(SOLVED)Error during device creation (D3DERR_NOTAVAILABLE)

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 vanattab   Members   

194
Like
0Likes
Like

Posted 24 September 2012 - 07:21 AM

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.WindowsImports SlimDX.Direct3D9Imports SlimDXImports Device = SlimDX.Direct3D9.DeviceImports Resource = SlimDX.Direct3D9.ResourceImports System.Windows.Forms.ThreadExceptionDialogImports System.IOPublic Class BaseDisplay Inherits RenderForm'SlimDX Class VarsProtected device As Device = NothingProtected backBuffer As SurfaceProtected presentParams As PresentParametersPublic Sub New() Show()End SubPublic 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) Me.device.BeginScene() backBuffer = device.GetBackBuffer(0, 0) Me.device.ColorFill(backBuffer, New Color4(Color.CornflowerBlue)) Me.device.EndScene() Me.device.Present()End SubPublic Overloads Sub Dispose() device.Dispose() MyBase.Dispose()End SubEnd Class[/source]

#2 vanattab   Members   

194
Like
0Likes
Like

Posted 24 September 2012 - 07:58 AM

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.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.