
GLControl's VSync Property doesn't seem to update the Context's VSync
Posted Friday, 26 March, 2010 - 12:38 by pontifikas| Project: | The Open Toolkit library |
| Version: | 1.0.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | open |
Jump to:
Description
I created a Control which Inherits directly from GLControl. Although in the designer I set VSync = false, the VSync is activated.
Only After I perform this.Context.VSync = false in the constructor of my Control, do I manage to deactivate it.


Comments
#1
Thanks for the bug report. Which OS is this?
Edit: this is the code for
GLControl.VSync:set { // The winforms designer sets this to false by default which forces control creation. // However, events are typically connected after the VSync = false assignment, which // can lead to "event xyz is not fired" issues. // Work around this issue by deferring VSync mode setting to the HandleCreated event. if (!IsHandleCreated) { initial_vsync_value = value; return; } ValidateState(); Context.VSync = value; }and inside the OnHandleCreated event:
Which means VSync should work even from the constructor (before the control handle is created). Can you please attach a simple test case?
#2
Actually the code below is all that matters to the construction of the control. I don't know if this is what you mean by test case.
Upon running the program, after having inserted a breakpoint at the line where I manualy set VSync to false, the value of this.Context.VSync is true;
I also inserted a dummy-override of OnHandleCreated (it doesn't exist in my code). It appears that VSync is true after Handle Creation.
Actually "this.Context.VSync = false" is not necessary. " this.VSync = false;" does the trick. The problem must be that VS doesn't apply the default values of the property editor control. Only the changed ones.
Edit: My OS is Win7