Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Why doesnt this work? all the variables are set to default however ive tried adjusting the windowed variable neither work can anyone please help me... using managed dx

public class dx9
Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Imports System.Windows.Forms
public d3ddevice as device
   Private TargetForm As Form
   Private sWidth As Long
   Private sHeight As Long
   Public Sub Initialize(Optional ByVal windowed As Boolean = False, Optional ByVal ScreenWidth As Long = 1280, Optional ByVal ScreenHeight As Long = 1024, Optional ByVal ColorFormat As Long = 33)
       Dim d3dpp As New PresentParameters
       TargetForm = New Form
       TargetForm.Show()
       TargetForm.Focus()
       d3dpp.Windowed = windowed
       sWidth = ScreenWidth
       sHeight = ScreenHeight
       d3dpp.BackBufferCount = 1
       d3dpp.BackBufferFormat = ColorFormat
       d3dpp.BackBufferHeight = ScreenHeight
       d3dpp.BackBufferWidth = ScreenWidth
       d3dpp.SwapEffect = SwapEffect.Copy
       D3DDevice = New Device(0, DeviceType.Hardware, TargetForm, CreateFlags.SoftwareVertexProcessing, d3dpp)
   End Sub
end class

note that when it errors is allways the last line = new device .....

with the following error:

An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidCallException' occurred in microsoft.directx.direct3d.dll

 

Additional information: Error in the application.

Posted

k Stupid me

 

Fixed it for windowed mode

 

If Not windowed Then

d3dpp.BackBufferCount = 1

d3dpp.BackBufferFormat = ColorFormat

d3dpp.BackBufferHeight = ScreenHeight

d3dpp.BackBufferWidth = ScreenWidth

End If

 

But i dont really want windowed mode,... how do i get full screen to work?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...