rename "renderer" to "drawer"

This commit is contained in:
monoid 2021-10-09 20:35:57 +09:00
parent 2058e610cc
commit 2795ee3ada
5 changed files with 13 additions and 13 deletions

View File

@ -1,10 +1,10 @@
import { Renderer2D } from './src/renderer'; import { Drawer2D } from './src/drawer2D';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { MenuBar } from "./src/menu"; import { MenuBar } from "./src/menu";
import { TriangleRenderer } from './src/triangle_renderer'; import { TriangleDrawer } from './src/triangle_drawer';
import {CanvasApp} from "./src/app" import {CanvasApp} from "./src/app"
function findCanvas(){ function findCanvas(){

View File

@ -1,14 +1,14 @@
import { Renderer2D } from "./renderer"; import { Drawer2D } from "./drawer2D";
import { TriangleRenderer } from "./triangle_renderer"; import { TriangleDrawer } from "./triangle_drawer";
export class CanvasApp{ export class CanvasApp{
readonly gl: WebGL2RenderingContext; readonly gl: WebGL2RenderingContext;
renderer: Renderer2D; renderer: Drawer2D;
trenderer : TriangleRenderer; trenderer : TriangleDrawer;
constructor(gl: WebGL2RenderingContext){ constructor(gl: WebGL2RenderingContext){
this.gl = gl; this.gl = gl;
this.renderer = new Renderer2D(gl); this.renderer = new Drawer2D(gl);
this.trenderer = new TriangleRenderer(gl); this.trenderer = new TriangleDrawer(gl);
} }
intialize():boolean{ intialize():boolean{
this.renderer.prepare(); this.renderer.prepare();

View File

@ -1,4 +1,4 @@
export interface RenderProgram{ export interface Drawable{
draw(gl:WebGL2RenderingContext):void; draw(gl:WebGL2RenderingContext):void;
}; };

View File

@ -4,11 +4,11 @@ import {createProgramFromSource, ProgramError, ShaderError} from "./gl_util";
import vert_src from "./vertex.vert"; import vert_src from "./vertex.vert";
import frag_src from "./fragment.frag"; import frag_src from "./fragment.frag";
import { RenderProgram } from "./program"; import { Drawable } from "./drawable";
import * as G from "./glWrapper"; import * as G from "./glWrapper";
import { getUniformDefaultValue, UniformSet } from "./uniform"; import { getUniformDefaultValue, UniformSet } from "./uniform";
export class Renderer2D implements RenderProgram{ export class Drawer2D implements Drawable{
gl : WebGL2RenderingContext; gl : WebGL2RenderingContext;
uniforms : UniformSet; uniforms : UniformSet;
program: G.GLProgram; program: G.GLProgram;

View File

@ -1,4 +1,4 @@
import { RenderProgram } from "./program"; import { Drawable } from "./drawable";
import {createProgramFromSource, ProgramError, ShaderError} from "./gl_util"; import {createProgramFromSource, ProgramError, ShaderError} from "./gl_util";
import { createIndexBuffer, createVertexArray, createVertexBuffer, GLProgram, IndexBuffer, VertexArray, VertexBuffer } from "./glWrapper"; 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; readonly program : GLProgram;
vao : VertexArray; vao : VertexArray;
indexBuffer : IndexBuffer; indexBuffer : IndexBuffer;