| OLD | NEW |
| 1 .. _cds2014_cpp: | 1 .. _cds2014_cpp: |
| 2 | 2 |
| 3 ################################## | 3 ################################## |
| 4 A Saga of Fire and Water - Codelab | 4 A Saga of Fire and Water - Codelab |
| 5 ################################## | 5 ################################## |
| 6 | 6 |
| 7 Introduction | 7 Introduction |
| 8 ------------ | 8 ------------ |
| 9 | 9 |
| 10 .. include:: cpp_summary.inc | 10 .. include:: cpp_summary.inc |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 I think that's pretty cool, but then I selected | 59 I think that's pretty cool, but then I selected |
| 60 the institution of higher learning I attended based | 60 the institution of higher learning I attended based |
| 61 on the integral role fire played in its campus life. | 61 on the integral role fire played in its campus life. |
| 62 | 62 |
| 63 Water | 63 Water |
| 64 ----- | 64 ----- |
| 65 | 65 |
| 66 Remarkably, not everyone enjoys the primal illusion of fire. | 66 Remarkably, not everyone enjoys the primal illusion of fire. |
| 67 | 67 |
| 68 Your task in this codelab is to transform the rising fire | 68 Your task in this codelab is to transform the rising fire |
| 69 effect you see before you, into a beautiful, tranquil waterfall. | 69 effect you see before you into a beautiful, tranquil waterfall. |
| 70 This will require digging into some C++ code. | 70 This will require digging into some C++ code. |
| 71 | 71 |
| 72 Before you begin, you'll want to copy our fire program to a new name, | 72 Before you begin, you'll want to copy our fire program to a new name, |
| 73 since you might decide later that you like fire better, I know I do:: | 73 since you might decide later that you like fire better, I know I do:: |
| 74 | 74 |
| 75 cp fire.cc water.cc | 75 cp fire.cc water.cc |
| 76 git add water.cc | 76 git add water.cc |
| 77 git commit -am "adding water" | 77 git commit -am "adding water" |
| 78 | 78 |
| 79 For this codelab, you'll only need to change `water.cc`. | 79 For this codelab, you'll only need to change `water.cc`. |
| 80 | 80 |
| 81 The task of turning fire into water involves two key challenges: | 81 The task of turning fire into water involves two key challenges: |
| 82 | 82 |
| 83 * Alter the red-yellow palette of fire into a blue-green one. | 83 * Alter the red-yellow palette of fire into a blue-green one. |
| 84 * Reverse upward rising flame into downward falling water. | 84 * Reverse upward rising flame into downward falling water. |
| 85 * Seed the waterfall from the top instead of the bottom. | 85 * Seed the waterfall from the top instead of the bottom. |
| 86 | 86 |
| 87 At this point you'll want to open up `water.cc` in the editor you | 87 At this point you'll want to open up `water.cc` in the editor you |
| 88 picked earlier. | 88 picked earlier. |
| 89 | 89 |
| 90 I see a red door and I want it painted... blue | 90 I see a red door and I want it painted... blue |
| 91 ============================================== | 91 ============================================== |
| 92 | 92 |
| 93 While PPAPI's 2D graphics API uses multi-component RGB pixels, | 93 While PPAPI's 2D graphics API uses multi-component RGB pixels, |
| 94 our flame effect is actually monochrome. A single intensity | 94 our flame effect is actually monochrome. A single intensity |
| 95 value is used in the flame simulation. This is then converted | 95 value is used in the flame simulation. This is then converted |
| 96 to color based on a multi-color gradient. | 96 to color based on a multi-color gradient. |
| 97 To alter the color-scheme, locate this palette, and exchange | 97 To alter the color-scheme, locate this palette, and exchange |
| 98 the red component (first) with blue (third). | 98 the red component (first) with the blue one (third). |
| 99 | 99 |
| 100 Hint: Focus your energies on the CreatePalette function. | 100 Hint: Focus your energies on the CreatePalette function. |
| 101 | 101 |
| 102 You can test you changes at any time with:: | 102 You can test you changes at any time with:: |
| 103 | 103 |
| 104 make water | 104 make water |
| 105 | 105 |
| 106 What goes up... | 106 What goes up... |
| 107 =============== | 107 =============== |
| 108 | 108 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 138 other | 138 other |
| 139 `PPAPI interfaces available | 139 `PPAPI interfaces available |
| 140 <http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/cpp/>`_. | 140 <http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/cpp/>`_. |
| 141 | 141 |
| 142 While our in-browser environment is rapidly evolving | 142 While our in-browser environment is rapidly evolving |
| 143 to become a complete development solution, | 143 to become a complete development solution, |
| 144 for the broadest range of development options, check out the | 144 for the broadest range of development options, check out the |
| 145 `NaCl SDK | 145 `NaCl SDK |
| 146 <https://developer.chrome.com/native-client/cpp-api>`_. | 146 <https://developer.chrome.com/native-client/cpp-api>`_. |
| 147 | 147 |
| 148 For questions, concerns, and help contact us at | 148 For questions, concerns, or help contact us at |
| 149 `native-client-discuss@googlegroups.com | 149 `native-client-discuss@googlegroups.com |
| 150 <https://groups.google.com/forum/#!forum/native-client-discuss>`_. | 150 <https://groups.google.com/forum/#!forum/native-client-discuss>`_. |
| 151 | 151 |
| 152 I hope this codelab has lit a fire in you to go out there, | 152 I hope this codelab has lit a fire in you to go out there, |
| 153 and bring an awesome C/C++ application to NaCl or PNaCl today! | 153 and bring an awesome C/C++ application to NaCl or PNaCl today! |
| 154 | 154 |
| 155 | 155 |
| 156 .. include:: ../nacldev/cleanup_app.inc | 156 .. include:: ../nacldev/cleanup_app.inc |
| OLD | NEW |