Simple Directmedia Layer
at main 63 lines 2.0 kB view raw
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21 22#ifndef SDL_shaders_gpu_h_ 23#define SDL_shaders_gpu_h_ 24 25#include "SDL_internal.h" 26 27// SDL_GPU shader implementation 28 29typedef enum 30{ 31 VERT_SHADER_INVALID = -1, 32 VERT_SHADER_LINEPOINT, 33 VERT_SHADER_TRI_COLOR, 34 VERT_SHADER_TRI_TEXTURE, 35 36 NUM_VERT_SHADERS, 37} GPU_VertexShaderID; 38 39typedef enum 40{ 41 FRAG_SHADER_INVALID = -1, 42 FRAG_SHADER_COLOR, 43 FRAG_SHADER_TEXTURE_RGB, 44 FRAG_SHADER_TEXTURE_RGBA, 45 46 NUM_FRAG_SHADERS, 47} GPU_FragmentShaderID; 48 49struct GPU_Shaders 50{ 51 SDL_GPUShader *vert_shaders[NUM_VERT_SHADERS]; 52 SDL_GPUShader *frag_shaders[NUM_FRAG_SHADERS]; 53}; 54 55typedef struct GPU_Shaders GPU_Shaders; 56 57void GPU_FillSupportedShaderFormats(SDL_PropertiesID props); 58extern bool GPU_InitShaders(GPU_Shaders *shaders, SDL_GPUDevice *device); 59extern void GPU_ReleaseShaders(GPU_Shaders *shaders, SDL_GPUDevice *device); 60extern SDL_GPUShader *GPU_GetVertexShader(GPU_Shaders *shaders, GPU_VertexShaderID id); 61extern SDL_GPUShader *GPU_GetFragmentShader(GPU_Shaders *shaders, GPU_FragmentShaderID id); 62 63#endif // SDL_shaders_gpu_h_