Bug 26830 - OpenTK.Platform.iPhoneOS.iPhoneOSGameView.WillMoveToWindow should not call DestroyFramebuffer
Summary: OpenTK.Platform.iPhoneOS.iPhoneOSGameView.WillMoveToWindow should not call De...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Radek Doulik
Depends on:
Reported: 2015-02-07 07:52 UTC by Rainer Mager
Modified: 2016-05-26 21:27 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Rainer Mager 2015-02-07 07:52:16 UTC
It seems that OpenTK.Platform.iPhoneOS.iPhoneOSGameView.WillMoveToWindow calls DestroyFrameBuffer. I don't think this should happen. Here's why...

I have an OpenGL (OpenTK) based game. I'm adding social network integration. After finishing a level the user can post their high score to Facebook. This brings up the Facebook sharing UI. After that's dismissed OpenTK.Platform.iPhoneOS.iPhoneOSGameView.WillMoveToWindow is called, that in turn calls DestroyFrameBuffer, but there's no reason to destroy it, it's still perfectly usable.

I've put into place a work around in my game where I override DestroyFrameBuffer in my subclass of iPhoneOSGameView and then do nothing (instead of calling base.DestroyFrameBuffer).
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-02-09 04:09:06 UTC
Radek, can you comment on this?
Comment 2 Radek Doulik 2015-02-23 12:35:27 UTC
I checked the source and WillMoveToWindow checks whether the Window or Layer has changed and recreates the frame buffer when it changed. Which looks like a right thing to do. Rolf, does it sound right from iOS point of view?

Rainer, could you provide a simple test case which demonstrates the behavior you see?

BTW, the source is here, if you would like to look at it. https://github.com/mono/opentk/blob/master/Source/OpenTK/Platform/iPhoneOS/iPhoneOSGameView.cs#L836
Comment 3 Rainer Mager 2015-02-24 00:24:16 UTC
@Radek, I will try to provide a simple test case. The project I'm seeing this on is pretty big, though, so I'm not sure how quickly I'll be able to strip it down.

It's interesting that my fix, to not call base.DestroyFrameBuffer() in my override of it, fixed this problem. Looking at the source code that would mean that DestroyFrameBuffer does nothing in this case, but after that CreateFrameBuffer is still called.
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-02-24 05:15:28 UTC
The WillMoveToWindow implementation looks sane, so yes, I think it would be better to have a specific test project to see exactly how this can be improved.
Comment 5 Sebastien Pouliot 2016-05-26 21:27:40 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!