diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 20:32:40 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 20:32:40 +0000 |
commit | 177002925b7152b6eafe92912fe922eb823d21c6 (patch) | |
tree | eb6d9268a6d0cddb49d9fba6c707f0f157275878 /o3d/build | |
parent | a669d57df371e525d2ca93f129c0fdec7f7e76ed (diff) | |
download | chromium_src-177002925b7152b6eafe92912fe922eb823d21c6.zip chromium_src-177002925b7152b6eafe92912fe922eb823d21c6.tar.gz chromium_src-177002925b7152b6eafe92912fe922eb823d21c6.tar.bz2 |
linux: native OpenGL ES support
This includes Gregg's CL 548023
There are still a few hard-coded paths, and issues to solve, but hellocube-textures-glsl is running on an actual device.
Review URL: http://codereview.chromium.org/572029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38385 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/build')
-rw-r--r-- | o3d/build/common.gypi | 93 | ||||
-rw-r--r-- | o3d/build/libs.gyp | 90 |
2 files changed, 98 insertions, 85 deletions
diff --git a/o3d/build/common.gypi b/o3d/build/common.gypi index 492bd54..ee2324f 100644 --- a/o3d/build/common.gypi +++ b/o3d/build/common.gypi @@ -27,6 +27,7 @@ 'variables': { # If the DEPS file exists two levels up, then we're in a Chrome tree. 'o3d_in_chrome%': '<!(python <(DEPTH)/o3d/build/file_exists.py <(DEPTH)/DEPS)', + 'gles2_backend%': 'desktop_gl', 'conditions' : [ # These have to come first because GYP doesn't like it when # they're part of the same conditional as a conditions clause that @@ -57,6 +58,7 @@ 'o3d_in_chrome%': '<(o3d_in_chrome)', 'renderer%': '<(renderer)', 'cgdir%': '<(cgdir)', + 'gles2_backend%': '<(gles2_backend)', 'swiftshaderdir%': '<(swiftshaderdir)', # We default to building everything only if the assets exist. @@ -88,44 +90,67 @@ }, }], ], - }, - 'conditions' : [ - ['OS == "win"', - { - 'target_defaults': { + 'conditions' : [ + ['renderer == "d3d9"', + { 'defines': [ - '_CRT_SECURE_NO_WARNINGS', - 'OS_WIN', - 'UNICODE', - 'NACL_WINDOWS', - '_X86_', + 'RENDERER_D3D9', + ], + }, + ], + ['renderer == "gl"', + { + 'defines': [ + 'RENDERER_GL', + ], + }, + ], + ['renderer == "gles2"', + { + 'defines': [ + 'RENDERER_GLES2', ], - # Disable warning: "'this' : used in base member initialization list." - 'msvs_disabled_warnings': [4355], 'conditions': [ - ['renderer == "d3d9"', + ['gles2_backend == "desktop_gl"', { 'defines': [ - 'RENDERER_D3D9', + 'GLES2_BACKEND_DESKTOP_GL', ], }, ], - ['renderer == "gl"', + ['gles2_backend == "native_gles2"', { 'defines': [ - 'RENDERER_GL', + 'GLES2_BACKEND_NATIVE_GLES2', ], }, ], - ['renderer == "gles2"', + ['gles2_backend == "gles2_command_buffers"', { 'defines': [ - 'RENDERER_GLES2', + 'GLES2_BACKEND_GLES2_COMMAND_BUFFERS', ], }, ], ], }, + ], + ], + }, + 'conditions' : [ + ['OS == "win"', + { + 'target_defaults': { + 'defines': [ + '_CRT_SECURE_NO_WARNINGS', + 'OS_WIN', + 'UNICODE', + 'NACL_WINDOWS', + '_X86_', + ], + # Disable warning: "'this' : used in base member initialization list." + 'msvs_disabled_warnings': [4355], + }, }, ], ['OS == "mac"', @@ -155,22 +180,6 @@ 'WARNING_CXXFLAGS': ['-Wstrict-aliasing', '-Wno-deprecated',], }, - 'conditions': [ - ['renderer == "gl"', - { - 'defines': [ - 'RENDERER_GL', - ], - }, - ], - ['renderer == "gles2"', - { - 'defines': [ - 'RENDERER_GLES2', - ], - }, - ], - ], }, }, ], @@ -190,22 +199,6 @@ '-fvisibility=hidden', '-Wstrict-aliasing', ], - 'conditions': [ - ['renderer == "gl"', - { - 'defines': [ - 'RENDERER_GL', - ], - }, - ], - ['renderer == "gles2"', - { - 'defines': [ - 'RENDERER_GLES2', - ], - }, - ], - ], }, }, ], diff --git a/o3d/build/libs.gyp b/o3d/build/libs.gyp index fdb1ccf..94f624b 100644 --- a/o3d/build/libs.gyp +++ b/o3d/build/libs.gyp @@ -75,54 +75,74 @@ { 'target_name': 'gles2_libs', 'type': 'none', - 'all_dependent_settings': { - 'include_dirs': [ - '../../<(glewdir)/include', - ], - }, 'conditions': [ - [ 'OS=="linux"', + ['gles2_backend=="desktop_gl"', { 'all_dependent_settings': { - 'defines': [ - 'GL_GLEXT_PROTOTYPES', + 'include_dirs': [ + '../../<(glewdir)/include', ], - 'ldflags': [ - '-L<(PRODUCT_DIR)', + }, + 'conditions': [ + [ 'OS=="linux"', + { + 'all_dependent_settings': { + 'defines': [ + 'GL_GLEXT_PROTOTYPES', + ], + 'ldflags': [ + '-L<(PRODUCT_DIR)', + ], + 'libraries': [ + '-lGL', + '-lGLEW', + '-lX11', + ], + }, + }, ], - 'libraries': [ - '-lGL', - '-lGLEW', - '-lX11', + [ 'OS=="mac"', + { + 'direct_dependent_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', + ], + }, + }, ], - }, - }, - ], - [ 'OS=="mac"', - { - 'direct_dependent_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', + [ 'OS=="win"', + { + 'all_dependent_settings': { + 'libraries': [ + '-lOpenGL32.lib', + '../../<(glewdir)/lib/glew32.lib', + ], + }, + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + "../../<(glewdir)/bin/glew32.dll", + ] + }, + ], + }, ], - }, + ], }, ], - [ 'OS=="win"', + #['gles2_backend=="gles2_command_buffers"', + # { + # }, + #], + ['gles2_backend=="native_gles2"', { 'all_dependent_settings': { 'libraries': [ - '-lOpenGL32.lib', - '../../<(glewdir)/lib/glew32.lib', + '-lEGL', + '-lGLESv2', ], - }, - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)', - 'files': [ - "../../<(glewdir)/bin/glew32.dll", - ] - }, - ], + } }, ], ], |