s3d_scene_c.h (1510B)
1 /* Copyright (C) 2015-2023 |Méso|Star> (contact@meso-star.com) 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 16 #ifndef S3D_SCENE_C_H 17 #define S3D_SCENE_C_H 18 19 #include <rsys/hash_table.h> 20 #include <rsys/list.h> 21 #include <rsys/ref_count.h> 22 #include <rsys/signal.h> 23 24 /* Generate the htable_shape hash table */ 25 #define HTABLE_NAME shape 26 #define HTABLE_DATA struct s3d_shape* 27 #define HTABLE_KEY unsigned /* Id of the shape */ 28 #include <rsys/hash_table.h> 29 30 /* Declare the scene_shape_cb_T callback data type */ 31 CLBK(scene_shape_cb_T, ARG2 32 (const struct s3d_scene* scn, 33 const struct s3d_shape* shape)); 34 35 struct s3d_scene { 36 struct htable_shape shapes; /* List of attached shapes */ 37 size_t instances_count; /* # instances in the scene */ 38 struct list_node scnviews; /* Pool of available s3d_scene_view */ 39 40 signal_T sig_shape_detach; 41 42 struct s3d_device* dev; 43 ref_T ref; 44 }; 45 46 #endif /* S3D_SCENE_C_H */ 47