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

Last change on this file since 1435 was 1435, checked in by sam, 8 years ago

nacl: remove our old hack of #including the file containing main() from
the NaCl instance object. Now we properly override main() and we can at
last build all the executables as NaCl binaries.

  • Property svn:keywords set to Id
File size: 1.6 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
40  // Called to draw the contents of the module's browser area.
41    virtual bool HandleInputEvent(const pp::InputEvent& event);
42
43    void DrawSelf();
44
45    SharedOpenGLContext opengl_context_;
46
47    ivec2 m_size;
48
49private:
50    static void CallIntMainWrappers(int argc, char const* argn[]);
51    static void CallVoidMainWrappers(int argc, char const* argn[]);
52};
53
54}  // namespace lol
55
56#endif  // EXAMPLES_TUMBLER_TUMBLER_H_
Note: See TracBrowser for help on using the repository browser.