Sign in to follow this  

Qt Application - CreateDevice just returns D3DERR_INVALIDCALL

This topic is 3585 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

Hi. Im going nuts! I can do what I want, I just get an D3DERR_INVALIDCALL from CreateDevice. First of all, I created a dialog with qt where I can choose d3d stuff, like resolution, refresh rate, back fmt, depth/stencil fmt and so on... Everything works just fine. I get a Direct3d Object and I can do the whole enum stuff. But when I want to use the choosen values from the dialog, the device creation function just rejects my requests. Here is the dialog: diag and here is the present parameters struct, filled. diag I also tryed all vertex processing flags. In qt I get the hwnd id via winId() from the central widget of my main window. Thanks Alex

Share this post


Link to post
Share on other sites
Ok, I found it!

Man!

The refresh rate must be zero, if the present parameter flag "windowed" is true!

I found out how to enable the debug library!
I searched ages for this information, and finaly found it in the docs.

Thanks anyway
Alex

Share this post


Link to post
Share on other sites
If you're familiar with the enum routines, fill the present parameters with the desired values and write the present parameters structure to a file.

fwrite(&mpp,sizeof(mpp),1,filePtr);

Is that what you're asking?

Share this post


Link to post
Share on other sites
Quote:
Original post by directNoob
Hi, thanks.

Actually, I think I know how to write this into a file.
I mean the dx debug info, for example.
Or is this done automatically by dx?

Thanks
Alex
DirectX won't write anything to a file for you, no. Also, This is extremely relevant to your interests. Particularly since the example I give will be almost exactly the same problem you had in this case [smile]

Share this post


Link to post
Share on other sites
Hi Evil Steve.

This nice piece of information comes a bit to late!
I found the entry in the dx docs, where it is described how to enable the debug information.

I think I did well in enumerating my device with my dialog. It works just perfectly.

But, my concern now is, how can I get the debug information from dx?! - in order to write it into a file.

For example.
In OGL I can call a gl function ( glGetError or how it is called) after another gl function to retrieve debug/error information.

Is there any similar facility other than SUCCEEDED/FAILED to evaluate the success of dx functions, i.e getting the debug information?

Thanks
Alex

Share this post


Link to post
Share on other sites
Quote:
Original post by directNoob
For example.
In OGL I can call a gl function ( glGetError or how it is called) after another gl function to retrieve debug/error information.

Is there any similar facility other than SUCCEEDED/FAILED to evaluate the success of dx functions, i.e getting the debug information?
You'd have to do that yourself, via something like:

g_lastError = pDevice->SomeFunc();
if(FAILED(g_lastError))
{
//...
}


There's DXGetErrorString and DXGetErrorDescription, which will give you a string error from a HRESULT code, but you need to have the result to pass to the function, there's no "last error" functionality like in OpenGL, or Win32's GetLastError().

Share this post


Link to post
Share on other sites

This topic is 3585 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this