rename "renderer" to "drawer"
This commit is contained in:
parent
2058e610cc
commit
2795ee3ada
@ -1,10 +1,10 @@
|
||||
import { Renderer2D } from './src/renderer';
|
||||
import { Drawer2D } from './src/drawer2D';
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import { MenuBar } from "./src/menu";
|
||||
import { TriangleRenderer } from './src/triangle_renderer';
|
||||
import { TriangleDrawer } from './src/triangle_drawer';
|
||||
import {CanvasApp} from "./src/app"
|
||||
|
||||
function findCanvas(){
|
||||
|
12
src/app.ts
12
src/app.ts
@ -1,14 +1,14 @@
|
||||
import { Renderer2D } from "./renderer";
|
||||
import { TriangleRenderer } from "./triangle_renderer";
|
||||
import { Drawer2D } from "./drawer2D";
|
||||
import { TriangleDrawer } from "./triangle_drawer";
|
||||
|
||||
export class CanvasApp{
|
||||
readonly gl: WebGL2RenderingContext;
|
||||
renderer: Renderer2D;
|
||||
trenderer : TriangleRenderer;
|
||||
renderer: Drawer2D;
|
||||
trenderer : TriangleDrawer;
|
||||
constructor(gl: WebGL2RenderingContext){
|
||||
this.gl = gl;
|
||||
this.renderer = new Renderer2D(gl);
|
||||
this.trenderer = new TriangleRenderer(gl);
|
||||
this.renderer = new Drawer2D(gl);
|
||||
this.trenderer = new TriangleDrawer(gl);
|
||||
}
|
||||
intialize():boolean{
|
||||
this.renderer.prepare();
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
export interface RenderProgram{
|
||||
export interface Drawable{
|
||||
draw(gl:WebGL2RenderingContext):void;
|
||||
};
|
@ -4,11 +4,11 @@ import {createProgramFromSource, ProgramError, ShaderError} from "./gl_util";
|
||||
import vert_src from "./vertex.vert";
|
||||
import frag_src from "./fragment.frag";
|
||||
|
||||
import { RenderProgram } from "./program";
|
||||
import { Drawable } from "./drawable";
|
||||
import * as G from "./glWrapper";
|
||||
import { getUniformDefaultValue, UniformSet } from "./uniform";
|
||||
|
||||
export class Renderer2D implements RenderProgram{
|
||||
export class Drawer2D implements Drawable{
|
||||
gl : WebGL2RenderingContext;
|
||||
uniforms : UniformSet;
|
||||
program: G.GLProgram;
|
@ -1,4 +1,4 @@
|
||||
import { RenderProgram } from "./program";
|
||||
import { Drawable } from "./drawable";
|
||||
import {createProgramFromSource, ProgramError, ShaderError} from "./gl_util";
|
||||
import { createIndexBuffer, createVertexArray, createVertexBuffer, GLProgram, IndexBuffer, VertexArray, VertexBuffer } from "./glWrapper";
|
||||
|
||||
@ -18,7 +18,7 @@ void main() {
|
||||
}
|
||||
`;
|
||||
|
||||
export class TriangleRenderer implements RenderProgram{
|
||||
export class TriangleDrawer implements Drawable{
|
||||
readonly program : GLProgram;
|
||||
vao : VertexArray;
|
||||
indexBuffer : IndexBuffer;
|
Loading…
Reference in New Issue
Block a user