2015-06-21 17:33:46 +02:00
|
|
|
/*
|
|
|
|
Simple DirectMedia Layer
|
2019-01-05 07:01:14 +01:00
|
|
|
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
#include "../../SDL_internal.h"
|
|
|
|
|
2017-06-03 23:00:15 +02:00
|
|
|
#ifndef SDL_shaders_gles2_h_
|
|
|
|
#define SDL_shaders_gles2_h_
|
2015-06-21 17:33:46 +02:00
|
|
|
|
2017-11-13 07:51:12 +01:00
|
|
|
#if SDL_VIDEO_RENDER_OGL_ES2
|
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
typedef struct GLES2_ShaderInstance
|
|
|
|
{
|
|
|
|
GLenum type;
|
|
|
|
GLenum format;
|
|
|
|
int length;
|
|
|
|
const void *data;
|
|
|
|
} GLES2_ShaderInstance;
|
|
|
|
|
|
|
|
typedef struct GLES2_Shader
|
|
|
|
{
|
|
|
|
int instance_count;
|
|
|
|
const GLES2_ShaderInstance *instances[4];
|
|
|
|
} GLES2_Shader;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GLES2_SHADER_VERTEX_DEFAULT,
|
|
|
|
GLES2_SHADER_FRAGMENT_SOLID_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC,
|
2017-11-13 07:51:12 +01:00
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_YUV_JPEG_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_YUV_BT601_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_YUV_BT709_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_NV12_JPEG_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_NV12_BT601_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_NV12_BT709_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_NV21_JPEG_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_NV21_BT601_SRC,
|
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_NV21_BT709_SRC,
|
2017-12-12 21:52:17 +01:00
|
|
|
GLES2_SHADER_FRAGMENT_TEXTURE_EXTERNAL_OES_SRC
|
2015-06-21 17:33:46 +02:00
|
|
|
} GLES2_ShaderType;
|
|
|
|
|
|
|
|
#define GLES2_SOURCE_SHADER (GLenum)-1
|
|
|
|
|
Implemented more flexible blending modes for accelerated renderers
This fixes bug 2594 - Propose new blend mode, SDL_BLENDMODE_BLEND_DSTA
blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA,
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
SDL_BLENDOPERATION_ADD,
SDL_BLENDFACTOR_ZERO,
SDL_BLENDFACTOR_ONE,
SDL_BLENDOPERATION_ADD);
This fixes bug 2828 - Subtractive Blending
blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA,
SDL_BLENDFACTOR_ONE,
SDL_BLENDOPERATION_SUBTRACT,
SDL_BLENDFACTOR_ZERO,
SDL_BLENDFACTOR_ONE,
SDL_BLENDOPERATION_SUBTRACT);
This goes partway to fixing bug 3684 - Add support for a pre-multiplied alpha blending mode
blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE,
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
SDL_BLENDOPERATION_ADD,
SDL_BLENDFACTOR_ONE,
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
SDL_BLENDOPERATION_ADD);
2017-08-14 14:51:44 +02:00
|
|
|
const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type);
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
|
|
|
|
|
2017-11-13 07:51:12 +01:00
|
|
|
#endif /* SDL_shaders_gles2_h_ */
|
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
/* vi: set ts=4 sw=4 expandtab: */
|