• Advertisement

Archived

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

Surfaces bigger than primary?

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

first off - im new to DirectX - I got the basics down (kinda), but im trying to load a bmp that has a series of frames of animation into my game and it fails if the surface is bigger than 640x480 ,which is the size of my primary surface. Is that suppose to happen? and if so are there any work-arounds? I really dont want to have to make a separate surface for every frame. Any suggestions? JZ...

Share this post


Link to post
Share on other sites
Advertisement
Unfortunately, most hardware does not support surfaces which are larger than the primary. I believe there is a workaround though: It should work if you tell DDraw to put the surface in sytem memory (If i''m remembering correctely). There will probably be a bit of a performance hit, but it shouldn''t be too big.

--TheGoop

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
TheGoop is on track, most hardware will have a hard time with "wide surfaces"(surfaces longer/wider than the primary surface). But you can help by setting the DDSCAPS2 flag, DDSCAPS2_WIDESURFACES when creating the wide surface. I''m also a newbie, so I know how you feel. Good luck!

Share this post


Link to post
Share on other sites
If I remember correctly, u must force specify the surface to be in system memory.

There will be a *big* performance hit, unless, the surface you are bltting is small. Try using a full screen blt from system memory to vid memory (ie 640x480 pixels) and watch the frame rate DROP. (when doing parallex scrolling)

Share this post


Link to post
Share on other sites
ok, i think this is what you want...i got lazy so just cut some code out...hope it helps some though...

memset(&descMap,0,sizeof(DDSURFACEDESC));
descMap.dwSize = sizeof(DDSURFACEDESC);
descMap.dwFlags = DDSD_CAPS / DDSD_HEIGHT / DDSD_WIDTH;
descMap.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN / DDSCAPS_SYSTEMMEMORY;
descMap.dwWidth = **???????Set your width here**;
descMap.dwHeight = **???????Set your height here**;
if(lpDD->CreateSurface(&descMap,&lpDDMap,NULL)!= DD_OK)
MessageBox(hwnd,"CREATESURFACE, LPDDMAP FAILED","FAILURE",MB_OK);

have any questions about the code then just write back to this post.

-Phorisc

Share this post


Link to post
Share on other sites
thanks - Ill try the surface as system memory and see how bad it starts droppin frames.

I appreciate the help!

JZ...

Share this post


Link to post
Share on other sites

  • Advertisement