Bug 5599 - OnRenderFrame is passed an empty FrameEventArgs
Summary: OnRenderFrame is passed an empty FrameEventArgs
Alias: None
Product: Android
Classification: Xamarin
Component: Samples ()
Version: 4.2.x
Hardware: PC Windows
: Low normal
Target Milestone: ---
Assignee: Ben O'Halloran
Depends on:
Reported: 2012-06-10 05:23 UTC by alex brown
Modified: 2015-03-09 07:40 UTC (History)
3 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 alex brown 2012-06-10 05:23:56 UTC
In your example OpenGL app that is created when you create a new opengl project you have a function called OnRenderFrame. It takes a FrameEventArgs parameter. This parameter is not set or has some other problem. The parameter is called "e" so if I inspect e.Time int the debugger I get a really large number or a really small number. This works correctly in the OnUpdateFrame function.

If OnRenderFrame is not supposed to get a FrameEventArgs then please remove it from the default code to avoid confusion.
If the parameter is supposed to be set then please figure out why it is not.
Comment 1 alex brown 2012-06-10 05:30:31 UTC
In case it matters I've been testing on my Xoom.
Comment 2 Ben O'Halloran 2014-07-01 18:29:36 UTC
OnRenderFrame is supposed to get a FrameEventArgs parameter. Can you elaborate on what you mean by "is not set"?
Comment 3 Jonathan Pryor 2014-07-01 18:46:57 UTC
@Ben: Via Comment #0:

> The parameter is called "e" so if I inspect e.Time int the debugger I get
> a really large number or a really small number.

In this context, then, "not set" or "empty" means that FrameEventArgs.Time is 0 (or very close to 0).

That said, a value "very close to 0" may in fact be appropriate:


> Gets a double that indicates how many seconds of time elapsed since the previous event.

At 60 frames/second, e.Time should be 0.016. However, IIRC it's possible to ask OpenTK to render frames "as fast as possible", in which case values less than 0.016 should be expected.

Furthermore, if you do have this stuck in a debugger, it would not be surprising for "very large values" from e.Time if the debugger had stopped the world for "a long time."

Though this could likewise be a debugger bug, e.g. Bug #1949 (among other's, IIRC).
Comment 4 Rustam Zaitov 2015-03-09 07:40:56 UTC
I just created OpenGL project for Unified API and observed behaviour looks good for me.

I set breakpoint inside:
protected override void OnRenderFrame (FrameEventArgs e)

and e.Time is always equals 0. This is correct, because this method called from another method like this:
void DrawFrame ()
	OnRenderFrame (new FrameEventArgs ());

So I can't reproduce "get a really large number or a really small number", because of this I am going to close this issue. If you still have any troubles with this issue, just reopen it.