Click here to Skip to main content
15,921,959 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: What font do you use when programming? Pin
cmk1-May-05 5:09
cmk1-May-05 5:09 
QuestionWhy does my MFC EXE fail to run in Win XP and Win 2000? Pin
Sstar29-Apr-05 18:00
Sstar29-Apr-05 18:00 
QuestionHOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
King 149340029-Apr-05 17:29
King 149340029-Apr-05 17:29 
AnswerRe: HOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
Anonymous29-Apr-05 20:22
Anonymous29-Apr-05 20:22 
Answerbut you are you shouting ???? Pin
Anonymous29-Apr-05 20:23
Anonymous29-Apr-05 20:23 
GeneralRe: but you are you shouting ???? Pin
ThatsAlok29-Apr-05 21:22
ThatsAlok29-Apr-05 21:22 
AnswerRe: HOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
David Crow30-Apr-05 6:33
David Crow30-Apr-05 6:33 
GeneralProblem with flipping DDraw surfaces Pin
Kieroshark29-Apr-05 17:21
Kieroshark29-Apr-05 17:21 
Hey, so I am having a lot of trouble with DirectDraw surfaces.

I set up my surfaces like this

LPDIRECTDRAWSURFACE7 lpdds; // Primary DD Surface.<br />
LPDIRECTDRAWSURFACE7 lpddsBack; // Back Buffer.<br />
DDSURFACEDESC2 ddsd;<br />
<br />
INIT_DDRAW_STRUCT(ddsd); // Macro which clears out ddsd and sets dwSize.<br />
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;<br />
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;<br />
ddsd.dwBackBufferCount = 1;<br />
<br />
if (FAILED(lpdd->CreateSurface(&ddsd, &lpdds, NULL)))<br />
	return 105;<br />
<br />
ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;<br />
	<br />
if (FAILED(lpdds->GetAttachedSurface(&ddsd.ddsCaps, &lpddsBack)))<br />
	return 106;


Now I attach a clipper to the back buffer. I then Blt() some pictures from a LPDIRECTDRAWSURFACE7 (created using the dwCaps value DDSCAPS_OFFSCREENPLAIN) to the back buffer. Next, I call:
if (FAILED(lpdds->Flip(NULL, DDFLIP_WAIT)))<br />
	return 201;


When I do that, the images I Blitted are displayed, and everything is fine. I then Blt() some more images onto the back buffer for the next frame of animation. When I call the flip command, my screen turns black. It's as if I cannot Blt() anything to the memory originally associated with lpdds (primary surface). D'Oh! | :doh:

The really odd thing though, is that I have error checking on all my DirectDraw calls(With FAILED()) and nothing is returning an error.

Also, a few other pieces of misc data that might be useful, the LPDIRECTDRAWSURFACE7's are actually members of a class called GraphicsEngine. This class is in a .h file I am writing, but I am making the Flip() and Blt() calls from the main .cpp file. (I made everything public until I fix this problem)

If anyone can help me with fixing this, I'd really appricate it. Frown | :(
Generaldesign membership function Pin
Anonymous29-Apr-05 17:21
Anonymous29-Apr-05 17:21 
GeneralBinary Waveform Pin
gremouster29-Apr-05 16:41
gremouster29-Apr-05 16:41 
QuestionHow to display bitmap bit data from memory? Pin
mikec++29-Apr-05 13:06
mikec++29-Apr-05 13:06 
AnswerRe: How to display bitmap bit data from memory? Pin
Shog929-Apr-05 14:25
sitebuilderShog929-Apr-05 14:25 
GeneralRe: How to display bitmap bit data from memory? Pin
mikec++29-Apr-05 14:56
mikec++29-Apr-05 14:56 
GeneralRe: How to display bitmap bit data from memory? Pin
mikec++29-Apr-05 16:00
mikec++29-Apr-05 16:00 
Generalnon-member function threading Pin
outoolcoe29-Apr-05 12:56
outoolcoe29-Apr-05 12:56 
Generalpipes of CreateProcess() Pin
includeh1029-Apr-05 11:20
includeh1029-Apr-05 11:20 
GeneralParsing XML file Pin
Reveur129-Apr-05 10:28
Reveur129-Apr-05 10:28 
GeneralDisplay a disabled 24-bit image Pin
eddya29-Apr-05 9:44
eddya29-Apr-05 9:44 
GeneralRe: Display a disabled 24-bit image Pin
bmzhao29-Apr-05 14:19
bmzhao29-Apr-05 14:19 
QuestionWhy make a function 'static'? Pin
Chris Meech29-Apr-05 9:35
Chris Meech29-Apr-05 9:35 
AnswerRe: Why make a function 'static'? Pin
David Crow29-Apr-05 9:43
David Crow29-Apr-05 9:43 
GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:11
Chris Meech2-May-05 2:11 
AnswerRe: Why make a function 'static'? Pin
BambooMoon29-Apr-05 9:50
BambooMoon29-Apr-05 9:50 
AnswerRe: Why make a function 'static'? Pin
Blake Miller29-Apr-05 10:44
Blake Miller29-Apr-05 10:44 
GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:16
Chris Meech2-May-05 2:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.