src/render/opengles2/SDL_shaders_gles2.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 06 Feb 2011 00:00:13 -0800
changeset 5201 523409574510
child 5204 daa5463466c5
permissions -rw-r--r--
Added an OpenGL ES 2.0 renderer, contributed by itsnotabigtruck

This compiles, but it untested.
slouken@5201
     1
/*
slouken@5201
     2
    SDL - Simple DirectMedia Layer
slouken@5201
     3
    Copyright (C) 2010 itsnotabigtruck.
slouken@5201
     4
slouken@5201
     5
    Permission is hereby granted, free of charge, to any person obtaining a
slouken@5201
     6
    copy of this software and associated documentation files (the "Software"),
slouken@5201
     7
    to deal in the Software without restriction, including without limitation
slouken@5201
     8
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
slouken@5201
     9
    and/or sell copies of the Software, and to permit persons to whom the
slouken@5201
    10
    Software is furnished to do so, subject to the following conditions:
slouken@5201
    11
slouken@5201
    12
    The above copyright notice and this permission notice shall be included in
slouken@5201
    13
    all copies or substantial portions of the Software.
slouken@5201
    14
slouken@5201
    15
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
slouken@5201
    16
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
slouken@5201
    17
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
slouken@5201
    18
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
slouken@5201
    19
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
slouken@5201
    20
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
slouken@5201
    21
    DEALINGS IN THE SOFTWARE.
slouken@5201
    22
*/
slouken@5201
    23
slouken@5201
    24
#include "SDL_config.h"
slouken@5201
    25
slouken@5201
    26
#if SDL_VIDEO_RENDER_OGL_ES2
slouken@5201
    27
slouken@5201
    28
#ifndef SDL_shaderdata_h_
slouken@5201
    29
#define SDL_shaderdata_h_
slouken@5201
    30
slouken@5201
    31
#ifdef __IPHONEOS__
slouken@5201
    32
#include <OpenGLES/ES2/gl.h>
slouken@5201
    33
#else
slouken@5201
    34
#include <GLES2/gl2.h>
slouken@5201
    35
#endif
slouken@5201
    36
slouken@5201
    37
typedef struct GLES2_ShaderInstance
slouken@5201
    38
{
slouken@5201
    39
    GLenum type;
slouken@5201
    40
    GLenum format;
slouken@5201
    41
    int length;
slouken@5201
    42
    const void *data;
slouken@5201
    43
} GLES2_ShaderInstance;
slouken@5201
    44
slouken@5201
    45
typedef struct GLES2_Shader
slouken@5201
    46
{
slouken@5201
    47
    int instance_count;
slouken@5201
    48
    const GLES2_ShaderInstance *instances[4];
slouken@5201
    49
} GLES2_Shader;
slouken@5201
    50
slouken@5201
    51
typedef enum
slouken@5201
    52
{
slouken@5201
    53
    GLES2_SHADER_VERTEX_DEFAULT,
slouken@5201
    54
    GLES2_SHADER_FRAGMENT_SOLID_SRC,
slouken@5201
    55
    GLES2_SHADER_FRAGMENT_TEXTURE_SRC
slouken@5201
    56
} GLES2_ShaderType;
slouken@5201
    57
slouken@5201
    58
#define GLES2_SOURCE_SHADER (GLenum)-1
slouken@5201
    59
slouken@5201
    60
const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMode);
slouken@5201
    61
slouken@5201
    62
#endif /* SDL_shaderdata_h_ */
slouken@5201
    63
slouken@5201
    64
#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
slouken@5201
    65
slouken@5201
    66
/* vi: set ts=4 sw=4 expandtab: */