43 lines
982 B
C
43 lines
982 B
C
/**
|
|
* Copyright (c) 2021 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include <dawn/dawn.h>
|
|
#include "../display/primitive.h"
|
|
#include "../display/primitives/quad.h"
|
|
#include "../display/shader.h"
|
|
|
|
/**
|
|
* Initialize an image.
|
|
*
|
|
* @param image Image to initialize.
|
|
* @param texture Texture to use for initialization.
|
|
*/
|
|
void imageInit(image_t *image, texture_t *texture);
|
|
|
|
/**
|
|
* Set the texture for an image. This will also initialize the underlying quad.
|
|
*
|
|
* @param image Image to set the texture for.
|
|
* @param texture Texture to use.
|
|
*/
|
|
void imageSetTexture(image_t *image, texture_t *texture);
|
|
|
|
/**
|
|
* Render an image
|
|
*
|
|
* @param image Image to render.
|
|
* @param shader Shader to use while rendering.
|
|
*/
|
|
void imageRender(image_t *image, shader_t *shader);
|
|
|
|
/**
|
|
* Cleanup a previously initialized image.
|
|
*
|
|
* @param image Image to dispose.
|
|
*/
|
|
void imageDispose(image_t *image); |