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

Side by Side Diff: gpu/demos/app_framework/application.h

Issue 465051: Added an application framework for demos. Ported hello-triangle example in Op... (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/all.gyp ('k') | gpu/demos/app_framework/application.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Base class for gles2 applications using command buffer.
6
7 #ifndef GPU_DEMOS_APP_FRAMEWORK_APPLICATION_H_
8 #define GPU_DEMOS_APP_FRAMEWORK_APPLICATION_H_
9
10 #include "base/at_exit.h"
11 #include "base/message_loop.h"
12
13 #include "gpu/demos/app_framework/platform.h"
14
15 namespace gpu_demos {
16
17 // Acts as a base class for GLES2 applications using command buffer.
18 // The derived calls needs to call InitRenderContext() to create a render
19 // surface and initialize a rendering context. Currently it only creates
20 // an on-screen window. It will be extended to support pepper/nacl plugin
21 // when pepper 3D api is in place.
22 class Application {
23 public:
24 Application();
25 virtual ~Application();
26
27 // Enters the event processing loop.
28 void MainLoop();
29 void OnPaint();
30
31 protected:
32 // Returns the size of rendering surface.
33 inline int width() const { return width_; }
34 inline int height() const { return height_; }
35
36 bool InitRenderContext();
37
38 virtual void Draw() = 0;
39
40 private:
41 // Creates a native on-screen window.
42 NativeWindowHandle CreateNativeWindow();
43
44 int width_;
45 int height_;
46 NativeWindowHandle window_handle_;
47
48 // The following two variables are just needed to satisfy
49 // the assumption that we are running inside a browser.
50 base::AtExitManager at_exit_manager_;
51 MessageLoopForUI message_loop_;
52
53 DISALLOW_COPY_AND_ASSIGN(Application);
54 };
55
56 } // namespace gpu_demos
57 #endif // GPU_DEMOS_APP_FRAMEWORK_APPLICATION_H_
OLDNEW
« no previous file with comments | « build/all.gyp ('k') | gpu/demos/app_framework/application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698