Results 1 to 9 of 9

Thread: D3D8 CreateDevice call....

  1. #1

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228

    D3D8 CreateDevice call....

    I am making a call to the CreateDevice function and im having a problem...

    Code:
    if( FAILED( d3d->CreateDevice(D3DADAPTER_DEFAULT,
                                                     D3DDEVICETYPE_REF, hWnd,
                                                D3DSOFTWARE_VERTEXPROCESSING,
                                                     &d3dpp, &d3ddev) ) )
        return E_FAIL;
    When i run the program (which compiles fine) it cause an unhandled exception and the debugger says its in the "&d3dpp, &d3ddev) ) )" line....... what is causing this error???

    d3ddev is a valid LPDIRECT3DDEVICE8 and d3dpp is D3DPRESENT_PARAMETERS... d3d is a D3D8 object... whats wrong???
    To protect time is to protect everything...

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Most likely the call to Direct3DCreate failed and p3d is a NULL pointer.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Zaei
    Guest
    Why are you creating a REF device?

    Z.

  4. #4

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    I am setting it to D3DDEVICETYPE_REF instead of D3DDEVICETYPE_HAL b/c my computer sux and its graphics car doesnt support HAL rendering...

    I did some trial and error and found that the reason for the error was that the hWnd passed to the function was NULL... for some reason the CreateWindow function isnt working... But i causes no error????
    To protect time is to protect everything...

  5. #5
    Zaei
    Guest
    Post the window creation code, so we can take a look at it =).

    Go buy a new card =). Even my 6 year old ATI Rage Pro supports HAL to some extent.

    Z.

  6. #6

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Ok, heres the code to the Create Window function:
    Code:
    HWND hWnd = CreateWindow( wc.lpszClassName, "", WS_OVERLAPPEDWINDOW, 
    100, 100, 500, 400, GetDesktopWindow(), NULL, hInstance, NULL );
    theres nothing wrong with it that i can tell, it has the same stuff as other examples. The hWnd just keeps returning NULL.

    Yeah, i am writing this on my older computer, which has a ATI Rage Pro also, and when i try to run HAL it says no suitable device found. I have my program set to do either HAL or REF depending on a bool variable that will be loaded from a config file. I am just using REF for debugging purposes.
    To protect time is to protect everything...

  7. #7
    Zaei
    Guest
    Get the latest drivers, from the ATI site.

    Z.

  8. #8

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Ok...

    Anyway... I fixed my problem. I was using a struct to hold all of my d3d objects and when i went to ZeroMemory the d3dpp it ZeroMemoried the whole struct... so i fixed that.
    To protect time is to protect everything...

  9. #9
    Zaei
    Guest
    Ahhh. That makes sense =).

    Z.

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