Skip to main content
Latest
method TextureCreator.prototype.createTexture
import { TextureCreator } from "https://deno.land/x/sdl2@0.9.0/mod.ts";

Create a texture for a rendering context.

Examples

Example 1

const creator = canvas.textureCreator();
const texture = creator.createTexture(
 PixelFormat.RGBA8888,
 TextureAccess.Static,
 640,
 480,
);

Parameters

format: number

the format of the texture

access: number

one of the enumerated values in TextureAccess or a number

w: number

the width of the texture in pixels

h: number

the height of the texture in pixels

Returns

a Texture object