Kamujin's picture

Resize questions.

I noticed that my Resize events were not being triggered under windows.

After some source code sniffing, I notice the following.

From X11GLNative.cs

        private void OnResize(ResizeEventArgs e)
        {
            width = e.Width;
            height = e.Height;
            if (this.Resize != null)
            {
                this.Resize(this, e);
            }
        }

From WinGLNative.cs

        public void OnResize(ResizeEventArgs e)
        {
            throw new NotImplementedException("Use GameWindow.OnResize instead.");
            //this.width = e.Width;
            //this.height = e.Height;
            //if (this.Resize != null)
            //    this.Resize(this, e);
        }

I can see from GameWindow.cs that you pass add/remove accessors to the Resize events back to the underlying INativeGLWindow implementation. Is there a reason that the Windows implimentation has its resize events disabled?

To add some context, my GUI framework constructor requires a reference to an OpenTK.GameWindow, which it used to subscribe to resize events. I can detect resize events reliably by overriding OnResize in GameWindow and forward them to the framework, but I believe having my GUI framework subscribe to its required event is a more appropriate implementation.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
JTalton's picture

I too need this support and have just been ignoring it. I would be great to have it working.

I feel bad making requests and having Fiddler do all the work. Is it possible to add branchs to SVN giving someone access to that branch allowing for features to be implemented by us and Fiddler could review and merge a branch in if he wanted. Just a thought.