summaryrefslogtreecommitdiffstats
path: root/webkit/tools/pepper_test_plugin/demo_3d.h
blob: b10533d02974e1c945dd4bfc9dc45af0427b20ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_DEMO_3D_H_
#define WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_DEMO_3D_H_

#if !defined(INDEPENDENT_PLUGIN)
#include "base/basictypes.h"
#include "third_party/gles2_book/Chapter_2/Hello_Triangle/Hello_Triangle.h"

namespace pepper {
class Demo3D {
 public:
  Demo3D();
  virtual ~Demo3D();

  // Sets the size of the window on which this demo object will render.
  void SetWindowSize(int width, int height);

  // Initializes the OpenGL state required by this demo.
  // When this function is called, it is assumed that a rendering context has
  // already been created and made current.
  bool InitGL();

  // Release the OpenGL resources acquired by this demo.
  // When this function is called, it is assumed that the rendering context
  // used to initialize the demo is current.
  void ReleaseGL();

  // Performs OpenGL rendering.
  // When this function is called, it is assumed that the rendering context
  // has been made current.
  void Draw();

 private:
  ESContext context_;
  HTUserData user_data_;

  DISALLOW_COPY_AND_ASSIGN(Demo3D);
};
}  // namespace pepper
#endif  // INDEPENDENT_PLUGIN
#endif  // WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_DEMO_3D_H_