mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-25 08:46:46 +00:00
Fix loss of first frame with GLControl.
This commit is contained in:
parent
1a4a3238c2
commit
b6642764eb
|
@ -82,6 +82,13 @@ namespace OpenTK
|
||||||
|
|
||||||
base.OnResize(e);
|
base.OnResize(e);
|
||||||
}
|
}
|
||||||
|
protected override void OnParentChanged(EventArgs e)
|
||||||
|
{
|
||||||
|
if (context != null)
|
||||||
|
context.Update(window_info);
|
||||||
|
|
||||||
|
base.OnParentChanged(e);
|
||||||
|
}
|
||||||
|
|
||||||
#region --- Protected Methods ---
|
#region --- Protected Methods ---
|
||||||
|
|
||||||
|
|
|
@ -193,8 +193,17 @@ namespace OpenTK.Platform.MacOS
|
||||||
}
|
}
|
||||||
void SetDrawable(CarbonWindowInfo carbonWindow)
|
void SetDrawable(CarbonWindowInfo carbonWindow)
|
||||||
{
|
{
|
||||||
IntPtr windowPort;
|
IntPtr windowPort = GetWindowPortForWindowInfo(carbonWindow);
|
||||||
|
|
||||||
|
Agl.aglSetDrawable(contextRef, windowPort);
|
||||||
|
|
||||||
|
MyAGLReportError("aglSetDrawable");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IntPtr GetWindowPortForWindowInfo(CarbonWindowInfo carbonWindow)
|
||||||
|
{
|
||||||
|
IntPtr windowPort;
|
||||||
if (carbonWindow.IsControl)
|
if (carbonWindow.IsControl)
|
||||||
{
|
{
|
||||||
IntPtr controlOwner = API.GetControlOwner(carbonWindow.WindowRef);
|
IntPtr controlOwner = API.GetControlOwner(carbonWindow.WindowRef);
|
||||||
|
@ -203,21 +212,18 @@ namespace OpenTK.Platform.MacOS
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
windowPort = API.GetWindowPort(carbonWindow.WindowRef);
|
windowPort = API.GetWindowPort(carbonWindow.WindowRef);
|
||||||
|
return windowPort;
|
||||||
Agl.aglSetDrawable(contextRef, windowPort);
|
|
||||||
|
|
||||||
MyAGLReportError("aglSetDrawable");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public void Update(IWindowInfo window)
|
public void Update(IWindowInfo window)
|
||||||
{
|
{
|
||||||
CarbonWindowInfo carbonWindow = (CarbonWindowInfo)window;
|
CarbonWindowInfo carbonWindow = (CarbonWindowInfo)window;
|
||||||
|
|
||||||
|
SetDrawable(carbonWindow);
|
||||||
SetBufferRect(carbonWindow);
|
SetBufferRect(carbonWindow);
|
||||||
|
|
||||||
Agl.aglUpdateContext(contextRef);
|
Agl.aglUpdateContext(contextRef);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAGLReportError(string function)
|
void MyAGLReportError(string function)
|
||||||
{
|
{
|
||||||
Agl.AglError err = Agl.GetError();
|
Agl.AglError err = Agl.GetError();
|
||||||
|
|
Loading…
Reference in a new issue