commit files

This commit is contained in:
jerrywwl
2019-02-18 09:35:54 +08:00
parent 64ce38e24d
commit 85104d1995
4 changed files with 22 additions and 5 deletions
+11
View File
@@ -15,6 +15,12 @@ import { GFXTexture, IGFXTextureInfo } from './texture';
import { GFXTextureView, IGFXTextureViewInfo } from './texture-view';
import { GFXWindow, IGFXWindowInfo } from './window';
export enum GFXAPI {
UNKNOWN,
WEBGL,
WEBGL2,
}
export enum GFXFeature {
TEXTURE_FLOAT,
TEXTURE_HALF_FLOAT,
@@ -39,6 +45,10 @@ export abstract class GFXDevice {
return this._canvas2D as HTMLCanvasElement;
}
public get gfxAPI (): GFXAPI {
return this._gfxAPI;
}
public get queue (): GFXQueue {
return this._queue as GFXQueue;
}
@@ -105,6 +115,7 @@ export abstract class GFXDevice {
protected _canvas: HTMLCanvasElement | null = null;
protected _canvas2D: HTMLCanvasElement | null = null;
protected _gfxAPI: GFXAPI = GFXAPI.UNKNOWN;
protected _deviceName: string = '';
protected _renderer: string = '';
protected _vendor: string = '';
+2 -1
View File
@@ -13,7 +13,7 @@ import {
GFXTextureType,
GFXTextureViewType,
} from '../define';
import { GFXDevice, GFXFeature, IGFXDeviceInfo } from '../device';
import { GFXDevice, GFXFeature, IGFXDeviceInfo, GFXAPI } from '../device';
import { GFXFramebuffer, IGFXFramebufferInfo } from '../framebuffer';
import { GFXInputAssembler, IGFXInputAssemblerInfo } from '../input-assembler';
import { GFXPipelineLayout, IGFXPipelineLayoutInfo } from '../pipeline-layout';
@@ -215,6 +215,7 @@ export class WebGLGFXDevice extends GFXDevice {
console.info('WebGL device initialized.');
this._gfxAPI = GFXAPI.WEBGL;
this._deviceName = 'WebGL';
const gl = this._webGLRC;
+3 -2
View File
@@ -3,7 +3,7 @@ import { GFXBuffer, IGFXBufferInfo } from '../buffer';
import { GFXCommandAllocator, IGFXCommandAllocatorInfo } from '../command-allocator';
import { GFXCommandBuffer, IGFXCommandBufferInfo } from '../command-buffer';
import { GFXBufferTextureCopy, GFXFormat, GFXFormatInfos, GFXFormatSize, GFXQueueType } from '../define';
import { GFXDevice, GFXFeature, IGFXDeviceInfo } from '../device';
import { GFXDevice, GFXFeature, IGFXDeviceInfo, GFXAPI } from '../device';
import { GFXFramebuffer, IGFXFramebufferInfo } from '../framebuffer';
import { GFXInputAssembler, IGFXInputAssemblerInfo } from '../input-assembler';
import { GFXPipelineLayout, IGFXPipelineLayoutInfo } from '../pipeline-layout';
@@ -124,7 +124,7 @@ export class WebGL2GFXDevice extends GFXDevice {
// No errors are thrown using try catch
// Tested through ios baidu browser 4.14.1
if (!this._webGL2RC) {
console.error('This device does not support WebGL.');
console.error('This device does not support WebGL2.');
return false;
}
@@ -132,6 +132,7 @@ export class WebGL2GFXDevice extends GFXDevice {
console.info('WebGL2 device initialized.');
this._gfxAPI = GFXAPI.WEBGL2;
this._deviceName = 'WebGL2';
const gl = this._webGL2RC;
+6 -2
View File
@@ -31,11 +31,15 @@ class Node extends BaseNode {
public uiWidgetComp: WidgetComponent | null = null;
// local transform
@property
@property({
default: cc.v3(0, 0, 0),
})
protected _lpos = new Vec3();
@property
protected _lrot = new Quat();
@property
@property({
default: cc.v3(1, 1, 1),
})
protected _lscale = new Vec3(1, 1, 1);
@property
protected _layer = Layers.Default; // the layer this node belongs to