|
1 |
| -#pragma warning disable CS0618 |
| 1 | +#pragma warning disable CS0618 |
2 | 2 |
|
3 | 3 | using System;
|
4 | 4 | using System.Collections.Generic;
|
@@ -106,7 +106,7 @@ public void SetRenderer(IRenderer renderer)
|
106 | 106 | eglWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
|
107 | 107 | }
|
108 | 108 | this.renderer = renderer;
|
109 |
| - glThread = new GLThread(thisWeakRef); |
| 109 | + glThread = new GLThread(thisWeakRef, Width, Height); |
110 | 110 | glThread.Start();
|
111 | 111 | }
|
112 | 112 |
|
@@ -211,7 +211,7 @@ protected override void OnAttachedToWindow()
|
211 | 211 | {
|
212 | 212 | renderMode = glThread.GetRenderMode();
|
213 | 213 | }
|
214 |
| - glThread = new GLThread(thisWeakRef); |
| 214 | + glThread = new GLThread(thisWeakRef, Width, Height); |
215 | 215 | if (renderMode != Rendermode.Continuously)
|
216 | 216 | {
|
217 | 217 | glThread.SetRenderMode(renderMode);
|
@@ -713,12 +713,12 @@ private class GLThread
|
713 | 713 | private bool surfaceSizeChanged = true;
|
714 | 714 | // End of member variables protected by the sGLThreadManager monitor.
|
715 | 715 |
|
716 |
| - public GLThread(WeakReference<GLTextureView> glTextureViewWeakRef) |
| 716 | + public GLThread(WeakReference<GLTextureView> glTextureViewWeakRef, int initialWidth, int initialHeight) |
717 | 717 | {
|
718 | 718 | threadManager = new GLThreadManager();
|
719 | 719 |
|
720 |
| - width = 0; |
721 |
| - height = 0; |
| 720 | + width = initialWidth; |
| 721 | + height = initialHeight; |
722 | 722 | requestRender = true;
|
723 | 723 | renderMode = Rendermode.Continuously;
|
724 | 724 | textureViewWeakRef = glTextureViewWeakRef;
|
|
0 commit comments