Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: gpu/demos/app_framework/application.h

Issue 551011: Changed the signature of Application::Draw to accept elapsed time. It will be... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/demos/app_framework/application.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/demos/app_framework/application.h
===================================================================
--- gpu/demos/app_framework/application.h (revision 36127)
+++ gpu/demos/app_framework/application.h (working copy)
@@ -9,6 +9,7 @@
#include "base/at_exit.h"
#include "base/message_loop.h"
+#include "base/time.h"
#include "gpu/demos/app_framework/platform.h"
@@ -36,7 +37,13 @@
bool InitRenderContext();
- virtual void Draw() = 0;
+ // The framework calls this function for the derived classes to do custom
+ // rendering. There is no default implementation. It must be defined by the
+ // derived classes. The elapsed_sec param represents the time elapsed
+ // (in seconds) after Draw was called the last time. It can be used to
+ // make the application frame-rate independent. It is 0.0f for the
+ // first draw call.
+ virtual void Draw(float elapsed_sec) = 0;
private:
// Creates a native on-screen window.
@@ -46,6 +53,9 @@
int height_;
NativeWindowHandle window_handle_;
+ // Time at which draw was called last.
+ base::Time last_draw_time_;
+
// The following two variables are just needed to satisfy
// the assumption that we are running inside a browser.
base::AtExitManager at_exit_manager_;
« no previous file with comments | « no previous file | gpu/demos/app_framework/application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698