Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_world_gles/hello_world_gles/matrix.h

Issue 10825290: NaCl VS Add-in hello_world_gles example (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #ifndef EXAMPLES_HELLO_WORLD_GLES_MATRIX_H
2 #define EXAMPLES_HELLO_WORLD_GLES_MATRIX_H
3
4 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 /** @file matrix.cc
10 * Implements simple matrix manipulation functions.
11 */
12
13 //-----------------------------------------------------------------------------
14 #define _USE_MATH_DEFINES 1
15 #include <limits.h>
16 #include <math.h>
17 #include <GLES2/gl2.h>
18
19 typedef GLfloat Matrix_t[16];
20
21 /// Since GLES2 doesn't have all the nifty matrix transform functions that GL
22 /// has, we emulate some of them here for the sake of sanity from:
23 /// http://www.opengl.org/wiki/GluPerspective_code
24 void glhFrustumf2(Matrix_t mat, GLfloat left, GLfloat right, GLfloat bottom,
25 GLfloat top, GLfloat znear, GLfloat zfar);
26
27 void glhPerspectivef2(Matrix_t mat, GLfloat fovyInDegrees,
28 GLfloat aspectRatio, GLfloat znear, GLfloat zfar);
29
30
31 void identity_matrix(Matrix_t mat);
32 void multiply_matrix(const Matrix_t a, const Matrix_t b, Matrix_t mat);
33 void rotate_matrix(GLfloat x_deg, GLfloat y_deg, GLfloat z_deg, Matrix_t mat);
34 void translate_matrix(GLfloat x, GLfloat y, GLfloat z, Matrix_t mat);
35
36 #endif // EXAMPLES_HELLO_WORLD_GLES_MATRIX_H
37
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698