SetGammaRamp problems

Started by
2 comments, last by bosjoh 24 years, 3 months ago
When I try to use LPDIRECTDRAWGAMMACONTROL::SetGammaRamp the system hangs. Maybe I am not using it right, but that''s because there is little explanation and no samples. I''ve written this piece of code (don''t worry, DDRAW is initialized). { DDGAMMARAMP gdata; LPDIRECTDRAWGAMMACONTROL dgamma; unsigned short rp;//vars for (rp=0;rp<256;rp++){ gdata.red[rp]=0; gdata.green[rp]=0; gdata.blue[rp]=0; }; dgamma->SetGammaRamp(DDSGR_CALIBRATE,&gdata); };//just a sample Maybe someone knows more about this method.
Advertisement
Make sure your video card supports gamma ramp changing in DirectX. Monster3D IIs (VoodooII) don't. Also, some don't support calibration. What video card are you using?

BTW, are you initializing your dgamma variable and creating an IDirectDrawGammaControl interface?

--Shannon Schlomer, BLAZE Technologies, Inc.

Edited by - blaze on 1/11/00 7:43:18 PM
--Shannon Schlomer, BLAZE Technologies, Inc.
I am using an S3 virge 375/385 videocard. But the system shouldn''t hang, the function is supposed to return an error then.
That''s why I think, I did something wrong, or I forgot something. The sample in the original post is the only part that has to do with the gamma control. The rest (not seen), is only creating directdraw surfaces and setting the screenmode to 800x600x16.
You need something like this, where g_lpFront is a pointer
to the primary surface.

LPDIRECTDRAWGAMMACONTROL dgamma;
if(g_lpFront->QueryInterface(IID_IDirectDrawGammaControl, (LPVOID*)&dgamma) != S_OK)
{
dgamma = 0;
}

if(dgamma)
{
// CODE HERE FOR SETTING THE GAMMA RAMP
}

If you''ve done this, I don''t see why it hangs.

--Shannon Schlomer, BLAZE Technologies, Inc.
--Shannon Schlomer, BLAZE Technologies, Inc.

This topic is closed to new replies.

Advertisement