|
24 | 24 | THE SOFTWARE. |
25 | 25 | ****************************************************************************/ |
26 | 26 |
|
27 | | -//Possible OpenGL projections used by director |
28 | | -/** |
29 | | - * sets a 2D projection (orthogonal projection) |
30 | | - * @constant |
31 | | - * @type Number |
32 | | - */ |
33 | | -cc.DIRECTOR_PROJECTION_2D = 0; |
34 | | - |
35 | 27 | cc.g_NumberOfDraws = 0; |
36 | 28 |
|
37 | | -/** |
38 | | - * sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500. |
39 | | - * @constant |
40 | | - * @type Number |
41 | | - */ |
42 | | -cc.DIRECTOR_PROJECTION_3D = 1; |
43 | | - |
44 | | -/** |
45 | | - * it calls "updateProjection" on the projection delegate. |
46 | | - * @constant |
47 | | - * @type Number |
48 | | - */ |
49 | | -cc.DIRECTOR_PROJECTION_CUSTOM = 3; |
50 | | - |
51 | | -/** |
52 | | - * Default projection is 3D projection |
53 | | - * @constant |
54 | | - * @type Number |
55 | | - */ |
56 | | -cc.DIRECTOR_PROJECTION_DEFAULT = cc.DIRECTOR_PROJECTION_3D; |
57 | | - |
58 | | -//---------------------------------------------------------------------------------------------------------------------- |
59 | | -//Possible device orientations |
60 | | -/** |
61 | | - * Device oriented vertically, home button on the bottom (UIDeviceOrientationPortrait) |
62 | | - * @constant |
63 | | - * @type Number |
64 | | - */ |
65 | | -cc.DEVICE_ORIENTATION_PORTRAIT = 0; |
66 | | - |
67 | | -/** |
68 | | - * Device oriented horizontally, home button on the right (UIDeviceOrientationLandscapeLeft) |
69 | | - * @constant |
70 | | - * @type Number |
71 | | - */ |
72 | | -cc.DEVICE_ORIENTATION_LANDSCAPE_LEFT = 1; |
73 | | - |
74 | | -/** |
75 | | - * Device oriented vertically, home button on the top (UIDeviceOrientationPortraitUpsideDown) |
76 | | - * @constant |
77 | | - * @type Number |
78 | | - */ |
79 | | -cc.DEVICE_ORIENTATION_PORTRAIT_UPSIDE_DOWN = 2; |
80 | | - |
81 | | -/** |
82 | | - * Device oriented horizontally, home button on the left (UIDeviceOrientationLandscapeRight) |
83 | | - * @constant |
84 | | - * @type Number |
85 | | - */ |
86 | | -cc.DEVICE_ORIENTATION_LANDSCAPE_RIGHT = 3; |
87 | | - |
88 | | -/** |
89 | | - * In browsers, we only support 2 orientations by change window size. |
90 | | - * @constant |
91 | | - * @type Number |
92 | | - */ |
93 | | -cc.DEVICE_MAX_ORIENTATIONS = 2; |
94 | | - |
95 | | - |
96 | 29 | cc.GLToClipTransform = function (transformOut) { |
97 | 30 | var projection = new cc.kmMat4(); |
98 | 31 | cc.kmGLGetMatrix(cc.KM_GL_PROJECTION, projection); |
@@ -197,7 +130,7 @@ cc.Director = cc.Class.extend(/** @lends cc.director# */{ |
197 | 130 | this._oldAnimationInterval = this._animationInterval = 1.0 / cc.defaultFPS; |
198 | 131 | this._scenesStack = []; |
199 | 132 | // Set default projection (3D) |
200 | | - this._projection = cc.DIRECTOR_PROJECTION_DEFAULT; |
| 133 | + this._projection = cc.Director.PROJECTION_DEFAULT; |
201 | 134 | // projection delegate if "Custom" projection is used |
202 | 135 | this._projectionDelegate = null; |
203 | 136 |
|
@@ -872,6 +805,35 @@ cc.Director._getInstance = function () { |
872 | 805 | */ |
873 | 806 | cc.defaultFPS = 60; |
874 | 807 |
|
| 808 | +//Possible OpenGL projections used by director |
| 809 | +/** |
| 810 | + * sets a 2D projection (orthogonal projection) |
| 811 | + * @constant |
| 812 | + * @type Number |
| 813 | + */ |
| 814 | +cc.Director.PROJECTION_2D = 0; |
| 815 | + |
| 816 | +/** |
| 817 | + * sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500. |
| 818 | + * @constant |
| 819 | + * @type Number |
| 820 | + */ |
| 821 | +cc.Director.PROJECTION_3D = 1; |
| 822 | + |
| 823 | +/** |
| 824 | + * it calls "updateProjection" on the projection delegate. |
| 825 | + * @constant |
| 826 | + * @type Number |
| 827 | + */ |
| 828 | +cc.Director.PROJECTION_CUSTOM = 3; |
| 829 | + |
| 830 | +/** |
| 831 | + * Default projection is 3D projection |
| 832 | + * @constant |
| 833 | + * @type Number |
| 834 | + */ |
| 835 | +cc.Director.PROJECTION_DEFAULT = cc.Director.PROJECTION_3D; |
| 836 | + |
875 | 837 | if (cc._renderType === cc._RENDER_TYPE_CANVAS) { |
876 | 838 |
|
877 | 839 | var _p = cc.Director.prototype; |
|
0 commit comments