Archived

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

BRZGames

2 Questions on DirectDirectDraw

Recommended Posts

BRZGames    122
I have 2 question/problems with DirectDraw. First, in my game (this is all VB code), I was originally creating all of my surfaces using CreateSurfaceFromFile (everything worked fine.) I later compressed the files using an RLE format, and read them in myself, created the surface manually (using the same surface descriptor as before), locked the surface, wrote to the surface, and unlocked it. This kept giving me an automation error, that when I looked up, mean''t I was out of Video Ram. So I pulled the locking, and unlocking of the surface out, and wrote to the surface using BltColorFill (this actually worked better since I''m using RLE encoded bitmaps), and it works fine. After more research, I''ve found that all I have to do to cause the error to occur is to lock, and unlock the surfaces while I''m creating surfaces (I.E., create surface x, then lock it, and then unlock it). If I never lock, or unlock the surface (at least while I''m still creating my array of surfaces, once they are all created, I don''t see the problem), I don''t get the error. And it never happens on the first frame, it may load 50+ frames of animation in before it occurs. If I would get the out of video ram error all the time, I would understand, but why would locking, and unlocking the surface cause this? Ok, here''s my next question. My game is written primarily to run in 16 bit color depth. Obviously, in full screen this is not an issue. My problem is if some runs my game in windowed mode, and they have there desktop resolution set to 32 bit, DirectDraw creates all of my surfaces at 32 bit. The game runs fine, but takes up more than twice then memory that 16 bit uses. Is there anyway to setup all of my offscreen surfaces to use 16 BPP, while leaving the resolution color depth at 32 BPP? Any help is greatly appreciated. Thanks.

Share this post


Link to post
Share on other sites