summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples/gamepad
diff options
context:
space:
mode:
Diffstat (limited to 'native_client_sdk/src/examples/gamepad')
-rw-r--r--native_client_sdk/src/examples/gamepad/example.dsc8
-rw-r--r--native_client_sdk/src/examples/gamepad/gamepad.html24
-rw-r--r--native_client_sdk/src/examples/gamepad/gamepad.nmf6
-rw-r--r--native_client_sdk/src/examples/gamepad/index.html40
4 files changed, 47 insertions, 31 deletions
diff --git a/native_client_sdk/src/examples/gamepad/example.dsc b/native_client_sdk/src/examples/gamepad/example.dsc
index 3f17d36..d7d5541 100644
--- a/native_client_sdk/src/examples/gamepad/example.dsc
+++ b/native_client_sdk/src/examples/gamepad/example.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl'],
'TARGETS': [
{
'NAME' : 'gamepad',
@@ -9,5 +9,11 @@
],
'DEST': 'examples',
'NAME': 'gamepad',
+ 'TITLE': 'Gamepad Example.',
+ 'DESC': """
+Attached gamepad values should appear, left to right, once they've been
+interacted with. Buttons, esp triggers are analog.
+""",
+ 'INFO': 'Gamepad interface.'
}
diff --git a/native_client_sdk/src/examples/gamepad/gamepad.html b/native_client_sdk/src/examples/gamepad/gamepad.html
deleted file mode 100644
index 65c0fff..0000000
--- a/native_client_sdk/src/examples/gamepad/gamepad.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
- <!--
- Copyright (c) 2012 The Native Client Authors. All rights reserved.
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
- <head>
- <title>Gamepad example</title>
- </head>
- <body id="bodyId">
-
- <p> Attached gamepad values should appear, left to right, once they've been
- interacted with. Buttons, esp triggers are analog (alpha). </p>
-
- <embed
- name="nacl_module"
- id="gamepad"
- width=800 height=200
- src="gamepad.nmf"
- type="application/x-nacl" />
- </body>
-</html>
diff --git a/native_client_sdk/src/examples/gamepad/gamepad.nmf b/native_client_sdk/src/examples/gamepad/gamepad.nmf
deleted file mode 100644
index 53e3b97..0000000
--- a/native_client_sdk/src/examples/gamepad/gamepad.nmf
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "program": {
- "x86-64": {"url": "gamepad_x86_64.nexe"},
- "x86-32": {"url": "gamepad_x86_32.nexe"}
- }
-}
diff --git a/native_client_sdk/src/examples/gamepad/index.html b/native_client_sdk/src/examples/gamepad/index.html
new file mode 100644
index 0000000..7271198
--- /dev/null
+++ b/native_client_sdk/src/examples/gamepad/index.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <!--
+ Copyright (c) 2012 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.
+ -->
+<head>
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="-1" />
+ <title><TITLE></title>
+ <script type="text/javascript" src="common.js"></script>
+</head>
+<body onload="pageDidLoad('<NAME>', '<tc>', '800', '200')">
+
+<h1><TITLE></h1>
+<h2>Status: <code id="statusField">NO-STATUS</code></h2>
+ <!-- The <EMBED> element is wrapped inside a <DIV>, which has both a 'load'
+ and a 'message' event listener attached. This wrapping method is used
+ instead of attaching the event listeners directly to the <EMBED> element to
+ ensure that the listeners are active before the NaCl module 'load' event
+ fires. This also allows you to use PPB_Messaging.PostMessage() (in C) or
+ pp::Instance.PostMessage() (in C++) from within the initialization code in
+ your NaCl module.
+
+ The src points to a manifest file, which provides the Native Client plug-in
+ a mapping between architecture and NaCl Executable (NEXE).
+
+ We use a non-zero sized embed to give Chrome space to place the bad plug-in
+ graphic, if there is a problem.
+ -->
+ <div id="listener">
+ <script type="text/javascript">
+ var listener = document.getElementById('listener')
+ listener.addEventListener('load', moduleDidLoad, true);
+ listener.addEventListener('message', handleMessage, true);
+ </script>
+ </div>
+</body>
+</html>