Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Scarface5013

why E_OUTOFMEMORY ??

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

before creating a device, i''m checking it with CheckDeviceType. i get ok for D3DDEVTYPE_HAL, but if i want to create a device with this value i get a E_OUTOFMEMORY failure. what''s wrong?

Share this post


Link to post
Share on other sites
Advertisement
smells like driver problem.
or so.
if other d3d stuff work, you have wrong code.
maybe resolution too high or something else.
post the actual values for create.
bye,

--- foobar
We push more polygons before breakfast than most people do in a day

Share this post


Link to post
Share on other sites
other stuff is working fine. the resoluion can''t be to high, cause if i use 320x200 is the same problem. the error only occures if i use the secundary device. for primary the code is working fine. so the problem must be the device. but i can''t understand why i get an error after checkingand using. what does it mean E_OUTOFMEMORY? could the format be wrong? but i enumerate it so normaly it must be supported or?

Share this post


Link to post
Share on other sites
hm.
whats your primary, whats your secondary device?
REF should always work -- that dont count
maybe you try something like windowed with a voodoo or 32-bit z-buffer or anything like that?
do you also verify the format you are using?
are you sure your secondary display supports 320x200, maybe only 320x240...
dont know.
please post the entire CreateDevice() call with the all values that you set in the D3DPRESENT_PARAMETERS struct.

and: E_OUTOFMEMORY means just as it reads (E_OUTOFMEMORY
Direct3D could not allocate sufficient memory to complete the call. -- the SDK), but dont expect the HRESULTS to be 100% exact. could possibly mean 100 other things.

besides, docs for CreateDevice() only list D3DERR_INVALIDCALL, D3DERR_NOTAVAILABLE and D3DERR_OUTOFVIDEOMEMORY as possible error-codes -- so getting E_OUTOFMEMORY already means you cant count on it being correct error-code for the problem.

bye,

--- foobar
We push more polygons before breakfast than most people do in a day

Share this post


Link to post
Share on other sites
you want code, here it is :
perhaps it''s realy a driver problem, because on an other computer it works fine. but not for all enumerated modes. the highest one won''t work. hate this

HRESULT failure;
CleanupD3D();
d3dpp.BackBufferWidth = avaiableModi[numSelected].Width;
d3dpp.BackBufferHeight = avaiableModi[numSelected].Height;
d3dpp.BackBufferFormat = avaiableModi[numSelected].Format;
g_pD3D = Direct3DCreate8( D3D_SDK_VERSION );
failure = g_pD3D->CreateDevice( SelectedAdapter - 1,
getSupportedDeviceType( SelectedAdapter - 1, avaiableModi[numSelected].Format, avaiableModi[numSelected].Format),
// D3DDEVTYPE_REF,
hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pd3dDevice );
if ( ( failure != S_FALSE) && ( failure != D3D_OK) )
{
fprintf(protokoll, DXGetErrorString8A(failure));
fclose(protokoll);
exit(0);
}




//-----------------------------------------------------------------------------
// Name:
// Desc:
//-----------------------------------------------------------------------------
D3DDEVTYPE getSupportedDeviceType( int AdapterNum, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat)
{
fprintf(protokoll, "%d AdapterNum.\n", AdapterNum);
if ( ( g_pD3D->CheckDeviceType( AdapterNum, D3DDEVTYPE_HAL, DisplayFormat, BackBufferFormat, TRUE) ) )
{
fprintf(protokoll, "D3DDEVTYPE_HAL found.\n");
return D3DDEVTYPE_HAL;
}
if ( SUCCEEDED( g_pD3D->CheckDeviceType ( AdapterNum, D3DDEVTYPE_REF, DisplayFormat, BackBufferFormat, TRUE) ) )
{
fprintf(protokoll, "D3DDEVTYPE_REF found.\n");
return D3DDEVTYPE_REF;
}
if ( SUCCEEDED( g_pD3D->CheckDeviceType ( AdapterNum, D3DDEVTYPE_SW, DisplayFormat, BackBufferFormat, TRUE) ) )
{
fprintf(protokoll, "D3DDEVTYPE_SW found.\n");
return D3DDEVTYPE_SW;
}
}

Share this post


Link to post
Share on other sites
btw, you should NEVER fallback to the ref rastirizer. simply because most ppl will thinks its because your app is slow and not because there hardware is not up to snuff. the REF rastirizer is only for testing thing that you cant test because your hardware dont support it or for making sure your driver is displaying the correct behavior/output according to the microsoft specs for d3d compatiblity. you should comment the code out that allows ref to be used when distributing your software (espeically since only ppl with the dx sdk will probally even have the ref driver installed).

Share this post


Link to post
Share on other sites
I had the exact same problem, reinstalled my video card drivers and it went away. With a GF2 Ultra using the latest nVidia drivers.

Very odd indeed.

Share this post


Link to post
Share on other sites
I had that problem a while ago. I think it was because the video card didn''t have 3D capability. This was on a pooter which had 2 cards - a Matrox Productiva G400 (2D only) and a Dimond Monster 3D. I was trying to create a HAL device for the 2D card.

HTH, Steve

Share this post


Link to post
Share on other sites

  • 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!