s3d_device_c.h (1742B)
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_DEVICE_C_H 19 #define S3D_DEVICE_C_H 20 21 #include "s3d_backend.h" 22 23 #include <rsys/ref_count.h> 24 #include <rsys/free_list.h> 25 26 struct name { FITEM; }; 27 #define FITEM_TYPE name 28 #include <rsys/free_list.h> 29 30 struct s3d_device { 31 int verbose; 32 struct logger* logger; 33 struct mem_allocator* allocator; 34 35 RTCDevice rtc; /* Embree device */ 36 37 struct flist_name names; /* List of shape id */ 38 39 ref_T ref; 40 }; 41 42 /* Conditionally log a message on the LOG_ERROR stream of the device logger, 43 * with respect to the device verbose flag */ 44 extern LOCAL_SYM void 45 log_error 46 (struct s3d_device* dev, 47 const char* msg, 48 ...) 49 #ifdef COMPILER_GCC 50 __attribute((format(printf, 2, 3))) 51 #endif 52 ; 53 54 /* Conditionally log a message on the LOG_WARNING stream of the device logger, 55 * with respect to the device verbose flag */ 56 extern LOCAL_SYM void 57 log_warning 58 (struct s3d_device* dev, 59 const char* msg, 60 ...) 61 #ifdef COMPILER_GCC 62 __attribute((format(printf, 2, 3))) 63 #endif 64 ; 65 66 #endif /* S3D_DEVICE_C_H */ 67