On Sat, Aug 11, 2012 at 5:00 PM, Taylor Gordon <[email protected]>wrote:

> You have to link the SwapBuffers method in the wgl module. Add the line:
>
> SwapBuffers = _link_function('SwapBuffers', BOOL, [HDC], None)
>
> On Monday, July 30, 2012 12:03:12 AM UTC-7, Andreas Schiefer wrote:
>
>> On Thu, Jul 26, 2012 at 8:10 PM, Taylor Gordon <[email protected]>
>> wrote:
>> > Moreover, if I replace the wglSwapLayerBuffers call with the
>> > more standard SwapBuffers call, everything works correctly (60fps).
>>
>> What have you changed exactly to get it working with SwapBuffers?
>> I tried replacing the line
>>     wgl.wglSwapLayerBuffers(self.canvas.hdc, wgl.WGL_SWAP_MAIN_PLANE)
>> with
>>     wgl.SwapBuffers(self.canvas.hdc)
>>
>> But I always get the error
>>     pyglet.gl.lib.MissingFunctionException: SwapBuffers is not
>> exported by the available OpenGL driver.
>> with current Nvidia and Intel drivers.
>>
>> This may of course be a bug in pyglets wrapper or be related to the
>> dynamic linking issue Andre pointed out, but I'm curious how you got
>> it working?
>>
> --
>
>

Ah, but there is more fun for this issue:

1. There's also a GDI function SwapBuffers, which seems to be the
recomended way, see

http://www.opengl.org/discussion_boards/showthread.php/127145-How-to-use-wglSwapBuffers

http://msdn.microsoft.com/en-us/library/dd369060(v=vs.85)

http://bugs.winehq.org/show_bug.cgi?id=5310

It is not currently binded in pyglet, but you can use this GDI flavor by:

1.  En pyglet\libs\win32\__init__.py , near the line 99, add the lines

     _gdi32.SwapBuffers.restype = BOOL
     _gdi32.SwapBuffers.argtypes = [HDC]

2. in pyglet\gl\win32.py, class Win32Context, method .flip(), replace the
line

     wgl.wglSwapLayerBuffers(self.canvas.hdc, wgl.WGL_SWAP_MAIN_PLANE)
by
     _gdi32.SwapBuffers(self.canvas.hdc)

Now, If there were a small script demoing the defect it would be easier to
evalute solutions.

Note also that the first link does some remarks about vsync issues.

claudio

--

-- 
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