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 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(){

View File

@ -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();

View File

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

View File

@ -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;

View File

@ -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;