OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_ |
| 7 |
| 8 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g
vr_types.h" |
| 9 #include "ui/gl/gl_bindings.h" |
| 10 |
| 11 namespace vr_shell { |
| 12 |
| 13 std::array<float, 16> MatrixToGLArray(const gvr::Mat4f& matrix); |
| 14 |
| 15 gvr::Rectf ModulateRect(const gvr::Rectf& rect, float width, float height); |
| 16 |
| 17 gvr::Recti CalculatePixelSpaceRect(const gvr::Sizei& texture_size, |
| 18 const gvr::Rectf& texture_rect); |
| 19 |
| 20 // Compile a shader. |
| 21 GLuint CompileShader(GLenum shader_type, |
| 22 const GLchar* shader_source, |
| 23 std::string& error); |
| 24 |
| 25 // Compile and link a program. |
| 26 GLuint CreateAndLinkProgram(GLuint vertex_shader_handle, |
| 27 GLuint fragment_shader_handle, |
| 28 int num_attributes, |
| 29 const GLchar** attributes, |
| 30 std::string& error); |
| 31 |
| 32 } // namespace vr_shell |
| 33 |
| 34 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_ |
OLD | NEW |