Jump to content
  • Advertisement
Sign in to follow this  

[SlimDX]Problem with Initializing Direct3D in VB.Net

This topic is 3022 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 have been following Axiverse's tutorials over here: http://www.gamedev.net/community/forums/topic.asp?topic_id=509329
and I have got a problem with the code but I can't seem to get it to fix, here is the source code:
Imports SlimDX
Imports SlimDX.Direct3D11
Imports SlimDX.DXGI
Imports Device = SlimDX.Direct3D11.Device
Public Class GameCls
Private Sub Main(ByVal rendForm As Form)
Dim factory As New Factory
Dim mode As New ModeDescription
mode.Format = Format.R8G8B8A8_UNorm
mode.RefreshRate = New Rational(60, 1)
mode.Scaling = DisplayModeScaling.Unspecified
mode.ScanlineOrdering = DisplayModeScanlineOrdering.Unspecified
mode.Width = rendForm.Width
mode.Height = rendForm.Height
Dim sample As SampleDescription
sample.Count = 1
sample.Quality = 0
Dim swap As SwapChainDescription
swap.ModeDescription = mode
swap.SampleDescription = sample
swap.BufferCount = 1
swap.Flags = SwapChainFlags.None
swap.IsWindowed = True
swap.OutputHandle = rendForm.Handle
swap.SwapEffect = SwapEffect.Discard
swap.Usage = Usage.RenderTargetOutput
Dim device As New Device(DeviceCreationFlags.None)
Dim swapChain As New SwapChain(factory, device, swap)
Dim rendTarget As New RenderTargetView(device, ****swapChain.GetBuffer(Of Texture2D)****(0))
End Sub
End Class
PROBLEM: ****swapChain.GetBuffer(Of Texture2D)****
That's the Problem.
Thanks in advance

PS: I converted the source code and then followed the tutorial and there is the same error withe Original Tutorial.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!