Surfaces bigger than primary?

Started by
4 comments, last by JZ... 24 years, 1 month ago
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...
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
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!
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)
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
thanks - Ill try the surface as system memory and see how bad it starts droppin frames.

I appreciate the help!

JZ...

This topic is closed to new replies.

Advertisement