From 2795ee3ada638a1ea6ef33f46130cf475c4fbd39 Mon Sep 17 00:00:00 2001 From: monoid Date: Sat, 9 Oct 2021 20:35:57 +0900 Subject: [PATCH] rename "renderer" to "drawer" --- index.tsx | 4 ++-- src/app.ts | 12 ++++++------ src/{program.ts => drawable.ts} | 2 +- src/{renderer.ts => drawer2D.ts} | 4 ++-- src/{triangle_renderer.ts => triangle_drawer.ts} | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) rename src/{program.ts => drawable.ts} (55%) rename src/{renderer.ts => drawer2D.ts} (95%) rename src/{triangle_renderer.ts => triangle_drawer.ts} (94%) diff --git a/index.tsx b/index.tsx index 9916434..000f78b 100644 --- a/index.tsx +++ b/index.tsx @@ -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(){ diff --git a/src/app.ts b/src/app.ts index d951f2c..3e4e7d5 100644 --- a/src/app.ts +++ b/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(); diff --git a/src/program.ts b/src/drawable.ts similarity index 55% rename from src/program.ts rename to src/drawable.ts index f6c069b..58b86b0 100644 --- a/src/program.ts +++ b/src/drawable.ts @@ -1,4 +1,4 @@ -export interface RenderProgram{ +export interface Drawable{ draw(gl:WebGL2RenderingContext):void; }; \ No newline at end of file diff --git a/src/renderer.ts b/src/drawer2D.ts similarity index 95% rename from src/renderer.ts rename to src/drawer2D.ts index 73a054f..353b0f7 100644 --- a/src/renderer.ts +++ b/src/drawer2D.ts @@ -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; diff --git a/src/triangle_renderer.ts b/src/triangle_drawer.ts similarity index 94% rename from src/triangle_renderer.ts rename to src/triangle_drawer.ts index 5015c85..038264e 100644 --- a/src/triangle_renderer.ts +++ b/src/triangle_drawer.ts @@ -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;