star-3dut

Generate meshes of simple geometric shapes
git clone git://git.meso-star.fr/star-3dut.git
Log | Files | Refs | README | LICENSE

commit a9f68b5b689cf4ee00b196c948aea07b499d6025
parent 3295e6e2b78d70b7af48abc1fbfeb995f01d30ac
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 25 Nov 2016 08:58:25 +0100

Add the main API header

Define the s3dut_mesh generic API and the profile of the
s3dut_create_sphere function.

Diffstat:
Asrc/s3dut.h | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+), 0 deletions(-)

diff --git a/src/s3dut.h b/src/s3dut.h @@ -0,0 +1,61 @@ +/* Copyright (C) |Meso|Star> 2016 (contact@meso-star.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef S3DUT_H +#define S3DUT_H + +#include <rsys/rsys.h> + +/* Library symbol management */ +#if defined(S3DUT_SHARED_BUILD) /* Build shared library */ + #define S3DUT_API extern EXPORT_SYM +#elif defined(S3DUT_STATIC_BUILD) /* Use/build static library */ + #define S3DUT_API extern LOCAL_SYM +#else /* Use shared library */ + #define S3DUT_API extern IMPORT_SYM +#endif + +/* Helper macro that asserts if the invocation of the s3dut function `Func' + * returns an error. */ +#ifndef NDEBUG + #define S3DUT(Func) ASSERT(s3dut_##Func == RES_OK) +#else + #define S3DUT(Func) s3dut_##Func +#endif + +struct mem_allocator; +struct s3dut_mesh; + +/******************************************************************************* + * Stard-3DUT API + ******************************************************************************/ +S3DUT_API res_T +s3dut_create_sphere + (struct mem_allocator* allocator, /* May be NULL <=> use default allocator */ + const double radius, + const unsigned nslices, /* # subdivisions around the Z axis */ + const unsigned nstacks, /* # subdivisions along the Z axis */ + struct s3dut_mesh** sphere); + +S3DUT_API res_T +s3dut_mesh_ref_get + (struct s3dut_mesh* mesh); + +S3DUT_API res_T +s3dut_mesh_ref_put + (struct s3dut_mesh* mesh); + +#endif /* S3DUT_H */ +