OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 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 // This is a simple example that draws a single triangle with | |
6 // a minimal vertex/fragment shader. The purpose of this | |
7 // example is to demonstrate the basic concepts of | |
8 // OpenGL ES 2.0 rendering. | |
9 | |
10 #include "gpu/demos/framework/demo_factory.h" | |
11 #include "gpu/demos/gles2_book/example.h" | |
12 #include "third_party/gles2_book/Chapter_2/Hello_Triangle/Hello_Triangle.h" | |
13 | |
14 namespace gpu { | |
15 namespace demos { | |
16 | |
17 namespace gles2_book { | |
18 class HelloTriangle : public Example<HTUserData> { | |
19 public: | |
20 HelloTriangle() { | |
21 RegisterCallbacks(htInit, NULL, htDraw, htShutDown); | |
22 } | |
23 | |
24 const wchar_t* Title() const { | |
25 return L"Hello Triangle"; | |
26 } | |
27 }; | |
28 } // namespace gles2_book | |
29 | |
30 Demo* CreateDemo() { | |
31 return new gles2_book::HelloTriangle(); | |
32 } | |
33 | |
34 } // namespace demos | |
35 } // namespace gpu | |
OLD | NEW |