• Advertisement

Archived

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

SetGammaRamp problems

This topic is 6583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement