Results 1 to 12 of 12

Thread: direct x 8 error with D3DDevice.Present

  1. #1

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172

    direct x 8 error with D3DDevice.Present

    i use this code to finally display the renderd image

    D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0

    it worked until now what is wrong with this? it aint working anymore while i only added one .x object, removing this object and other code of it doesnt solve it
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  2. #2
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Post your code. There could be a donzen things wrong =).

    Z.

  3. #3

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    hang on Z will post it in a moment need to upload it to my own server or else it would be to big
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  4. #4

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    here it is .. it wasn't to big afterall
    Attached Files Attached Files
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  5. #5
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    NEVER debug your code in fullscreen mode. Add this line to your intialization code:
    Code:
    D3DWindow.Windowed = 1
    You will find your error in about 4 seconds. Again, NEVER, EVER debug code in Fullscreen mode. If it crashes, you are screwed. Every so often, when you are sure it is working, go ahead and run in fullscreen to make sure everything is wrking right, but for the rest of the time, Run in windowed mode.

    Z.

  6. #6

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    on what line do i have to add it? because i just get an automation error if at this line :
    Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)

    in another example i saw they had diffrent ways of initializing if you want to run it windowed :s
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  7. #7

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    or is this the error
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  8. #8
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Add the line I said before you go to intialize your Device. Make sure that the Adapter format you specify (in your project, it looked like D3DFMT_R5G6B5, which is a 16 bit format. if you are running Windows with 32 bit colors, you need to change the format specified to D3DFMT_X8R8G8B8). It should the initialize correctly, and then you can find your real error =).

    Z.

  9. #9

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    ok it was the 32 bit thing that kept me from using a window BUUUUUT.. now i dont have a error anymore and the program runs smooth :S. so please help me allong i get an error i cant handle in full screen and in windowed mode i dont have an error :S cant really find the REAL error than ey?
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  10. #10
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    =). Strange. For me, the Error was when you tried to call SetVertexShader 0, in DisplayXfile().

    Z.

  11. #11

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    here it is again, currently trying to move the light (unsucessfull and orientating the car (dx7 did it with .setorientation but cant find it in dx8) anyway try it again maybe you can then find the bug. :S
    Attached Files Attached Files
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  12. #12

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    I dont know what i did but after adding the ability to change the color depth and resolution and windowd and fullscreen, i dont have the error anymore (dunno what i did to fix it but it works) if you can still tell me what the error was i know how i fixed it . the only thing i added with out a real reason was :

    VB Code:
    1. If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D16) = D3D_OK Then
    2.     D3DWindow.AutoDepthStencilFormat = D3DFMT_D16
    3. Else
    4.    D3DWindow.AutoDepthStencilFormat = D3DFMT_D32 '< this line
    5. End If
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

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