1 /* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 2 5 * of the License, or (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software Foundation, 14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 * 16 * The Original Code is Copyright (C) 2016 by Mike Erwin. 17 * All rights reserved. 18 */ 19 20 /** \file 21 * \ingroup gpu 22 * 23 * GPU geometric primitives 24 */ 25 26 #pragma once 27 28 #include "GPU_common.h" 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 typedef enum { 35 GPU_PRIM_POINTS, 36 GPU_PRIM_LINES, 37 GPU_PRIM_TRIS, 38 GPU_PRIM_LINE_STRIP, 39 GPU_PRIM_LINE_LOOP, /* GL has this, Vulkan does not */ 40 GPU_PRIM_TRI_STRIP, 41 GPU_PRIM_TRI_FAN, 42 43 GPU_PRIM_LINES_ADJ, 44 GPU_PRIM_TRIS_ADJ, 45 GPU_PRIM_LINE_STRIP_ADJ, 46 47 GPU_PRIM_NONE, 48 } GPUPrimType; 49 50 /* what types of primitives does each shader expect? */ 51 typedef enum { 52 GPU_PRIM_CLASS_NONE = 0, 53 GPU_PRIM_CLASS_POINT = (1 << 0), 54 GPU_PRIM_CLASS_LINE = (1 << 1), 55 GPU_PRIM_CLASS_SURFACE = (1 << 2), 56 GPU_PRIM_CLASS_ANY = GPU_PRIM_CLASS_POINT | GPU_PRIM_CLASS_LINE | GPU_PRIM_CLASS_SURFACE, 57 } GPUPrimClass; 58 59 /** 60 * TODO Improve error checking by validating that the shader is suited for this primitive type. 61 * GPUPrimClass GPU_primtype_class(GPUPrimType); 62 * bool GPU_primtype_belongs_to_class(GPUPrimType, GPUPrimClass); 63 **/ 64 65 #ifdef __cplusplus 66 } 67 #endif 68