Jump to content
  • Advertisement

Archived

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

Gf11speed

Create Surface Failure

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

What are some things that would cause this to fail: lpdd->CreateSurface(&ddsd,&lpddsprimary,NULL)) ??? I''m not sure why all the sudden this is not working properly. Thanks... *==================* www.syntasoft.com *==================*

Share this post


Link to post
Share on other sites
Advertisement
chech out the MSDN, all failures return an error code that should give you a good idea of whats up.

Like nlo said it''s probably ddsd, make sure you''ve got it zero''d and set ddsd.dwSize to the size of the structure

zipless

Share this post


Link to post
Share on other sites

First, Zero the entire struct
i.e.
memset(&ddsd,0,sizeof(DDSURFACEDESC)); // or DDSURFACEDEC2 ??

then, set the SIZE !!!

ddsd.dwSize = sizeof(DDSURFACEDESC);

(I hope, it''s exactly like that. Maybe dwSize is member of another
struct-in-struct.)

Well, nearly all structs in DDRAW have a dwSize to set, before u use it.
I remember that I often forgot that... ;-)

Share this post


Link to post
Share on other sites
Gf11speed:

As the others have said, check the DDSD is zero''d and the size is set correctly.

Also check that the surface can be created in the mode you''re trying to use etc.


The easiest ways to find out why DirectX is failing a call:

1) Install the DEBUG runtimes (you get the option at installation time on all versions of the SDK).

2) Check the return code from the return call. A return of DDERR_INVALIDPARAMS tells you it''s unhappy about the parameters. A return of DDERR_UNSUPPORTED tells you the API/driver/hardware doesn''t support the mode you''re trying to create. etc etc

3) After you''ve ensured you have the debug version of the SDK installed, go to the DirectX SDK applet in the control panel, under the DirectDraw tab, move the debug level slider to maximum (also do the same under the Direct3D tab if you''re using DX8).

4) Run your application in the debugger (F5 in MSVC) and look at the debug output window. DirectDraw will tell you in there *exactly* why it failed your call.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
The exact return value that I am getting is DDERR_NODIRECTDRAWHW. I am going to try what you said with the DEBUG level in control panel.

*==================*
www.syntasoft.com
*==================*

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!