Results 1 to 4 of 4

Thread: [RESOLVED] why does dx messup my desktop all the time

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Resolved [RESOLVED] why does dx messup my desktop all the time

    ive been staying away of dx stuff because it messes up my desktop,does dx use low resolution or something?
    and is there away to backup your desktop with vb6 for future bad happingings?
    thanks

  2. #2
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: why does dx messup my desktop all the time

    It shouldnt mess up your desktop. When you make a dx app and have it fullscreen, exiting out should put the screen resolution back the way it was without moving your desktop icons. It might depends on what OS you are using too. I'm using Windows 7 Pro 64 bit and it doesnt affect my desktop nor on Windows XP Pro 32 bit. Windows 98 and below maybe. It'll also depend how you are exiting out of your DX program. For example in this, it should exit out fine:

    vb Code:
    1. Option Explicit
    2.  
    3. Private Const COLOR_DEPTH_16_BIT As Long = D3DFMT_R5G6B5
    4. Private Const COLOR_DEPTH_24_BIT As Long = D3DFMT_A8R8G8B8
    5. Private Const COLOR_DEPTH_32_BIT As Long = D3DFMT_X8R8G8B8
    6.  
    7. Private DirectX8 As DirectX8
    8. Private Direct3D As Direct3D8
    9. Private Direct3D_Device As Direct3DDevice8
    10.  
    11. Private Running As Boolean
    12.  
    13. Private D3DParams As D3DPRESENT_PARAMETERS
    14.  
    15. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    16.  
    17.     If KeyCode = vbKeyEscape Then
    18.    
    19.         Running = False
    20.        
    21.         Set Direct3D_Device = Nothing
    22.         Set Direct3D = Nothing
    23.         Set DirectX8 = Nothing
    24.        
    25.         Unload Me
    26.    
    27.     End If
    28.  
    29. End Sub
    30.  
    31. Private Sub Form_Load()
    32.  
    33.     Me.Show
    34.  
    35.     Dim Display_Mode As D3DDISPLAYMODE
    36.     Dim Direct3D_Window As D3DPRESENT_PARAMETERS
    37.  
    38.     frmMain.Caption = "DirectX Tutorial"
    39.    
    40.     Set DirectX8 = New DirectX8
    41.     Set Direct3D = DirectX8.Direct3DCreate()
    42.    
    43.     Display_Mode.Width = 800
    44.     Display_Mode.Height = 600
    45.     Display_Mode.Format = COLOR_DEPTH_16_BIT
    46.  
    47.     Direct3D_Window.Windowed = False
    48.     Direct3D_Window.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC
    49.     Direct3D_Window.BackBufferCount = 1
    50.     Direct3D_Window.BackBufferFormat = Display_Mode.Format
    51.     Direct3D_Window.BackBufferWidth = Display_Mode.Width
    52.     Direct3D_Window.BackBufferHeight = Display_Mode.Height
    53.     Direct3D_Window.hDeviceWindow = frmMain.hWnd
    54.    
    55.     D3DParams = Direct3D_Window
    56.    
    57.     Set Direct3D_Device = Direct3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, Direct3D_Window)
    58.  
    59.     Running = True
    60.  
    61.     Do While Running = True
    62.        
    63.         'Check if we have the device
    64.         If Direct3D_Device.TestCooperativeLevel <> D3D_OK Then
    65.             'Do a loop while device is lost
    66.             Do While Direct3D_Device.TestCooperativeLevel = D3DERR_DEVICELOST
    67.                 'Let windows do it's stuff
    68.                 DoEvents
    69.             Loop
    70.             'Reset the device
    71.             Direct3D_Device.Reset D3DParams
    72.         End If
    73.        
    74.         Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(0, 0, 0, 0), 1#, 0
    75.        
    76.         Direct3D_Device.Present ByVal 0, ByVal 0, 0, ByVal 0
    77.        
    78.         DoEvents
    79.        
    80.     Loop
    81.  
    82.  
    83. End Sub
    84.  
    85. Private Sub Form_Unload(Cancel As Integer)
    86.  
    87.     Running = False
    88.    
    89.     Set Direct3D_Device = Nothing
    90.     Set Direct3D = Nothing
    91.     Set DirectX8 = Nothing
    92.    
    93.     Unload Me
    94.    
    95. End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Re: why does dx messup my desktop all the time

    im useing win xp home ,it only happens on some downloaded programs from psc.com
    ive never tried dx yet,but thanks

  4. #4
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: [RESOLVED] why does dx messup my desktop all the time

    Also you could try updating your video drivers, or even on your desktop Arrange Icons By Name / Type and see if itll still affect it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width