Archived

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

Lenny

Direct Draw Surfaces

Recommended Posts

I am trying to create a surface in memory larger than my primary surface which is 640x480. So far I can make it any size I want as long as it does not go beyond 640 x 480. The surface size I want is 768x608 (I want to store bitmap graphics here) is this possible and if so how?

Share this post


Link to post
Share on other sites
You cannot create a surface larger than your primary surface in memory. As of ways around this I''m not sure. Have you tried creating an off-screen surface?

-Jer

Share this post


Link to post
Share on other sites
You can create a surface of any size you want! I can''t remember in which version of DirectX this was fixed, but I GUARAN-F*CKIN-TEE you can do it with DX7.

I''m sitting here looking at a surface that is 2048x2048.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Here''s a quote from the DirectDraw SDK help:

Creating Wide Surfaces
DirectDraw allows you to create off-screen surfaces in video memory that are wider that the primary surface. This is only possible when display device support for wide surfaces is present.

So I would assume that you can only create a wide surface without "display device support" in system memory.

So try something like this:
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;

Ugh..you''d think they are TRYING to make DirectDraw a pain to program with.

Share this post


Link to post
Share on other sites
On any card you could make the surface LONGER than your screen height, as long as you want it to be, but you can''t make it wider than the screen width unless the hardware supports it, which it usually doesnt so you shouldnt even bother.
so, 768x608 is no good
640x3200 is just fine

go figure
:o)



ByteMe95::~ByteMe95()

Share this post


Link to post
Share on other sites
Surfaces bigger than the primary surface can be created in system memory, at any size (as long as there is enough RAM and/or virtual memory).

To create surfaces bigger than the primary sufrace in video memory there has to be hardware support for it.

+AA_970+

Share this post


Link to post
Share on other sites
Check for :
quote:

DDCAPS2_WIDESURFACES : The display surface supports surfaces wider than the primary surface.


If it''s there, then you can try to make the surface in video memory. If it''s not there (or if the vidmem alloc fails due to low on vidmem), then you''ll have to make the surface in system memory.

...Syzygy

Share this post


Link to post
Share on other sites