Typedefs | Enumerations | Functions
tanvastouch.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tanvas/tanvastouch_errors.h>

Go to the source code of this file.

Typedefs

typedef struct tanvastouch_ctx tanvastouch_ctx
 
typedef uint64_t tanvastouch_resource_id
 
typedef void(* tanvastouch_log_cb) (void *data, const char *str)
 
typedef enum tanvastouch_wrap_mode_e tanvastouch_wrap_mode
 

Enumerations

enum  tanvastouch_wrap_mode_e { tanvastouch_wrap_mode_clamp = 0, tanvastouch_wrap_mode_tile = 1 }
 

Functions

const TANVASTOUCH_API char * tanvastouch_strerror (int err)
 
TANVASTOUCH_API bool tanvastouch_is_valid (tanvastouch_resource_id id)
 
TANVASTOUCH_API int tanvastouch_open (const char *engine_name, tanvastouch_ctx **p_ctx)
 
TANVASTOUCH_API int tanvastouch_close (tanvastouch_ctx *ctx)
 
TANVASTOUCH_API tanvastouch_log_cb tanvastouch_set_log_cb (tanvastouch_ctx *ctx, tanvastouch_log_cb cb, void *data)
 
TANVASTOUCH_API int tanvastouch_create_view (tanvastouch_ctx *ctx, tanvastouch_resource_id *p_view_id)
 
TANVASTOUCH_API int tanvastouch_destroy_view (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id)
 
TANVASTOUCH_API int tanvastouch_set_view_enabled (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, bool enabled)
 
TANVASTOUCH_API int tanvastouch_is_view_enabled (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, bool *p_enabled)
 
TANVASTOUCH_API int tanvastouch_set_view_position_on_desktop (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, float x, float y)
 
TANVASTOUCH_API int tanvastouch_get_view_position (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, float *p_x, float *p_y)
 
TANVASTOUCH_API int tanvastouch_set_view_size (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, int width, int height)
 
TANVASTOUCH_API int tanvastouch_get_view_size (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, int *p_width, int *p_height)
 
TANVASTOUCH_API int tanvastouch_add_sprite (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, tanvastouch_resource_id sprite_id)
 
TANVASTOUCH_API int tanvastouch_remove_sprite (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, tanvastouch_resource_id sprite_id)
 
TANVASTOUCH_API int tanvastouch_contains_sprite (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, tanvastouch_resource_id sprite_id, bool *p_contains)
 
TANVASTOUCH_API int tanvastouch_get_sprite_count (tanvastouch_ctx *ctx, tanvastouch_resource_id view_id, int *p_count)
 
TANVASTOUCH_API int tanvastouch_create_sprite (tanvastouch_ctx *ctx, tanvastouch_resource_id *p_sprite_id)
 
TANVASTOUCH_API int tanvastouch_destroy_sprite (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id)
 
TANVASTOUCH_API int tanvastouch_set_sprite_enabled (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, bool enabled)
 
TANVASTOUCH_API int tanvastouch_is_sprite_enabled (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, bool *p_enabled)
 
TANVASTOUCH_API int tanvastouch_set_sprite_position (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, float x, float y)
 
TANVASTOUCH_API int tanvastouch_get_sprite_position (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, float *p_x, float *p_y)
 
TANVASTOUCH_API int tanvastouch_set_sprite_size (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, int width, int height)
 
TANVASTOUCH_API int tanvastouch_get_sprite_size (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, int *p_width, int *p_height)
 
TANVASTOUCH_API int tanvastouch_set_sprite_rotation (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, float theta, float pivot_x, float pivot_y)
 
TANVASTOUCH_API int tanvastouch_get_sprite_theta (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, float *p_theta)
 
TANVASTOUCH_API int tanvastouch_get_sprite_pivot (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, float *p_pivot_x, float *p_pivot_y)
 
TANVASTOUCH_API int tanvastouch_set_sprite_material (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, tanvastouch_resource_id material_id)
 
TANVASTOUCH_API int tanvastouch_get_sprite_material (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, tanvastouch_resource_id *p_material_id)
 
TANVASTOUCH_API int tanvastouch_remove_sprite_material (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id)
 
TANVASTOUCH_API int tanvastouch_set_sprite_depth (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, float depth)
 
TANVASTOUCH_API int tanvastouch_get_sprite_depth (tanvastouch_ctx *ctx, tanvastouch_resource_id sprite_id, float *p_depth)
 
TANVASTOUCH_API int tanvastouch_create_material (tanvastouch_ctx *ctx, tanvastouch_resource_id *p_material_id)
 
TANVASTOUCH_API int tanvastouch_destroy_material (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id)
 
TANVASTOUCH_API int tanvastouch_add_material_texture (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id, int index, tanvastouch_resource_id texture_id)
 
TANVASTOUCH_API int tanvastouch_remove_material_texture (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id, int index)
 
TANVASTOUCH_API int tanvastouch_get_material_texture (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id, int index, tanvastouch_resource_id *p_texture_id)
 
TANVASTOUCH_API int tanvastouch_set_material_uv (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id, int index, float *p_uv)
 
TANVASTOUCH_API int tanvastouch_get_material_uv (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id, int index, float *p_uv)
 
TANVASTOUCH_API int tanvastouch_set_material_wrapping_mode (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id, int index, int mode)
 
TANVASTOUCH_API int tanvastouch_get_material_wrapping_mode (tanvastouch_ctx *ctx, tanvastouch_resource_id material_id, int index, int *p_mode)
 
TANVASTOUCH_API int tanvastouch_create_texture (tanvastouch_ctx *ctx, tanvastouch_resource_id *p_texture_id)
 
TANVASTOUCH_API int tanvastouch_destroy_texture (tanvastouch_ctx *ctx, tanvastouch_resource_id texture_id)
 
TANVASTOUCH_API int tanvastouch_set_texture_data (tanvastouch_ctx *ctx, tanvastouch_resource_id texture_id, const unsigned char *p_data, int width, int height)
 
TANVASTOUCH_API int tanvastouch_get_texture_size (tanvastouch_ctx *ctx, tanvastouch_resource_id texture_id, int *p_width, int *p_height)
 
TANVASTOUCH_API int tanvastouch_set_texture_data_partial (tanvastouch_ctx *ctx, tanvastouch_resource_id texture_id, const unsigned char *p_data, uint32_t length, uint32_t offset)
 
TANVASTOUCH_API int tanvastouch_get_texture_data_size (tanvastouch_ctx *ctx, tanvastouch_resource_id texture_id, uint32_t *p_size)