Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
wglSwapLayerBuffers versus SwapBuffers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Taylor Gordon  
View profile  
 More options Jul 26 2012, 2:10 pm
From: Taylor Gordon <taylorgordo...@gmail.com>
Date: Thu, 26 Jul 2012 11:10:02 -0700 (PDT)
Local: Thurs, Jul 26 2012 2:10 pm
Subject: wglSwapLayerBuffers versus SwapBuffers

I just started using Pyglet and came across an issue with the Win32 method
of swapping front and back buffers. Pyglet uses the wglSwapLayerBuffers
Win32 API call do this swap. On my machine (Windows 7, AMD Radeon HD
7-series graphics card) this method doesn't work with vsync enabled. My
display has a 60Hz refresh rate, and yet the wglSwapLayerBuffers call
blocks to make a 30fps rate. With vsync disabled the frame rate is > 500 so
it is certainly not the case that each frame is to slow to achieve 60fps
with vsync enabled. Moreover, if I replace the wglSwapLayerBuffers call
with the more standard SwapBuffers call, everything works correctly
(60fps).

I've heard reports of other people experiencing the same thing. Why does
Pyglet use the wglSwapLayerBuffers call? This flat out doesn't work on some
configurations with vsync enabled. Useful resources:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd374391(v=vs...
http://msdn.microsoft.com/en-us/library/windows/desktop/dd368815(v=vs...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Taylor Gordon  
View profile  
 More options Jul 29 2012, 1:26 pm
From: Taylor Gordon <taylorgordo...@gmail.com>
Date: Sun, 29 Jul 2012 10:26:54 -0700 (PDT)
Local: Sun, Jul 29 2012 1:26 pm
Subject: Re: wglSwapLayerBuffers versus SwapBuffers

Ping! Should we switch from wglSwapLayerBuffers to SwapBuffers.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andre D  
View profile  
 More options Jul 29 2012, 2:18 pm
From: Andre D <an...@andred.ca>
Date: Sun, 29 Jul 2012 14:18:48 -0400
Local: Sun, Jul 29 2012 2:18 pm
Subject: Re: wglSwapLayerBuffers versus SwapBuffers
This is likely why it is used used:
http://www.opengl.org/discussion_boards/showthread.php/141384-SwapBuf...

"since GDI and the ICD share function names like SwapBuffers, a
wglSwapBuffers is needed to avoid ambiguity when loading the proc
dynamically."


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andre D  
View profile  
 More options Jul 29 2012, 2:20 pm
From: Andre D <an...@andred.ca>
Date: Sun, 29 Jul 2012 14:20:22 -0400
Local: Sun, Jul 29 2012 2:20 pm
Subject: Re: wglSwapLayerBuffers versus SwapBuffers
http://www.opengl.org/wiki/Platform_specifics:_Windows#When_do_I_rend...
states "To swap buffers, use SwapBuffers instead of wglSwapBuffers."


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tristam MacDonald  
View profile  
 More options Jul 29 2012, 2:36 pm
From: Tristam MacDonald <swiftco...@gmail.com>
Date: Sun, 29 Jul 2012 14:36:40 -0400
Local: Sun, Jul 29 2012 2:36 pm
Subject: Re: wglSwapLayerBuffers versus SwapBuffers

On Sun, Jul 29, 2012 at 2:20 PM, Andre D <an...@andred.ca> wrote:

> http://www.opengl.org/wiki/Platform_specifics:_Windows#When_do_I_rend...
> states "To swap buffers, use SwapBuffers instead of wglSwapBuffers."

Sadly, that page doesn't offer any justification for it's assertion. Does
anyone have a suitable reference to back it up?

--
Tristam MacDonald
http://swiftcoder.wordpress.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Schiefer  
View profile  
 More options Jul 30 2012, 3:03 am
From: Andreas Schiefer <andreas.schie...@gmail.com>
Date: Mon, 30 Jul 2012 09:03:12 +0200
Local: Mon, Jul 30 2012 3:03 am
Subject: Re: wglSwapLayerBuffers versus SwapBuffers

On Thu, Jul 26, 2012 at 8:10 PM, Taylor Gordon <taylorgordo...@gmail.com> 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?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Taylor Gordon  
View profile  
 More options Aug 11 2012, 4:00 pm
From: Taylor Gordon <taylorgordo...@gmail.com>
Date: Sat, 11 Aug 2012 13:00:16 -0700 (PDT)
Local: Sat, Aug 11 2012 4:00 pm
Subject: Re: wglSwapLayerBuffers versus SwapBuffers

You have to link the SwapBuffers method in the wgl module. Add the line:

SwapBuffers = _link_function('SwapBuffers', BOOL, [HDC], None)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
claudio canepa  
View profile  
 More options Aug 11 2012, 4:44 pm
From: claudio canepa <ccanep...@gmail.com>
Date: Sat, 11 Aug 2012 17:44:52 -0300
Local: Sat, Aug 11 2012 4:44 pm
Subject: Re: wglSwapLayerBuffers versus SwapBuffers

On Sat, Aug 11, 2012 at 5:00 PM, Taylor Gordon <taylorgordo...@gmail.com>wrote:

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

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »