On Jan 7, 2008 4:51 PM, Martin Spacek <[EMAIL PROTECTED]> wrote:
> I followed Andrew's tip, and tried GetDeviceGammaRamp and
> SetDeviceGammaRamp in win32, but I couldn't seem to get them to work.
> The code is attached. Return values for both
> windll.gdi32.GetDeviceGammaRamp and windll.gdi32.SetDeviceGammaRamp are
> 0 for me. I don't know much about ctypes and windows calls, so I'm
> probably doing something wrong.

The buffer needs to be 3 arrays of 256 words (you have only allocated
the same number of bytes).  So:

buf = ((c_uint16) * 256) * 3)()

where buf[0] is the red ramp, buf[1] is the green ramp, etc.

[GS]etDeviceGammaRamp needs a graphics device context, not an OpenGL
context.  So:

ret = windll.gdi32.GetDeviceGammaRamp(win._dc, buf)
ret = windll.gdi32.SetDeviceGammaRamp(win._dc, buf)

(the byref is unnecessary; arrays are always passed as pointers in C).

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to