Jump to content
  • Advertisement
Sign in to follow this  
Chimmeke

Some DirectX Warnings

This topic is 2530 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,

i get some directx warnings when probably when creating the d3ddevice9. firstly these warnings occur:
Direct3D9: (WARN) :No SW device has been registered. GetAdapterCaps fails.
D3D9 Helper: IDirect3D9::GetDeviceCaps failed: D3DERR_NOTAVAILABLE
Direct3D9: (WARN) :Invalid backbuffer format specified


and finally i have thousands of these warnings which are always the same:
Direct3D9: (WARN) :Stream 0 stride and vertex size, computed from the current vertex declaration or FVF, are different, which might not work with pre-DX8 drivers

and this error:


Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present


has anybody encountered this problem before?
many thanks in advance.

edit: for some reason the error doesn't occur anymore.

Share this post


Link to post
Share on other sites
Advertisement
sorry guys for double-posting, but this thread slowly starts to disappear... if you need more information - tell me.

Share this post


Link to post
Share on other sites
As for the first two errors it would be useful to see the code that you are using to create for device, it seems that its complaining that there is not a Software Device registered, are you creating the device with the SOFTWARE or HARDWARE flag? The second error is comlpaining about the storage format of the backbuffer texture, it would be useful to see where you are creating that as some formats are not supported by all machines.

The third one seems to be that your FVF's that you used to create your vertex buffers do not fit the ones you are using to draw primitives with, again it would be useful to see where you create and define your FVF's and then how you use them in the draw call.

Cheers.

Share this post


Link to post
Share on other sites
thanks for your response! the code where i create the device:

ZeroMemory(&PresentParams, sizeof(D3DPRESENT_PARAMETERS));
PresentParams.BackBufferWidth = Config->Direct3D.Videomode.Width;
PresentParams.BackBufferHeight = Config->Direct3D.Videomode.Height;
PresentParams.BackBufferFormat = Config->Direct3D.BackbufferFormat;
PresentParams.BackBufferCount = 1;
PresentParams.MultiSampleType = Config->Direct3D.MultiSampleType;
PresentParams.MultiSampleQuality = Config->Direct3D.MultiSampleQuality-1;
PresentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
PresentParams.hDeviceWindow = Window;
PresentParams.Windowed = Config->Direct3D.Windowed;
PresentParams.EnableAutoDepthStencil = TRUE;
PresentParams.AutoDepthStencilFormat = Config->Direct3D.ZStencilbufferFormat;
PresentParams.Flags = Config->Direct3D.Flags;
PresentParams.FullScreen_RefreshRateInHz = Config->Direct3D.Windowed ? D3DPRESENT_RATE_DEFAULT : Config->Direct3D.Videomode.RefreshRate;
PresentParams.PresentationInterval = Config->Direct3D.V_SyncEnabled ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;

// Create Device
HRESULT hRes;
if (FAILED(hRes = D3D->CreateDeviceEx(Config->Direct3D.AdapterID, Config->Direct3D.DeviceType,
Window, Config->Direct3D.Flags, &PresentParams, NULL, &D3DDevice)))
{
ex_ERROR_DIRECTX("Error when creating D3DDevice!", hRes);
return ex_ERROR;
}

PDIRECT3DDEVICE9EX D3DDevice;
D3DPRESENT_PARAMETERS PresentParams;


this magic Config is just a struct that contains the parameters for the presentation-struct. when i debugged the parameters were the following:
PresentParams.BackBufferWidth = 1366;
PresentParams.BackBufferHeight = 768;
PresentParams.BackBufferFormat = D3DFMT_R5G6B5;;
PresentParams.BackBufferCount = 1;
PresentParams.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES;
PresentParams.MultiSampleQuality = 0;
PresentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
PresentParams.hDeviceWindow = Window;
PresentParams.Windowed = TRUE;
PresentParams.EnableAutoDepthStencil = TRUE;
PresentParams.AutoDepthStencilFormat = D3DFMT_D24S8;
PresentParams.Flags = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE;
PresentParams.FullScreen_RefreshRateInHz = 0;
PresentParams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;


the devicetype was D3DDEVTYPE_HAL.
my machine should support all these parameters. i took a look on the caps viewer to check the videomodes:
capsi.jpg
the last entry shows that my settings are so far accepted. of course the rest (linke z-stencilbuffer format) aren't considered here, but i assure you that the rest is compatible.

now to the drawing of y triangle:

the vertexstruct:
// +++++++++++++++++++++++++++
// Vertexstruct
struct TestVertex
{
exVector3 Position;
exColor Color;
static const DWORD FVF;
};

const DWORD TestVertex::FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;

TestVertex Vertices[3];


the init:
// Set FVF
if (FAILED(hRes = D3DDevice->SetFVF(TestVertex::FVF)))
{
ex_ERROR_DIRECTX("Error when setting FVF", hRes);
return ex_ERROR;
}


the drawing;

D3DDevice->BeginScene();

// Draw triangle
if (FAILED(hRes = D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 1, Vertices, sizeof(TestVertex))))
{
ex_ERROR_DIRECTX("Error when drawing the triangle!", hRes);
return ex_STOP;
}

D3DDevice->EndScene();


hope i havn't forgotten anything...

Share this post


Link to post
Share on other sites

// +++++++++++++++++++++++++++
// Vertexstruct
struct TestVertex
{
exVector3 Position;
exColor Color;
static const DWORD FVF;
};

const DWORD TestVertex::FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;


Will have to look at the other errors more, but as for this one; is it possible that your custom types 'exVector3' and 'exColor' are differently sized to the expected sizes defined by 'D3DFVF_XYZ' etc? Either through being explicitly different or something like structure padding? Would maybe worth trying just pain old D3DXVECTOR3 and D3DXCOLOR to see if that same thing happens.

Cheers.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!