textmode.js 0.1.6-beta.3 → 0.1.6-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,31 +1,11 @@
1
+ import { BaseGeometry } from './BaseGeometry';
1
2
  /**
2
- * Line geometry for WebGL rendering that uses vertices to create lines of varying thickness.
3
- * Handles coordinate system differences between canvas and framebuffer targets by flipping Y-axis for framebuffers.
4
- * Creates a rectangular geometry to represent the line segment with the specified thickness.
3
+ * Line geometry renderer
5
4
  */
6
- export declare class Line {
7
- /** The WebGL rendering context */
8
- private gl;
9
- /** The vertex buffer containing position and texture coordinates */
10
- private vertexBuffer;
11
- /** The number of vertices in this geometry (always 6 for two triangles) */
12
- private readonly vertexCount;
13
- /** Bytes per vertex: vec2+vec2 = 16 bytes */
14
- private bytesPerVertex;
15
- constructor(gl: WebGLRenderingContext, x1: number, y1: number, x2: number, y2: number, weight: number);
5
+ export declare class Line extends BaseGeometry {
6
+ constructor(gl: WebGLRenderingContext);
16
7
  /**
17
- * Generate vertex data for a rectangle representing the line with texture coordinates
18
- * @private
8
+ * Draw a line from (x1, y1) to (x2, y2) with specified weight
19
9
  */
20
- private generateVertices;
21
- /**
22
- * Generate vertex data for the line rectangle with texture coordinates
23
- * Uses the four corners calculated based on line direction and thickness
24
- * @private
25
- */
26
- private generateLineVertices;
27
- /**
28
- * Render the line using position and texture coordinate attributes
29
- */
30
- render(): void;
10
+ draw(x1: number, y1: number, x2: number, y2: number, weight: number): void;
31
11
  }
@@ -1,25 +1,15 @@
1
+ import { BaseGeometry } from './BaseGeometry';
1
2
  /**
2
- * Simplified rectangle geometry for WebGL rendering using a unified vertex layout.
3
- * Always includes texture coordinates for maximum shader compatibility.
4
- * Handles coordinate system differences between canvas and framebuffer targets by flipping Y-axis for framebuffers.
3
+ * Rectangle geometry renderer with fill and stroke support
5
4
  */
6
- export declare class Rectangle {
7
- /** The WebGL rendering context */
8
- private gl;
9
- /** The vertex buffer containing position and texture coordinates */
10
- private vertexBuffer;
11
- /** The number of vertices in this geometry (always 6 for two triangles) */
12
- private readonly vertexCount;
13
- /** Bytes per vertex: depends on position format (vec2 vs vec3) */
14
- private bytesPerVertex;
15
- constructor(gl: WebGLRenderingContext, x: number, y: number, width: number, height: number);
5
+ export declare class Rectangle extends BaseGeometry {
6
+ constructor(gl: WebGLRenderingContext);
16
7
  /**
17
- * Generate vertex data for the rectangle with texture coordinates
18
- * @private
8
+ * Draw a filled rectangle
19
9
  */
20
- private generateVertices;
10
+ drawFill(x: number, y: number, width: number, height: number): void;
21
11
  /**
22
- * Render the rectangle using position and texture coordinate attributes
12
+ * Draw a rectangle stroke (outline)
23
13
  */
24
- render(): void;
14
+ drawStroke(x: number, y: number, width: number, height: number, weight: number): void;
25
15
  }
@@ -0,0 +1,3 @@
1
+ export { BaseGeometry } from './BaseGeometry';
2
+ export { Rectangle } from './Rectangle';
3
+ export { Line } from './Line';