OLD | NEW |
(Empty) | |
| 1 # -*- python -*- |
| 2 # Copyright 2011 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can |
| 4 # be found in the LICENSE file. |
| 5 |
| 6 # OpenGL ES examples |
| 7 |
| 8 Import('env') |
| 9 |
| 10 env.Prepend(CPPDEFINES=['XP_UNIX']) |
| 11 |
| 12 # Underlay $SOURCE_ROOT/gpu in this directory. |
| 13 Dir('.').addRepository(Dir('#/../gpu')) |
| 14 |
| 15 # Underlay $SOURCE_ROOT/third_party/gles2_book in this directory. |
| 16 Dir('.').addRepository(Dir('#/../third_party/gles2_book')) |
| 17 |
| 18 # Don't warn on pointer signedness issues (third_party sources) |
| 19 env.Append(CFLAGS=['-Wno-pointer-sign']) |
| 20 # ..and don't warn about missing braces |
| 21 env.Append(CCFLAGS=['-Wno-missing-braces']) |
| 22 |
| 23 # Add local path to find GPU sources and GLES2 includes. |
| 24 env.Append(CPPPATH=[ |
| 25 '$SOURCE_ROOT/third_party/gles2_book/Common/Include', |
| 26 '$SOURCE_ROOT/ppapi/lib/gl/include', |
| 27 ]) |
| 28 |
| 29 gles_demo_srcs = [ |
| 30 'Common/Source/esShader.c', |
| 31 'Common/Source/esShapes.c', |
| 32 'Common/Source/esTransform.c', |
| 33 'Common/Source/esUtil.c', |
| 34 'demos/framework/demo.cc', |
| 35 'demos/framework/pepper.cc', |
| 36 ] |
| 37 |
| 38 env.ComponentLibrary('ppapi_gles_demo', gles_demo_srcs) |
| 39 |
| 40 gles_book_examples = { |
| 41 'hello_triangle': [ |
| 42 'Chapter_2/Hello_Triangle/Hello_Triangle.c'], |
| 43 'mip_map_2d': [ |
| 44 'Chapter_9/MipMap2D/MipMap2D.c'], |
| 45 'simple_texture_2d': [ |
| 46 'Chapter_9/Simple_Texture2D/Simple_Texture2D.c'], |
| 47 'simple_texture_cubemap': [ |
| 48 'Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.c'], |
| 49 'simple_vertex_shader': [ |
| 50 'Chapter_8/Simple_VertexShader/Simple_VertexShader.c'], |
| 51 'stencil_test': [ |
| 52 'Chapter_11/Stencil_Test/Stencil_Test.c'], |
| 53 'texture_wrap': [ |
| 54 'Chapter_9/TextureWrap/TextureWrap.c'], |
| 55 } |
| 56 |
| 57 for demo, sources in gles_book_examples.iteritems(): |
| 58 nexe_name = ('ppapi_gles_book_%s_%s' |
| 59 % (demo, env.get('TARGET_FULLARCH'))) |
| 60 nmf_name = 'ppapi_gles_book_' + demo + '.nmf' |
| 61 nexe = env.ComponentProgram( |
| 62 nexe_name, |
| 63 ['demos/gles2_book/demo_' + demo + '.cc'] + sources, |
| 64 EXTRA_LIBS=['${PPAPI_LIBS}', |
| 65 'ppapi_cpp', |
| 66 'ppapi_gles_demo', |
| 67 'ppapi_cpp', |
| 68 'ppapi_gles2', |
| 69 'm']) |
| 70 env.Publish(nexe_name, 'run', |
| 71 ['ppapi_gles_book.html', |
| 72 nmf_name]) |
| 73 test = env.PPAPIBrowserTester( |
| 74 'ppapi_gles_book_' + demo + '.out', |
| 75 url='ppapi_gles_book.html?manifest=' + nmf_name, |
| 76 files=[nexe, |
| 77 env.File(nmf_name), |
| 78 env.File('ppapi_gles_book.html')], |
| 79 browser_flags=['--enable-accelerated-plugins']) |
| 80 env.AddNodeToTestSuite( |
| 81 test, |
| 82 ['chrome_browser_tests'], |
| 83 'run_ppapi_gles_book_' + demo + '_test', |
| 84 is_broken=env.PPAPIBrowserTesterIsBroken() or |
| 85 env.PPAPIGraphics3DIsBroken()) |
OLD | NEW |