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