Document shader_context.c

This commit is contained in:
twinaphex 2015-01-11 20:20:34 +01:00
parent b243f64554
commit f259b56d5f
3 changed files with 32 additions and 2 deletions

View File

@ -179,7 +179,7 @@ static const gfx_ctx_driver_t *gfx_ctx_init(void *data,
* @hw_render_ctx : Request a graphics context driver capable of * @hw_render_ctx : Request a graphics context driver capable of
* hardware rendering? * hardware rendering?
* *
* Finds first suitable graphics context driver and initializes. * Finds graphics context driver and initializes.
* *
* Returns: graphics context driver if found, otherwise NULL. * Returns: graphics context driver if found, otherwise NULL.
**/ **/

View File

@ -35,19 +35,34 @@ static const shader_backend_t *shader_ctx_drivers[] = {
NULL NULL
}; };
/**
* shader_ctx_find_driver:
* @ident : Identifier of shader context driver to find.
*
* Finds shader context driver and initializes.
*
* Returns: shader context driver if found, otherwise NULL.
**/
const shader_backend_t *shader_ctx_find_driver(const char *ident) const shader_backend_t *shader_ctx_find_driver(const char *ident)
{ {
unsigned i; unsigned i;
for (i = 0; shader_ctx_drivers[i]; i++) for (i = 0; shader_ctx_drivers[i]; i++)
{ {
if (strcmp(shader_ctx_drivers[i]->ident, ident) == 0) if (!strcmp(shader_ctx_drivers[i]->ident, ident))
return shader_ctx_drivers[i]; return shader_ctx_drivers[i];
} }
return NULL; return NULL;
} }
/**
* shader_ctx_init_first:
*
* Finds first suitable shader context driver and initializes.
*
* Returns: shader context driver if found, otherwise NULL.
**/
const shader_backend_t *shader_ctx_init_first(void) const shader_backend_t *shader_ctx_init_first(void)
{ {
unsigned i; unsigned i;

View File

@ -84,8 +84,23 @@ extern const shader_backend_t shader_null_backend;
#endif #endif
/**
* shader_ctx_find_driver:
* @ident : Identifier of shader context driver to find.
*
* Finds shader context driver and initializes.
*
* Returns: shader context driver if found, otherwise NULL.
**/
const shader_backend_t *shader_ctx_find_driver(const char *ident); const shader_backend_t *shader_ctx_find_driver(const char *ident);
/**
* shader_ctx_init_first:
*
* Finds first suitable shader context driver and initializes.
*
* Returns: shader context driver if found, otherwise NULL.
**/
const shader_backend_t *shader_ctx_init_first(void); const shader_backend_t *shader_ctx_init_first(void);
#endif #endif