-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.ts
164 lines (140 loc) · 7.02 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
console.debug('AwayJS - Stage - 0.11.150');
export { AGALMiniAssembler } from './lib/aglsl/assembler/AGALMiniAssembler';
export { Flags } from './lib/aglsl/assembler/Flags';
export { FS } from './lib/aglsl/assembler/FS';
export { Opcode } from './lib/aglsl/assembler/Opcode';
export { OpcodeMap } from './lib/aglsl/assembler/OpcodeMap';
export { Part } from './lib/aglsl/assembler/Part';
export { RegMap } from './lib/aglsl/assembler/RegMap';
export { Sampler } from './lib/aglsl/assembler/Sampler';
export { SamplerMap } from './lib/aglsl/assembler/SamplerMap';
export { AGALTokenizer } from './lib/aglsl/AGALTokenizer';
export { AGLSLParser } from './lib/aglsl/AGLSLParser';
export { Description } from './lib/aglsl/Description';
export { Destination } from './lib/aglsl/Destination';
export { Header } from './lib/aglsl/Header';
export { Mapping } from './lib/aglsl/Mapping';
export { OpLUT } from './lib/aglsl/OpLUT';
export { Token } from './lib/aglsl/Token';
export { ContextGLBlendFactor, ContextGLBlendEquation } from './lib/base/ContextGLBlendFactor';
export { ContextGLClearMask } from './lib/base/ContextGLClearMask';
export { ContextGLCompareMode } from './lib/base/ContextGLCompareMode';
export { ContextGLDrawMode } from './lib/base/ContextGLDrawMode';
export { ContextGLMipFilter } from './lib/base/ContextGLMipFilter';
export { ContextGLProfile } from './lib/base/ContextGLProfile';
export { ContextGLProgramType } from './lib/base/ContextGLProgramType';
export { ContextGLStencilAction } from './lib/base/ContextGLStencilAction';
export { ContextGLTextureFilter } from './lib/base/ContextGLTextureFilter';
export { ContextGLTextureFormat } from './lib/base/ContextGLTextureFormat';
export { ContextGLTriangleFace } from './lib/base/ContextGLTriangleFace';
export { ContextGLVertexBufferFormat } from './lib/base/ContextGLVertexBufferFormat';
export { ContextGLWrapMode } from './lib/base/ContextGLWrapMode';
export { ContextMode } from './lib/base/ContextMode';
export { IContextGL } from './lib/base/IContextGL';
export { ICubeTexture } from './lib/base/ICubeTexture';
export { IIndexBuffer } from './lib/base/IIndexBuffer';
export { IProgram } from './lib/base/IProgram';
export { IVao } from './lib/base/IVao';
export { ITextureBase } from './lib/base/ITextureBase';
export { IVertexBuffer } from './lib/base/IVertexBuffer';
export { SamplerState } from './lib/base/SamplerState';
export { TouchPoint } from './lib/base/TouchPoint';
export { ImageEvent } from './lib/events/ImageEvent';
export { StageEvent } from './lib/events/StageEvent';
export { RTTEvent } from './lib/events/RTTEvent';
// export named all from subpackage
export * from './lib/image';
export { IImageFactory } from './lib/factories/IImageFactory';
export { FXAATask as Filter3DFXAATask } from './lib/filters/tasks/FXAATask';
export { BlurTask as Filter3DBlurTask } from './lib/filters/tasks/BlurTask';
export { TaskBase as Filter3DTaskBase } from './lib/filters/tasks/TaskBase';
export { BlurFilter as BlurFilter3D } from './lib/filters/BlurFilter';
export { FilterBase as Filter3DBase } from './lib/filters/FilterBase';
export { FXAAFilter as FXAAFilter3D } from './lib/filters/FXAAFilter';
export { ProgramData } from './lib/image/ProgramData';
export { ProgramDataPool } from './lib/image/ProgramDataPool';
export { StageManager } from './lib/managers/StageManager';
export { RTTBufferManager } from './lib/managers/RTTBufferManager';
export { Image2DParser } from './lib/parsers/Image2DParser';
export { ImageCubeParser } from './lib/parsers/ImageCubeParser';
export { TextureAtlasParser } from './lib/parsers/TextureAtlasParser';
export { RegisterPool } from './lib/shaders/RegisterPool';
export { ShaderRegisterCache } from './lib/shaders/ShaderRegisterCache';
export { ShaderRegisterData } from './lib/shaders/ShaderRegisterData';
export { ShaderRegisterElement } from './lib/shaders/ShaderRegisterElement';
export { ContextWebGL } from './lib/webgl/ContextWebGL';
export { CubeTextureWebGL } from './lib/webgl/CubeTextureWebGL';
export { IndexBufferWebGL } from './lib/webgl/IndexBufferWebGL';
export { ProgramWebGL } from './lib/webgl/ProgramWebGL';
export { TextureBaseWebGL } from './lib/webgl/TextureBaseWebGL';
export { TextureWebGL } from './lib/webgl/TextureWebGL';
export { VertexBufferWebGL } from './lib/webgl/VertexBufferWebGL';
export { BitmapImageUtils } from './lib/utils/BitmapImageUtils';
export { AttributesView } from './lib/attributes/AttributesView';
export { AttributesBuffer, _Stage_AttributesBuffer } from './lib/attributes/AttributesBuffer';
export { Byte4Attributes } from './lib/attributes/Byte4Attributes';
export { Float1Attributes } from './lib/attributes/Float1Attributes';
export { Float2Attributes } from './lib/attributes/Float2Attributes';
export { Float3Attributes } from './lib/attributes/Float3Attributes';
export { Float4Attributes } from './lib/attributes/Float4Attributes';
export { Short2Attributes } from './lib/attributes/Short2Attributes';
export { Short3Attributes } from './lib/attributes/Short3Attributes';
export { ContextWebGLFlags, ContextWebGLPreference } from './lib/webgl/ContextWebGLFlags';
export * from './lib/Settings';
import { Loader } from '@awayjs/core';
import { Stage } from './lib/Stage';
import {
Image2D, _Stage_Image2D,
ImageCube, _Stage_ImageCube,
BitmapImage2D, _Stage_BitmapImage2D,
BitmapImageCube, _Stage_BitmapImageCube,
ExternalImage2D, _Stage_ExternalImage2D,
SpecularImage2D,
ImageSampler,
} from './lib/image';
import { GradientAtlas, _Stage_GradientAtlass } from './lib/utils/GradientAtlas';
import { DefaultStageFactory } from './lib/factories/DefaultStageFactory';
import { Image2DParser } from './lib/parsers/Image2DParser';
import { ImageCubeParser } from './lib/parsers/ImageCubeParser';
import { TextureAtlasParser } from './lib/parsers/TextureAtlasParser';
import { ImageUtils } from './lib/utils/ImageUtils';
export { DefaultStageFactory };
export { ImageUtils };
export { Stage };
Loader.enableParser(Image2DParser);
Loader.enableParser(ImageCubeParser);
Loader.enableParser(TextureAtlasParser);
ImageUtils.registerDefaults(
() => {
const b: BitmapImage2D = new BitmapImage2D(8, 8, false, 0x000000);
//create chekerboard
let i: number, j: number;
for (i = 0; i < 8; i++)
for (j = 0; j < 8; j++)
if ((j & 1) ^ (i & 1))
b.setPixel(i, j, 0XFFFFFF);
return b;
},
() => {
const image2D:BitmapImage2D = <BitmapImage2D> ImageUtils.getDefaultImage2D();
const b = new BitmapImageCube(image2D.width);
for (let i = 0; i < 6; i++) {
b.drawBitmap(
i,
image2D.data,
0, 0,
image2D.width,
image2D.height);
}
return b;
},
() => new ImageSampler(),
() => new DefaultStageFactory(),
);
Stage.registerAbstraction(_Stage_Image2D, Image2D);
Stage.registerAbstraction(_Stage_ImageCube, ImageCube);
Stage.registerAbstraction(_Stage_BitmapImage2D, BitmapImage2D);
Stage.registerAbstraction(_Stage_BitmapImageCube, BitmapImageCube);
Stage.registerAbstraction(_Stage_ExternalImage2D, ExternalImage2D);
Stage.registerAbstraction(_Stage_BitmapImage2D, SpecularImage2D);
Stage.registerAbstraction(_Stage_GradientAtlass, GradientAtlas);