source: trunk/src/platform/nacl/nacl_instance.h @ 1084

Last change on this file since 1084 was 1084, checked in by sam, 11 years ago

nacl: the Mandelbrot zoomer is starting to work on NaCl.

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1// Copyright (c) 2011 The Native Client 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#ifndef EXAMPLES_TUMBLER_TUMBLER_H_
6#define EXAMPLES_TUMBLER_TUMBLER_H_
7
8#include <pthread.h>
9#include <map>
10#include <vector>
11
12#include <ppapi/cpp/instance.h>
13
14#include "platform/nacl/opengl_context.h"
15#include "platform/nacl/opengl_context_ptrs.h"
16
17namespace lol {
18
19class NaClInstance : public pp::Instance {
20 public:
21  explicit NaClInstance(PP_Instance instance);
22
23  // The dtor makes the 3D context current before deleting the cube view, then
24  // destroys the 3D context both in the module and in the browser.
25  virtual ~NaClInstance();
26
27  // Called by the browser when the NaCl module is loaded and all ready to go.
28  virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]);
29
30  // Called whenever the in-browser window changes size.
31  virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip);
32
33  // Called by the browser to handle the postMessage() call in Javascript.
34  virtual void HandleMessage(const pp::Var& message);
35
36  // Bind and publish the module's methods to JavaScript.
37  //void InitializeMethods(ScriptingBridge* bridge);
38
39  // Called to draw the contents of the module's browser area.
40  void DrawSelf();
41
42// private:
43  // Browser connectivity and scripting support.
44//  ScriptingBridge scripting_bridge_;
45
46  SharedOpenGLContext opengl_context_;
47
48    ivec2 m_size;
49};
50
51}  // namespace lol
52
53#endif  // EXAMPLES_TUMBLER_TUMBLER_H_
Note: See TracBrowser for help on using the repository browser.