Advertisement

I'M AT MY WITS END!!!

Started by December 31, 2000 08:47 PM
17 comments, last by Shazer 24 years ago
May I suggest that when you post a question you state at least the topic in the subject line. You''ll find you get more help that way.

BTW If you''re not at you wits end then your not a programmer
codeXtremeif(you->intelligence < radish->intelligence) you->STFU();
You have set the palette for the surface you are blitting right? If you havent a clue what im on about, look up the DDSetColorKey function in the DDUtils { ddutil.h & ddutil.cpp }. If you dont have the DDUtils: Get them!
jumble-----------
Advertisement
I am using 16bit, so I am not using a pallete. I am correct in that... right??

The Shaz



"I don''t want to be a pie... I don''t like gravy." - Babbs, Chicken Run

SuperNova Games
Optimism is not a state of mind, but a form of life!SuperNova Games
Hey,

may be this sound stupid, but have u checked your initializing code for

1) clearing the surface description with memset or ZeroMemory

2) setting the size filed with ddsd.dwSize=sizeof(...)

I forgot one of them one time and had a lot time to search for error cause its so trivial.

Hope its such an easy error

Keep on working !!!

Haeberle

haNg loOse ¿
I think you''ve got to specify a destination rectangle for surface (not colorfill) blits. Not sure about that though. Try specifying a destination rectangle for your background. Make sure that you have created all your surfaces correctly.



''Smile, things could get worse.''
So I smiled, and they did.


sharewaregames.20m.com

Well, I have another idea what it could be...

When you want to use Backbuffers, you have to create the Primary Surface complex. Therefore you need to modify the flags of the DDSurfaceDescription structure as well as the capability tab.
After creating the Primary Surface, you get a pointer to the Backbuffer Surface by calling the Primary Surface's GetAttachedSurface function.
Your whole Surface initialization code should look pretty much like this:

    DDSURFACEDESC ddsd;LPDIRECTDRAWSURFACE lpDDPrimary;LPDIRECTDRAWSURFACE lpDDBackbuffer;DDSCAPS ddscaps;// set the whole thing to zeroZeroMemory( &ddsd, sizeof( DDSURFACEDESC ) );// obligatory: DD has to know the struct's sizeddsd.dwSize = sizeof( DDSURFACEDESC );// set the flags: Caps and BackbufferCount contain infoddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;// now fill the capsddsd.ddsdCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |  // primary surface                       DDSCAPS_FLIP |            // flippable                       DDSCAPS_COMPLEX |         // surface is complex                       DDSCAPS_VIDEOMEMORY;      // surface is in video memory// set Backbuffer Count: double buffering, so one backbufferddsd.dwBackBufferCount = 1;// create primary bufferHRESULT hr = lpDD->CreateSurface( &ddsd, &lpDSPrimary, NULL );// error checking goes here// zero the cute lil' thingZeroMemory( &ddscaps, sizeof( ddscaps ) );// set the appropriate caps fieldddscaps.dwCaps = DDSCAPS_BACKBUFFER;// now get the attached backbufferhr = lpDDPrimary->GetAttachedSurface( &ddscaps, &lpDDBackbuffer );// error checking goes here    


Now the thing should work. If the error remains or if your init code is right, please post again, with an excerpt of your init code too. Then we'll see whether there's a solution.

HTH
pi~

Edited by - thepi on January 7, 2001 12:06:17 PM
Jan PieczkowskiBrainwave Studios
Advertisement
You dont have to specify any rects for blitting, furby.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."

The Micro$haft BSOD T-Shirt
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
well he has to if he wants only to blit a certain area (i.e. a small object)

pi~
Jan PieczkowskiBrainwave Studios
Right off, I''d like to thank you all for your ongoing attempts to help me! I''m sure this will not be the last time I run into a wall. I figured out what was wrong. Neonstar was correct. The surfaces were locked, via a couple HDCs. I forgot to release them after I finished using them. Sorry to have wasted all your time with something so trivial, but the problem is solved, AND I WANT TO THANK YOU ALL FOR IT!!!

The Shaz



"I don''t want to be a pie... I don''t like gravy." - Babbs, Chicken Run

SuperNova Games
Optimism is not a state of mind, but a form of life!SuperNova Games

This topic is closed to new replies.

Advertisement