* \{
*/
-/*!
-* CPU raster engine type.
-*
-* \ingroup ThorVGCapi_Initializer
-*/
-#define TVG_ENGINE_SW (1 << 1)
-
-
-/*!
-* OpenGL raster engine type.
-*
-* \ingroup ThorVGCapi_Initializer
-*/
-#define TVG_ENGINE_GL (1 << 2)
-
/**
* \brief A structure responsible for managing and drawing graphical elements.
/**
+* \brief Enumeration specifying the engine type used for the graphics backend. For multiple backeneds bitwise operation is allowed.
+*
+* \ingroup ThorVGCapi_Initializer
+*/
+typedef enum {
+ TVG_ENGINE_SW = (1 << 1), ///< CPU rasterizer.
+ TVG_ENGINE_GL = (1 << 2) ///< OpenGL rasterizer.
+} Tvg_Engine;
+
+
+/**
* \brief Enumeration specifying the result from the APIs.
*/
typedef enum {
*
* \note The Initializer keeps track of the number of times it was called. Threads count is fixed at the first init() call.
* \see tvg_engine_term()
-* \see TVG_ENGINE_SW, TVG_ENGINE_GL
+* \see Tvg_Engine
*/
-TVG_EXPORT Tvg_Result tvg_engine_init(unsigned engine_method, unsigned threads);
+TVG_EXPORT Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads);
/*!
* \retval TVG_RESULT_UNKNOWN An internal error.
*
* \see tvg_engine_init()
-* \see TVG_ENGINE_SW, TVG_ENGINE_GL
+* \see Tvg_Engine
*/
-TVG_EXPORT Tvg_Result tvg_engine_term(unsigned engine_method);
+TVG_EXPORT Tvg_Result tvg_engine_term(Tvg_Engine engine_method);
/** \} */ // end defgroup ThorVGCapi_Initializer
* }
*
* tvg_canvas_destroy(canvas);
-* tvg_engine_term()
+* tvg_engine_term(TVG_ENGINE_SW)
* \endcode
*
* \param[in] canvas The Tvg_Canvas object to be destroyed.
* tvg_canvas_reserve(canvas, 100); //reserve array for 100 paints in canvas.
*
* tvg_canvas_destroy(canvas);
-* tvg_engine_term()
+* tvg_engine_term(TVG_ENGINE_SW)
* \endcode
*
* \param[in] canvas The Tvg_Canvas object managing the reserved memory.
* \return Tvg_Result enumeration.
* \retval TVG_RESULT_SUCCESS Succeed.
* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument.
-* \retval TVG_RESULT_INSUFFICIENT_CONDITION No saving task is running.
+* \retval TVG_RESULT_INSUFFICIENT_CONDITION No saving task is running.
*
* \note The asynchronous tasking is dependent on the Saver module implementation.
* \see tvg_saver_save()
/* Engine API */
/************************************************************************/
-TVG_EXPORT Tvg_Result tvg_engine_init(unsigned engine_method, unsigned threads)
+TVG_EXPORT Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads)
{
return (Tvg_Result) Initializer::init(CanvasEngine(engine_method), threads);
}
-TVG_EXPORT Tvg_Result tvg_engine_term(unsigned engine_method)
+TVG_EXPORT Tvg_Result tvg_engine_term(Tvg_Engine engine_method)
{
return (Tvg_Result) Initializer::term(CanvasEngine(engine_method));
}