Simp module

texture_load_from_bitmap

procedureSource

Uploads bitmap to the graphics card as texture. Returns false when that fails.

Example
bitmap: Bitmap;
bitmap_alloc(*bitmap, 16, 16, .RGBA8);
defer deinit(*bitmap);

texture: Texture;
assert(texture_load_from_bitmap(*texture, *bitmap));

This one is only checked to compile, not run.

texture_load_from_bitmap :: (texture: *Texture, bitmap: *Bitmap) -> bool

Uploads bitmap to the graphics card as texture. Returns false when that fails.

Parameters

texture: *Texture
gets the pixels. Its old storage is replaced.
bitmap: *Bitmap

Returns

bool
Example
bitmap: Bitmap;
bitmap_alloc(*bitmap, 16, 16, .RGBA8);
defer deinit(*bitmap);

texture: Texture;
assert(texture_load_from_bitmap(*texture, *bitmap));

This one is only checked to compile, not run.

See also