diff options
author | noelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-29 20:55:01 +0000 |
---|---|---|
committer | noelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-29 20:55:01 +0000 |
commit | 2e61845cacd06e94eebd0b4da5bfc17339d96f75 (patch) | |
tree | 0b1b83f234afbea947ea5038d42bba1a3a998247 /native_client_sdk | |
parent | 31cf1c56a481859698a2723d01bf094039658f6c (diff) | |
download | chromium_src-2e61845cacd06e94eebd0b4da5bfc17339d96f75.zip chromium_src-2e61845cacd06e94eebd0b4da5bfc17339d96f75.tar.gz chromium_src-2e61845cacd06e94eebd0b4da5bfc17339d96f75.tar.bz2 |
Minor fixes for examples.
Fix out of date index.html which describes the various examples.
Fix incorrect NMF file for mt_input_events
Remove extra warnings to prevent issue with glibc (BUG=115939)
Add message when failing to save score in pong, due to incognito.
Remove build script hack for force M18 compatible build (major - 1)
TBR= bradnelson@chromium.org
TEST= sdk trybots
Review URL: http://codereview.chromium.org/9518013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
8 files changed, 44 insertions, 42 deletions
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py index 14e0850..fe9a4db 100755 --- a/native_client_sdk/src/build_tools/build_sdk.py +++ b/native_client_sdk/src/build_tools/build_sdk.py @@ -441,8 +441,7 @@ def main(args): if options.archive and (options.examples or options.skip_tar): parser.error('Incompatible arguments with archive.') - # TODO(noelallen): Remove force build to 18... - pepper_ver = str(int(build_utils.ChromeMajorVersion()) - 1) + pepper_ver = str(int(build_utils.ChromeMajorVersion())) clnumber = lastchange.FetchVersionInfo(None).revision if options.release: pepper_ver = options.release diff --git a/native_client_sdk/src/examples/dlopen/Makefile b/native_client_sdk/src/examples/dlopen/Makefile index fa3545d..c19fa49 100644 --- a/native_client_sdk/src/examples/dlopen/Makefile +++ b/native_client_sdk/src/examples/dlopen/Makefile @@ -16,7 +16,7 @@ # the rest of the makefile is boilerplate for defining build rules. # PROJECT:=dlopen -WARNINGS:=-Wno-long-long -Wall -Wswitch-enum -pedantic -Werror +WARNINGS:=-Wno-long-long -Wall CXXFLAGS:=-g -O0 -pthread -std=gnu++98 $(WARNINGS) LDFLAGS:=-g -ldl -lppapi_cpp -lppapi @@ -119,7 +119,7 @@ lib64/libeightball.so: eightball_x86_64.o | lib64 # objdump. Pass in the (-L) paths to the default library toolchains so that we # can find those libraries and have it automatically copy the files (-s) to # the target directory for us. -NEXES:=dlopen_x86_32.nexe dlopen_x86_32.nexe +NEXES:=dlopen_x86_32.nexe dlopen_x86_64.nexe NEXES+=lib32/libeightball.so lib64/libeightball.so NMF_ARGS:=-D $(TC_PATH)/x86_64-nacl/bin/objdump NMF_PATHS:=-L $(TC_PATH)/x86_64-nacl/lib32 -L $(TC_PATH)/x86_64-nacl/lib64 diff --git a/native_client_sdk/src/examples/fullscreen_tumbler/Makefile b/native_client_sdk/src/examples/fullscreen_tumbler/Makefile index 434de02..7b28db9 100644 --- a/native_client_sdk/src/examples/fullscreen_tumbler/Makefile +++ b/native_client_sdk/src/examples/fullscreen_tumbler/Makefile @@ -15,9 +15,9 @@ # only the list of sources and project name that will actually change and # the rest of the makefile is boilerplate for defining build rules. # -PROJECT:=tumbler +PROJECT:=fullscreen_tumbler LDFLAGS:=-lppapi_gles2 -lppapi_cpp -lppapi -CXX_SOURCES:=$(PROJECT).cc +CXX_SOURCES:=tumbler.cc CXX_SOURCES+=transforms.cc shader_util.cc opengl_context.cc tumbler_module.cc CXX_SOURCES+=scripting_bridge.cc cube.cc diff --git a/native_client_sdk/src/examples/geturl/Makefile b/native_client_sdk/src/examples/geturl/Makefile index cd5c344..806932f 100644 --- a/native_client_sdk/src/examples/geturl/Makefile +++ b/native_client_sdk/src/examples/geturl/Makefile @@ -13,13 +13,11 @@ # These variables store project specific settings for the project name # build flags, files to copy or install. In the examples it is typically # only the list of sources and project name that will actually change and -# the rest of the makefile is boilerplate for defining build rules. # PROJECT:=geturl LDFLAGS:=-lppapi_cpp -lppapi CXX_SOURCES:=$(PROJECT).cc geturl_handler.cc - # # Get pepper directory for toolchain and includes. # @@ -73,4 +71,3 @@ $(PROJECT)_x86_64.nexe : $(x86_64_OBJS) RUN: all python ../httpd.py - diff --git a/native_client_sdk/src/examples/hello_world_glibc/Makefile b/native_client_sdk/src/examples/hello_world_glibc/Makefile index a52123d..a7938d8 100644 --- a/native_client_sdk/src/examples/hello_world_glibc/Makefile +++ b/native_client_sdk/src/examples/hello_world_glibc/Makefile @@ -23,7 +23,7 @@ NACL_SDK_ROOT?=$(abspath $(dir $(THIS_MAKEFILE))../..) # # Turns on warnings (-Wxxx), builds with zero optimization (-O0) and adds debug # information (-g) for correctness and ease of debugging. -WARNINGS:=-Wno-long-long -Wall -Wswitch-enum -Werror -pedantic +WARNINGS:=-Wno-long-long -Wall CFLAGS:=-pthread -O0 -g $(WARNINGS) diff --git a/native_client_sdk/src/examples/index.html b/native_client_sdk/src/examples/index.html index 0ec82e0..0f20761 100644 --- a/native_client_sdk/src/examples/index.html +++ b/native_client_sdk/src/examples/index.html @@ -1,5 +1,5 @@ <!-- - Copyright (c) 2011 The Chromium Authors. All rights reserved. + 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. --> @@ -84,30 +84,32 @@ audio, 2D, 3D, input and urls.</p></dd> <p>Teaching focus: Audio.</p> </dd> <dt><a href="input_events/input_events.html">Input Events</a></dt> - <dd> The Input Events example demonstrates how to handle events triggered by the user. This example allows a user - to interact with a square representing a module instance. Events are displayed on the screen as the user clicks, scrolls, types, inside or outside - of the square. + <dd> The Input Events example demonstrates how to handle events triggered by + the user. This example allows a user to interact with a square representing a + module instance. Events are displayed on the screen as the user clicks, + scrolls, types, inside or outside of the square. <p>Teaching focus: Keyboard and mouse input, view change, and focus events.</p> </dd> <dt><a href="pi_generator/pi_generator.html">Pi Generator</a></dt> - <dd> The Pi Generator example demonstrates creating a helper thread that estimate pi using the Monte Carlo - method while randomly putting 1,000,000,000 points inside a 2D square that shares two - sides with a quarter circle. + <dd> The Pi Generator example demonstrates creating a helper thread that + estimate pi using the Monte Carlo method while randomly putting 1,000,000,000 + points inside a 2D square that shares two sides with a quarter circle. <p>Teaching focus: Thread creation, 2D graphics, view change events.</p> </dd> <dt><a href="tumbler/tumbler.html">Tumbler</a></dt> - <dd> The Tumbler example demonstrates how to create a 3D cube that you can rotate with your mouse while pressing the - left mouse button. This example creates a 3D context and draws to it using - OpenGL ES. The JavaScript implements a virtual trackball interface to - map mouse movements into 3D rotations using simple 3D vector math and - quaternions. + <dd> The Tumbler example demonstrates how to create a 3D cube that you can + rotate with your mouse while pressing the left mouse button. This example + creates a 3D context and draws to it using OpenGL ES. The JavaScript + implements a virtual trackball interface to map mouse movements into 3D + rotations using simple 3D vector math and quaternions. <p>Teaching focus: 3D graphics</p> </dd> <dt><a href="geturl/geturl.html">Get URL</a></dt> - <dd> The Get URL example demonstrates fetching an URL and then displaying its contents. + <dd> The Get URL example demonstrates fetching an URL and then displaying + its contents. <p>Teaching focus: URL loading.</p> </dd> @@ -116,29 +118,31 @@ audio, 2D, 3D, input and urls.</p></dd> <dd><p>The following set of examples illustrate various common concepts such as showing load progress, using Shared Objects (dynamic libraries), mulithreading...</p></dd> -<dt><a href="dlopen/dlopen.html">Shared Object Loading (GLIBC)</a></dt> - <dd> The Load Progress example demonstrates how to listen for and handle - events that occur while a NaCl module loads. This example listens for - different load event types and dispatches different events to their - respective handler. This example also checks for valid browser version and - shows how to calculate and display loading progress. +<dt><a href="dlopen/dlopen.html">Dynamic Library Open (GLIBC)</a></dt> + <dd> The dlopen example demonstrates how build dynamic libraries and then + open and use them at runtime. When the page loads, type in a question and + hit enter or click the ASK! button. The question and answer will be + displayed in the page under the text entry box. <p>Teaching focus: Using shared objects.</p> </dd> <dt><a href="load_progress/load_progress.html">Load Progress</a></dt> - <dd> The Load Progress example demonstrates how to listen for and handle events that occur while a - NaCl module loads. This example listens for different load event types and dispatches different events to their respective handler. This example also checks for valid browser - version and shows how to calculate and display loading progress. + <dd> The Load Progress example demonstrates how to listen for and handle + events that occur while a NaCl module loads. This example listens for + different load event types and dispatches different events to their + respective handler. This example also checks for valid browser version and + shows how to calculate and display loading progress. <p>Teaching focus: Progress event handling.</p> </dd> <dt><a href="pong/pong.html">Pong</a></dt> - <dd> The Pong example demonstrates how to create a basic 2D video game and how to store application - information in a local persistent file. This game uses up and - down arrow keyboard input events to move the paddle. + <dd> The Pong example demonstrates how to create a basic 2D video game and + how to store application information in a local persistent file. This game + uses up and down arrow keyboard input events to move the paddle. - <p>Teaching focus: File I/O, 2D graphics, input events.</p> + <p>Teaching focus: File I/O, 2D graphics, input events.</p> </dd> - <dt><a href="multithreaded_input_events/mt_input_events.html">Multi-threaded Input Events</a></dt> + <dt><a href="multithreaded_input_events/mt_input_events.html">Multi-threaded + Input Events</a></dt> <dd>The Multithreaded Input Events example combines HTML, Javascript, and C++ (the C++ is compiled to create a .nexe file). The C++ shows how to handle input events in a multi-threaded application. @@ -148,19 +152,20 @@ mulithreading...</p></dd> result of the worker thread to the browser. <p>Teaching focus: Multithreaded event handling.</p> </dd> - <dt><a href="fullscreen_tumbler/fullscreen_tumbler.html">Full-screen Tumbler</a></dt> + <dt><a href="fullscreen_tumbler/fullscreen_tumbler.html">Full-screen + Tumbler</a></dt> <dd>This is a modified version of the Tumbler example above that supports full-screen display. It is in every way identical to Tumbler in functionality, except that it adds the ability to switch to/from full-screen display by pressing the Enter key. - <p>Teaching focus: Full-screen</p> + <p>Teaching focus: Full-screen</p> </dd> <dt><a href="mouselock/mouselock.html">Mouse Locker</a></dt> <dd> The Mouselock example demonstrates how to use the MouseLock API to hide the mouse cursor. Mouse lock is only available in full-screen mode. You can lock and unlock the mouse while in full-screen mode by pressing the Enter key. - <p>Teaching focus: Mouse lock, Full-screen</p> + <p>Teaching focus: Mouse lock, Full-screen</p> </dd> <dt><a href="websocket/websocket.html">Websocket</a></dt> <dd> The Websocket example demonstrates how to use the Websocket API. The diff --git a/native_client_sdk/src/examples/multithreaded_input_events/mt_input_events.nmf b/native_client_sdk/src/examples/multithreaded_input_events/mt_input_events.nmf index 513ca9e..347bdff 100644 --- a/native_client_sdk/src/examples/multithreaded_input_events/mt_input_events.nmf +++ b/native_client_sdk/src/examples/multithreaded_input_events/mt_input_events.nmf @@ -1,6 +1,6 @@ { "program": { - "x86-64": {"url": "multithreaded_input_events_x86_64.nexe"}, - "x86-32": {"url": "multithreaded_input_events_x86_32.nexe"} + "x86-64": {"url": "mt_input_events_x86_64.nexe"}, + "x86-32": {"url": "mt_input_events_x86_32.nexe"} } } diff --git a/native_client_sdk/src/examples/pong/pong.cc b/native_client_sdk/src/examples/pong/pong.cc index 14b5321..1e6112f 100644 --- a/native_client_sdk/src/examples/pong/pong.cc +++ b/native_client_sdk/src/examples/pong/pong.cc @@ -406,6 +406,7 @@ Pong::BallDirection Pong::RightPaddleNextMove() const { void Pong::UpdateScoreDisplay() { if (file_io_ == NULL) + PostMessage(pp::Var("Could not save score (incognito?).")); return; // Since we cant't save the score to file, do nothing and return. size_t message_length = 18 + (player_score_ ? log(player_score_) : 1) + 1 + (computer_score_ ? log(computer_score_) : 1) + 1; |