1 /* RetroArch - A frontend for libretro. 2 * Copyright (C) 2010-2014 - Hans-Kristian Arntzen 3 * copyright (c) 2011-2017 - Daniel De Matteis 4 * 5 * RetroArch is free software: you can redistribute it and/or modify it under the terms 6 * of the GNU General Public License as published by the Free Software Found- 7 * ation, either version 3 of the License, or (at your option) any later version. 8 * 9 * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 10 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 11 * PURPOSE. See the GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License along with RetroArch. 14 * If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17 #ifndef __VIDEO_COORD_ARRAY_H 18 #define __VIDEO_COORD_ARRAY_H 19 20 #include <stdint.h> 21 #include <string.h> 22 23 #include <boolean.h> 24 #include <retro_common_api.h> 25 26 RETRO_BEGIN_DECLS 27 28 struct video_fbo_rect 29 { 30 unsigned img_width; 31 unsigned img_height; 32 unsigned max_img_width; 33 unsigned max_img_height; 34 unsigned width; 35 unsigned height; 36 }; 37 38 struct video_ortho 39 { 40 float left; 41 float right; 42 float bottom; 43 float top; 44 float znear; 45 float zfar; 46 }; 47 48 struct video_tex_info 49 { 50 unsigned int tex; 51 float input_size[2]; 52 float tex_size[2]; 53 float coord[8]; 54 }; 55 56 typedef struct video_coords 57 { 58 const float *vertex; 59 const float *color; 60 const float *tex_coord; 61 const float *lut_tex_coord; 62 const unsigned *index; 63 unsigned vertices; 64 unsigned indexes; 65 } video_coords_t; 66 67 typedef struct video_mut_coords 68 { 69 float *vertex; 70 float *color; 71 float *tex_coord; 72 float *lut_tex_coord; 73 unsigned *index; 74 unsigned vertices; 75 unsigned indexes; 76 } video_mut_coords_t; 77 78 typedef struct video_coord_array 79 { 80 video_mut_coords_t coords; /* ptr alignment */ 81 unsigned allocated; 82 } video_coord_array_t; 83 84 typedef struct video_font_raster_block 85 { 86 video_coord_array_t carr; /* ptr alignment */ 87 bool fullscreen; 88 } video_font_raster_block_t; 89 90 bool video_coord_array_append(video_coord_array_t *ca, 91 const video_coords_t *coords, unsigned count); 92 93 void video_coord_array_free(video_coord_array_t *ca); 94 95 RETRO_END_DECLS 96 97 #endif 98