mojoshader_effects.h
author Caleb Cornett <caleb.cornett@outlook.com>
Sun, 12 Jan 2020 11:39:49 -0500
changeset 1229 3ecd29a50d9d
parent 1152 8f7653f0dc37
child 1235 8fd6c5efe453
permissions -rw-r--r--
Metal Effect support!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     1
/**
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     2
 * MojoShader; generate shader programs from bytecode of compiled
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     3
 *  Direct3D shaders.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     4
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     5
 * Please see the file LICENSE.txt in the source's root directory.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     6
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     7
 *  This file written by Ryan C. Gordon.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     8
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     9
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    10
#ifndef MOJOSHADER_EFFECTS_H
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    11
#define MOJOSHADER_EFFECTS_H
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    12
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    13
#ifdef MOJOSHADER_EFFECT_SUPPORT
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    14
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    15
/* MOJOSHADER_effectState types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    16
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    17
typedef enum MOJOSHADER_renderStateType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    18
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    19
    /* Note that we are NOT using the actual RS values from D3D here.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    20
     * For some reason, in the binary data, it's 0-based.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    21
     * Even worse, it doesn't even seem to be in order.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    22
     * Here is the list of changes compared to the real D3DRS enum:
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    23
     * - All of the RS_WRAP values are in a row, not separate!
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    24
     *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    25
     * -flibit
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    26
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    27
    MOJOSHADER_RS_ZENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    28
    MOJOSHADER_RS_FILLMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    29
    MOJOSHADER_RS_SHADEMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    30
    MOJOSHADER_RS_ZWRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    31
    MOJOSHADER_RS_ALPHATESTENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    32
    MOJOSHADER_RS_LASTPIXEL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    33
    MOJOSHADER_RS_SRCBLEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    34
    MOJOSHADER_RS_DESTBLEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    35
    MOJOSHADER_RS_CULLMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    36
    MOJOSHADER_RS_ZFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    37
    MOJOSHADER_RS_ALPHAREF,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    38
    MOJOSHADER_RS_ALPHAFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    39
    MOJOSHADER_RS_DITHERENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    40
    MOJOSHADER_RS_ALPHABLENDENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    41
    MOJOSHADER_RS_FOGENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    42
    MOJOSHADER_RS_SPECULARENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    43
    MOJOSHADER_RS_FOGCOLOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    44
    MOJOSHADER_RS_FOGTABLEMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    45
    MOJOSHADER_RS_FOGSTART,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    46
    MOJOSHADER_RS_FOGEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    47
    MOJOSHADER_RS_FOGDENSITY,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    48
    MOJOSHADER_RS_RANGEFOGENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    49
    MOJOSHADER_RS_STENCILENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    50
    MOJOSHADER_RS_STENCILFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    51
    MOJOSHADER_RS_STENCILZFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    52
    MOJOSHADER_RS_STENCILPASS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    53
    MOJOSHADER_RS_STENCILFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    54
    MOJOSHADER_RS_STENCILREF,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    55
    MOJOSHADER_RS_STENCILMASK,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    56
    MOJOSHADER_RS_STENCILWRITEMASK,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    57
    MOJOSHADER_RS_TEXTUREFACTOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    58
    MOJOSHADER_RS_WRAP0,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    59
    MOJOSHADER_RS_WRAP1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    60
    MOJOSHADER_RS_WRAP2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    61
    MOJOSHADER_RS_WRAP3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    62
    MOJOSHADER_RS_WRAP4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    63
    MOJOSHADER_RS_WRAP5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    64
    MOJOSHADER_RS_WRAP6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    65
    MOJOSHADER_RS_WRAP7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    66
    MOJOSHADER_RS_WRAP8,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    67
    MOJOSHADER_RS_WRAP9,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    68
    MOJOSHADER_RS_WRAP10,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    69
    MOJOSHADER_RS_WRAP11,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    70
    MOJOSHADER_RS_WRAP12,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    71
    MOJOSHADER_RS_WRAP13,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    72
    MOJOSHADER_RS_WRAP14,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    73
    MOJOSHADER_RS_WRAP15,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    74
    MOJOSHADER_RS_CLIPPING,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    75
    MOJOSHADER_RS_LIGHTING,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    76
    MOJOSHADER_RS_AMBIENT,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    77
    MOJOSHADER_RS_FOGVERTEXMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    78
    MOJOSHADER_RS_COLORVERTEX,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    79
    MOJOSHADER_RS_LOCALVIEWER,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    80
    MOJOSHADER_RS_NORMALIZENORMALS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    81
    MOJOSHADER_RS_DIFFUSEMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    82
    MOJOSHADER_RS_SPECULARMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    83
    MOJOSHADER_RS_AMBIENTMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    84
    MOJOSHADER_RS_EMISSIVEMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    85
    MOJOSHADER_RS_VERTEXBLEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    86
    MOJOSHADER_RS_CLIPPLANEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    87
    MOJOSHADER_RS_POINTSIZE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    88
    MOJOSHADER_RS_POINTSIZE_MIN,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    89
    MOJOSHADER_RS_POINTSPRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    90
    MOJOSHADER_RS_POINTSCALEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    91
    MOJOSHADER_RS_POINTSCALE_A,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    92
    MOJOSHADER_RS_POINTSCALE_B,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    93
    MOJOSHADER_RS_POINTSCALE_C,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    94
    MOJOSHADER_RS_MULTISAMPLEANTIALIAS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    95
    MOJOSHADER_RS_MULTISAMPLEMASK,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    96
    MOJOSHADER_RS_PATCHEDGESTYLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    97
    MOJOSHADER_RS_DEBUGMONITORTOKEN,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    98
    MOJOSHADER_RS_POINTSIZE_MAX,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    99
    MOJOSHADER_RS_INDEXEDVERTEXBLENDENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   100
    MOJOSHADER_RS_COLORWRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   101
    MOJOSHADER_RS_TWEENFACTOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   102
    MOJOSHADER_RS_BLENDOP,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   103
    MOJOSHADER_RS_POSITIONDEGREE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   104
    MOJOSHADER_RS_NORMALDEGREE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   105
    MOJOSHADER_RS_SCISSORTESTENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   106
    MOJOSHADER_RS_SLOPESCALEDEPTHBIAS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   107
    MOJOSHADER_RS_ANTIALIASEDLINEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   108
    MOJOSHADER_RS_MINTESSELLATIONLEVEL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   109
    MOJOSHADER_RS_MAXTESSELLATIONLEVEL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   110
    MOJOSHADER_RS_ADAPTIVETESS_X,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   111
    MOJOSHADER_RS_ADAPTIVETESS_Y,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   112
    MOJOSHADER_RS_ADAPTIVETESS_Z,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   113
    MOJOSHADER_RS_ADAPTIVETESS_W,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   114
    MOJOSHADER_RS_ENABLEADAPTIVETESSELLATION,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   115
    MOJOSHADER_RS_TWOSIDEDSTENCILMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   116
    MOJOSHADER_RS_CCW_STENCILFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   117
    MOJOSHADER_RS_CCW_STENCILZFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   118
    MOJOSHADER_RS_CCW_STENCILPASS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   119
    MOJOSHADER_RS_CCW_STENCILFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   120
    MOJOSHADER_RS_COLORWRITEENABLE1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   121
    MOJOSHADER_RS_COLORWRITEENABLE2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   122
    MOJOSHADER_RS_COLORWRITEENABLE3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   123
    MOJOSHADER_RS_BLENDFACTOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   124
    MOJOSHADER_RS_SRGBWRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   125
    MOJOSHADER_RS_DEPTHBIAS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   126
    MOJOSHADER_RS_SEPARATEALPHABLENDENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   127
    MOJOSHADER_RS_SRCBLENDALPHA,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   128
    MOJOSHADER_RS_DESTBLENDALPHA,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   129
    MOJOSHADER_RS_BLENDOPALPHA,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   130
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   131
    /* These aren't really "states", but these numbers are
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   132
     * referred to by MOJOSHADER_effectStateType as such.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   133
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   134
    MOJOSHADER_RS_VERTEXSHADER = 146,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   135
    MOJOSHADER_RS_PIXELSHADER = 147
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   136
} MOJOSHADER_renderStateType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   137
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   138
typedef enum MOJOSHADER_zBufferType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   139
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   140
    MOJOSHADER_ZB_FALSE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   141
    MOJOSHADER_ZB_TRUE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   142
    MOJOSHADER_ZB_USEW
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   143
} MOJOSHADER_zBufferType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   144
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   145
typedef enum MOJOSHADER_fillMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   146
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   147
    MOJOSHADER_FILL_POINT     = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   148
    MOJOSHADER_FILL_WIREFRAME = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   149
    MOJOSHADER_FILL_SOLID     = 3
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   150
} MOJOSHADER_fillMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   151
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   152
typedef enum MOJOSHADER_shadeMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   153
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   154
    MOJOSHADER_SHADE_FLAT    = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   155
    MOJOSHADER_SHADE_GOURAUD = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   156
    MOJOSHADER_SHADE_PHONG   = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   157
} MOJOSHADER_shadeMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   158
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   159
typedef enum MOJOSHADER_blendMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   160
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   161
    MOJOSHADER_BLEND_ZERO            = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   162
    MOJOSHADER_BLEND_ONE             = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   163
    MOJOSHADER_BLEND_SRCCOLOR        = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   164
    MOJOSHADER_BLEND_INVSRCCOLOR     = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   165
    MOJOSHADER_BLEND_SRCALPHA        = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   166
    MOJOSHADER_BLEND_INVSRCALPHA     = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   167
    MOJOSHADER_BLEND_DESTALPHA       = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   168
    MOJOSHADER_BLEND_INVDESTALPHA    = 8,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   169
    MOJOSHADER_BLEND_DESTCOLOR       = 9,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   170
    MOJOSHADER_BLEND_INVDESTCOLOR    = 10,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   171
    MOJOSHADER_BLEND_SRCALPHASAT     = 11,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   172
    MOJOSHADER_BLEND_BOTHSRCALPHA    = 12,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   173
    MOJOSHADER_BLEND_BOTHINVSRCALPHA = 13,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   174
    MOJOSHADER_BLEND_BLENDFACTOR     = 14,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   175
    MOJOSHADER_BLEND_INVBLENDFACTOR  = 15,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   176
    MOJOSHADER_BLEND_SRCCOLOR2       = 16,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   177
    MOJOSHADER_BLEND_INVSRCCOLOR2    = 17
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   178
} MOJOSHADER_blendMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   179
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   180
typedef enum MOJOSHADER_cullMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   181
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   182
    MOJOSHADER_CULL_NONE = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   183
    MOJOSHADER_CULL_CW   = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   184
    MOJOSHADER_CULL_CCW  = 3
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   185
} MOJOSHADER_cullMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   186
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   187
typedef enum MOJOSHADER_compareFunc
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   188
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   189
    MOJOSHADER_CMP_NEVER        = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   190
    MOJOSHADER_CMP_LESS         = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   191
    MOJOSHADER_CMP_EQUAL        = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   192
    MOJOSHADER_CMP_LESSEQUAL    = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   193
    MOJOSHADER_CMP_GREATER      = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   194
    MOJOSHADER_CMP_NOTEQUAL     = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   195
    MOJOSHADER_CMP_GREATEREQUAL = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   196
    MOJOSHADER_CMP_ALWAYS       = 8
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   197
} MOJOSHADER_compareFunc;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   198
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   199
typedef enum MOJOSHADER_fogMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   200
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   201
    MOJOSHADER_FOG_NONE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   202
    MOJOSHADER_FOG_EXP,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   203
    MOJOSHADER_FOG_EXP2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   204
    MOJOSHADER_FOG_LINEAR
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   205
} MOJOSHADER_fogMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   206
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   207
typedef enum MOJOSHADER_stencilOp
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   208
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   209
    MOJOSHADER_STENCILOP_KEEP    = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   210
    MOJOSHADER_STENCILOP_ZERO    = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   211
    MOJOSHADER_STENCILOP_REPLACE = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   212
    MOJOSHADER_STENCILOP_INCRSAT = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   213
    MOJOSHADER_STENCILOP_DECRSAT = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   214
    MOJOSHADER_STENCILOP_INVERT  = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   215
    MOJOSHADER_STENCILOP_INCR    = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   216
    MOJOSHADER_STENCILOP_DECR    = 8
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   217
} MOJOSHADER_stencilOp;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   218
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   219
typedef enum MOJOSHADER_materialColorSource
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   220
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   221
    MOJOSHADER_MCS_MATERIAL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   222
    MOJOSHADER_MCS_COLOR1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   223
    MOJOSHADER_MCS_COLOR2
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   224
} MOJOSHADER_materialColorSource;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   225
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   226
typedef enum MOJOSHADER_vertexBlendFlags
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   227
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   228
    MOJOSHADER_VBF_DISABLE  = 0,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   229
    MOJOSHADER_VBF_1WEIGHTS = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   230
    MOJOSHADER_VBF_2WEIGHTS = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   231
    MOJOSHADER_VBF_3WEIGHTS = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   232
    MOJOSHADER_VBF_TWEENING = 255,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   233
    MOJOSHADER_VBF_0WEIGHTS = 256,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   234
} MOJOSHADER_vertexBlendFlags;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   235
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   236
typedef enum MOJOSHADER_patchedEdgeStyle
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   237
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   238
    MOJOSHADER_PATCHEDGE_DISCRETE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   239
    MOJOSHADER_PATCHEDGE_CONTINUOUS
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   240
} MOJOSHADER_patchedEdgeStyle;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   241
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   242
typedef enum MOJOSHADER_debugMonitorTokens
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   243
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   244
    MOJOSHADER_DMT_ENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   245
    MOJOSHADER_DMT_DISABLE
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   246
} MOJOSHADER_debugMonitorTokens;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   247
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   248
typedef enum MOJOSHADER_blendOp
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   249
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   250
    MOJOSHADER_BLENDOP_ADD         = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   251
    MOJOSHADER_BLENDOP_SUBTRACT    = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   252
    MOJOSHADER_BLENDOP_REVSUBTRACT = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   253
    MOJOSHADER_BLENDOP_MIN         = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   254
    MOJOSHADER_BLENDOP_MAX         = 5
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   255
} MOJOSHADER_blendOp;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   256
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   257
typedef enum MOJOSHADER_degreeType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   258
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   259
    MOJOSHADER_DEGREE_LINEAR    = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   260
    MOJOSHADER_DEGREE_QUADRATIC = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   261
    MOJOSHADER_DEGREE_CUBIC     = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   262
    MOJOSHADER_DEGREE_QUINTIC   = 5
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   263
} MOJOSHADER_degreeType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   264
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   265
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   266
/* MOJOSHADER_effectSamplerState types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   267
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   268
typedef enum MOJOSHADER_samplerStateType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   269
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   270
    MOJOSHADER_SAMP_UNKNOWN0      = 0,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   271
    MOJOSHADER_SAMP_UNKNOWN1      = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   272
    MOJOSHADER_SAMP_UNKNOWN2      = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   273
    MOJOSHADER_SAMP_UNKNOWN3      = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   274
    MOJOSHADER_SAMP_TEXTURE       = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   275
    MOJOSHADER_SAMP_ADDRESSU      = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   276
    MOJOSHADER_SAMP_ADDRESSV      = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   277
    MOJOSHADER_SAMP_ADDRESSW      = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   278
    MOJOSHADER_SAMP_BORDERCOLOR   = 8,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   279
    MOJOSHADER_SAMP_MAGFILTER     = 9,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   280
    MOJOSHADER_SAMP_MINFILTER     = 10,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   281
    MOJOSHADER_SAMP_MIPFILTER     = 11,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   282
    MOJOSHADER_SAMP_MIPMAPLODBIAS = 12,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   283
    MOJOSHADER_SAMP_MAXMIPLEVEL   = 13,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   284
    MOJOSHADER_SAMP_MAXANISOTROPY = 14,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   285
    MOJOSHADER_SAMP_SRGBTEXTURE   = 15,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   286
    MOJOSHADER_SAMP_ELEMENTINDEX  = 16,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   287
    MOJOSHADER_SAMP_DMAPOFFSET    = 17
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   288
} MOJOSHADER_samplerStateType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   289
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   290
typedef enum MOJOSHADER_textureAddress
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   291
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   292
    MOJOSHADER_TADDRESS_WRAP       = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   293
    MOJOSHADER_TADDRESS_MIRROR     = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   294
    MOJOSHADER_TADDRESS_CLAMP      = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   295
    MOJOSHADER_TADDRESS_BORDER     = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   296
    MOJOSHADER_TADDRESS_MIRRORONCE = 5
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   297
} MOJOSHADER_textureAddress;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   298
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   299
typedef enum MOJOSHADER_textureFilterType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   300
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   301
    MOJOSHADER_TEXTUREFILTER_NONE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   302
    MOJOSHADER_TEXTUREFILTER_POINT,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   303
    MOJOSHADER_TEXTUREFILTER_LINEAR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   304
    MOJOSHADER_TEXTUREFILTER_ANISOTROPIC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   305
    MOJOSHADER_TEXTUREFILTER_PYRAMIDALQUAD,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   306
    MOJOSHADER_TEXTUREFILTER_GAUSSIANQUAD,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   307
    MOJOSHADER_TEXTUREFILTER_CONVOLUTIONMONO
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   308
} MOJOSHADER_textureFilterType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   309
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   310
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   311
/* Effect value types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   312
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   313
typedef struct MOJOSHADER_effectSamplerState MOJOSHADER_effectSamplerState;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   314
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   315
typedef struct MOJOSHADER_effectValue
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   316
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   317
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   318
    const char *semantic;
1152
8f7653f0dc37 Effect struct parameter support
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1150
diff changeset
   319
    MOJOSHADER_symbolTypeInfo type;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   320
    unsigned int value_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   321
    union
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   322
    {
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   323
         /* Raw value types */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   324
        void                           *values;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   325
        int                            *valuesI;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   326
        float                          *valuesF;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   327
        /* As used by MOJOSHADER_effectState */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   328
        MOJOSHADER_zBufferType         *valuesZBT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   329
        MOJOSHADER_fillMode            *valuesFiM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   330
        MOJOSHADER_shadeMode           *valuesSM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   331
        MOJOSHADER_blendMode           *valuesBM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   332
        MOJOSHADER_cullMode            *valuesCM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   333
        MOJOSHADER_compareFunc         *valuesCF;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   334
        MOJOSHADER_fogMode             *valuesFoM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   335
        MOJOSHADER_stencilOp           *valuesSO;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   336
        MOJOSHADER_materialColorSource *valuesMCS;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   337
        MOJOSHADER_vertexBlendFlags    *valuesVBF;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   338
        MOJOSHADER_patchedEdgeStyle    *valuesPES;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   339
        MOJOSHADER_debugMonitorTokens  *valuesDMT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   340
        MOJOSHADER_blendOp             *valuesBO;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   341
        MOJOSHADER_degreeType          *valuesDT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   342
        /* As used by MOJOSHADER_effectSamplerState */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   343
        MOJOSHADER_textureAddress      *valuesTA;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   344
        MOJOSHADER_textureFilterType   *valuesTFT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   345
        /* As used by MOJOSHADER_effectParameter */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   346
        MOJOSHADER_effectSamplerState  *valuesSS;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   347
    };
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   348
} MOJOSHADER_effectValue;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   349
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   350
typedef struct MOJOSHADER_effectState
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   351
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   352
    MOJOSHADER_renderStateType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   353
    MOJOSHADER_effectValue value;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   354
} MOJOSHADER_effectState;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   355
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   356
struct MOJOSHADER_effectSamplerState
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   357
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   358
    MOJOSHADER_samplerStateType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   359
    MOJOSHADER_effectValue value;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   360
};
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   361
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   362
typedef MOJOSHADER_effectValue MOJOSHADER_effectAnnotation;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   363
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   364
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   365
/* Effect interface structures... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   366
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   367
typedef struct MOJOSHADER_effectParam
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   368
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   369
    MOJOSHADER_effectValue value;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   370
    unsigned int annotation_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   371
    MOJOSHADER_effectAnnotation *annotations;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   372
} MOJOSHADER_effectParam;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   373
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   374
typedef struct MOJOSHADER_effectPass
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   375
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   376
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   377
    unsigned int state_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   378
    MOJOSHADER_effectState *states;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   379
    unsigned int annotation_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   380
    MOJOSHADER_effectAnnotation* annotations;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   381
} MOJOSHADER_effectPass;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   382
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   383
typedef struct MOJOSHADER_effectTechnique
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   384
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   385
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   386
    unsigned int pass_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   387
    MOJOSHADER_effectPass *passes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   388
    unsigned int annotation_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   389
    MOJOSHADER_effectAnnotation* annotations;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   390
} MOJOSHADER_effectTechnique;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   391
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   392
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   393
/* Effect "objects"... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   394
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   395
/* Defined later in the state change types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   396
typedef struct MOJOSHADER_samplerStateRegister MOJOSHADER_samplerStateRegister;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   397
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   398
typedef struct MOJOSHADER_effectShader
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   399
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   400
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   401
    unsigned int technique;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   402
    unsigned int pass;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   403
    unsigned int is_preshader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   404
    unsigned int preshader_param_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   405
    unsigned int *preshader_params;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   406
    unsigned int param_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   407
    unsigned int *params;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   408
    unsigned int sampler_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   409
    MOJOSHADER_samplerStateRegister *samplers;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   410
    union
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   411
    {
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   412
        const MOJOSHADER_parseData *shader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   413
        const MOJOSHADER_preshader *preshader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   414
    };
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   415
} MOJOSHADER_effectShader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   416
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   417
typedef struct MOJOSHADER_effectSamplerMap
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   418
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   419
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   420
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   421
} MOJOSHADER_effectSamplerMap;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   422
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   423
typedef struct MOJOSHADER_effectString
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   424
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   425
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   426
    const char *string;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   427
} MOJOSHADER_effectString;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   428
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   429
typedef struct MOJOSHADER_effectTexture
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   430
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   431
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   432
    /* FIXME: Does this even do anything? */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   433
} MOJOSHADER_effectTexture;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   434
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   435
typedef union MOJOSHADER_effectObject
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   436
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   437
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   438
    union
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   439
    {
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   440
        MOJOSHADER_effectShader shader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   441
        MOJOSHADER_effectSamplerMap mapping;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   442
        MOJOSHADER_effectString string;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   443
        MOJOSHADER_effectTexture texture;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   444
    };
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   445
} MOJOSHADER_effectObject;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   446
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   447
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   448
/* Effect state change types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   449
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   450
/* Used to store sampler states with accompanying sampler registers */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   451
struct MOJOSHADER_samplerStateRegister
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   452
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   453
    const char *sampler_name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   454
    unsigned int sampler_register;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   455
    unsigned int sampler_state_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   456
    const MOJOSHADER_effectSamplerState *sampler_states;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   457
};
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   458
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   459
/*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   460
 * Used to acquire the desired render state by the effect pass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   461
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   462
typedef struct MOJOSHADER_effectStateChanges
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   463
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   464
    /* Render state changes caused by effect technique */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   465
    unsigned int render_state_change_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   466
    const MOJOSHADER_effectState *render_state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   467
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   468
    /* Sampler state changes caused by effect technique */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   469
    unsigned int sampler_state_change_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   470
    const MOJOSHADER_samplerStateRegister *sampler_state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   471
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   472
    /* Vertex sampler state changes caused by effect technique */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   473
    unsigned int vertex_sampler_state_change_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   474
    const MOJOSHADER_samplerStateRegister *vertex_sampler_state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   475
} MOJOSHADER_effectStateChanges;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   476
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   477
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   478
/*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   479
 * Structure used to return data from parsing of an effect file...
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   480
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   481
/* !!! FIXME: most of these ints should be unsigned. */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   482
typedef struct MOJOSHADER_effect
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   483
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   484
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   485
     * The number of elements pointed to by (errors).
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   486
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   487
    int error_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   488
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   489
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   490
     * (error_count) elements of data that specify errors that were generated
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   491
     *  by parsing this shader.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   492
     * This can be NULL if there were no errors or if (error_count) is zero.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   493
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   494
    MOJOSHADER_error *errors;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   495
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   496
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   497
     * The name of the profile used to parse the shader. Will be NULL on error.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   498
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   499
    const char *profile;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   500
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   501
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   502
     * The number of params pointed to by (params).
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   503
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   504
    int param_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   505
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   506
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   507
     * (param_count) elements of data that specify parameter bind points for
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   508
     *  this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   509
     * This can be NULL on error or if (param_count) is zero.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   510
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   511
    MOJOSHADER_effectParam *params;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   512
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   513
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   514
     * The number of elements pointed to by (techniques).
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   515
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   516
    int technique_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   517
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   518
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   519
     * (technique_count) elements of data that specify techniques used in
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   520
     *  this effect. Each technique contains a series of passes, and each pass
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   521
     *  specifies state and shaders that affect rendering.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   522
     * This can be NULL on error or if (technique_count) is zero.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   523
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   524
    MOJOSHADER_effectTechnique *techniques;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   525
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   526
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   527
     * The technique currently being rendered by this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   528
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   529
    const MOJOSHADER_effectTechnique *current_technique;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   530
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   531
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   532
     * The index of the current pass being rendered by this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   533
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   534
    int current_pass;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   535
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   536
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   537
     * The number of elements pointed to by (objects).
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   538
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   539
    int object_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   540
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   541
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   542
     * (object_count) elements of data that specify objects used in
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   543
     *  this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   544
     * This can be NULL on error or if (object_count) is zero.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   545
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   546
    MOJOSHADER_effectObject *objects;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   547
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   548
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   549
     * Value used to determine whether or not to restore the previous shader
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   550
     * state after rendering an effect, as requested by application.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   551
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   552
    int restore_shader_state;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   553
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   554
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   555
     * The structure provided by the appliation to store the state changes.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   556
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   557
    MOJOSHADER_effectStateChanges *state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   558
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   559
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   560
     * This is the malloc implementation you passed to MOJOSHADER_parseEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   561
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   562
    MOJOSHADER_malloc malloc;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   563
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   564
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   565
     * This is the free implementation you passed to MOJOSHADER_parseEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   566
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   567
    MOJOSHADER_free free;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   568
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   569
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   570
     * This is the pointer you passed as opaque data for your allocator.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   571
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   572
    void *malloc_data;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   573
} MOJOSHADER_effect;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   574
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   575
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   576
/* Effect parsing interface... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   577
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   578
/* !!! FIXME: document me. */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   579
DECLSPEC MOJOSHADER_effect *MOJOSHADER_parseEffect(const char *profile,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   580
                                                   const unsigned char *buf,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   581
                                                   const unsigned int _len,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   582
                                                   const MOJOSHADER_swizzle *swiz,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   583
                                                   const unsigned int swizcount,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   584
                                                   const MOJOSHADER_samplerMap *smap,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   585
                                                   const unsigned int smapcount,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   586
                                                   MOJOSHADER_malloc m,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   587
                                                   MOJOSHADER_free f,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   588
                                                   void *d);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   589
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   590
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   591
/* !!! FIXME: document me. */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   592
DECLSPEC void MOJOSHADER_freeEffect(const MOJOSHADER_effect *effect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   593
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   594
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   595
/* !!! FIXME: document me. */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   596
DECLSPEC MOJOSHADER_effect *MOJOSHADER_cloneEffect(const MOJOSHADER_effect *effect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   597
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   598
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   599
/* Effect parameter interface... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   600
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   601
/* Set the constant value for the specified effect parameter.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   602
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   603
 * This function maps to ID3DXEffect::SetRawValue.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   604
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   605
 * (parameter) is a parameter obtained from a MOJOSHADER_effect*.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   606
 * (data) is the constant values to be applied to the parameter.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   607
 * (offset) is the offset, in bytes, of the parameter data being modified.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   608
 * (len) is the size, in bytes, of the data buffer being applied.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   609
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   610
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   611
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   612
DECLSPEC void MOJOSHADER_effectSetRawValueHandle(const MOJOSHADER_effectParam *parameter,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   613
                                                 const void *data,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   614
                                                 const unsigned int offset,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   615
                                                 const unsigned int len);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   616
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   617
/* Set the constant value for the effect parameter, specified by name.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   618
 *  Note: this function is slower than MOJOSHADER_effectSetRawValueHandle(),
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   619
 *  but we still provide it to fully map to ID3DXEffect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   620
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   621
 * This function maps to ID3DXEffect::SetRawValue.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   622
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   623
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_parseEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   624
 * (name) is the human-readable name of the parameter being modified.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   625
 * (data) is the constant values to be applied to the parameter.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   626
 * (offset) is the offset, in bytes, of the parameter data being modified.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   627
 * (len) is the size, in bytes, of the data buffer being applied.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   628
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   629
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   630
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   631
DECLSPEC void MOJOSHADER_effectSetRawValueName(const MOJOSHADER_effect *effect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   632
                                               const char *name,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   633
                                               const void *data,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   634
                                               const unsigned int offset,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   635
                                               const unsigned int len);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   636
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   637
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   638
/* Effect technique interface... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   639
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   640
/* Get the current technique in use by an effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   641
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   642
 * This function maps to ID3DXEffect::GetCurrentTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   643
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   644
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_parseEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   645
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   646
 * This function returns the technique currently used by the given effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   647
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   648
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   649
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   650
DECLSPEC const MOJOSHADER_effectTechnique *MOJOSHADER_effectGetCurrentTechnique(const MOJOSHADER_effect *effect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   651
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   652
/* Set the current technique to be used an effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   653
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   654
 * This function maps to ID3DXEffect::SetTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   655
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   656
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_parseEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   657
 * (technique) is the technique to be used by the effect when rendered.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   658
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   659
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   660
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   661
DECLSPEC void MOJOSHADER_effectSetTechnique(MOJOSHADER_effect *effect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   662
                                            const MOJOSHADER_effectTechnique *technique);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   663
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   664
/* Get the next technique in an effect's list.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   665
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   666
 * This function maps to ID3DXEffect::FindNextValidTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   667
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   668
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_parseEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   669
 * (technique) can either be a technique found in the given effect, or NULL to
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   670
 *  find the first technique in the given effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   671
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   672
 * This function returns either the next technique after the passed technique,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   673
 *  or the first technique if the passed technique is NULL.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   674
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   675
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   676
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   677
DECLSPEC const MOJOSHADER_effectTechnique *MOJOSHADER_effectFindNextValidTechnique(const MOJOSHADER_effect *effect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   678
                                                                                   const MOJOSHADER_effectTechnique *technique);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   679
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   680
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   681
/* OpenGL effect interface... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   682
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   683
typedef struct MOJOSHADER_glEffect MOJOSHADER_glEffect;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   684
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   685
/* Fully compile/link the shaders found within the effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   686
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   687
 * The MOJOSHADER_glEffect* is solely for use within the OpenGL-specific calls.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   688
 *  In all other cases you will be using the MOJOSHADER_effect* instead.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   689
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   690
 * In a typical use case, you will be calling this immediately after obtaining
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   691
 *  the MOJOSHADER_effect*.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   692
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   693
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_parseEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   694
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   695
 * This function returns a MOJOSHADER_glEffect*, containing OpenGL-specific
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   696
 *  data for an accompanying MOJOSHADER_effect*.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   697
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   698
 * This call is NOT thread safe! As most OpenGL implementations are not thread
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   699
 * safe, you should probably only call this from the same thread that created
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   700
 * the GL context.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   701
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   702
DECLSPEC MOJOSHADER_glEffect *MOJOSHADER_glCompileEffect(MOJOSHADER_effect *effect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   703
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   704
/* Delete the shaders that were allocated for an effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   705
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   706
 * (glEffect) is a MOJOSHADER_glEffect* obtained from
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   707
 *  MOJOSHADER_glCompileEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   708
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   709
 * This call is NOT thread safe! As most OpenGL implementations are not thread
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   710
 * safe, you should probably only call this from the same thread that created
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   711
 * the GL context.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   712
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   713
DECLSPEC void MOJOSHADER_glDeleteEffect(MOJOSHADER_glEffect *glEffect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   714
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   715
/* Prepare the effect for rendering with the currently applied technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   716
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   717
 * This function maps to ID3DXEffect::Begin.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   718
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   719
 * In addition to the expected Begin parameters, we also include a parameter
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   720
 *  to pass in a MOJOSHADER_effectRenderState. Rather than change the render
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   721
 *  state within MojoShader itself we will simply provide what the effect wants
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   722
 *  and allow you to use this information with your own renderer.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   723
 *  MOJOSHADER_glEffectBeginPass will update with the render state desired by
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   724
 *  the current effect pass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   725
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   726
 * Note that we only provide the ability to preserve the shader state, but NOT
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   727
 * the ability to preserve the render/sampler states. You are expected to
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   728
 * track your own GL state and restore these states as needed for your
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   729
 * application.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   730
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   731
 * (glEffect) is a MOJOSHADER_glEffect* obtained from
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   732
 *  MOJOSHADER_glCompileEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   733
 * (numPasses) will be filled with the number of passes that this technique
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   734
 *  will need to fully render.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   735
 * (saveShaderState) is a boolean value informing the effect whether or not to
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   736
 *  restore the shader bindings after calling MOJOSHADER_glEffectEnd.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   737
 * (renderState) will be filled by the effect to inform you of the render state
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   738
 *  changes introduced by the technique and its passes.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   739
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   740
 * This call is NOT thread safe! As most OpenGL implementations are not thread
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   741
 * safe, you should probably only call this from the same thread that created
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   742
 * the GL context.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   743
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   744
DECLSPEC void MOJOSHADER_glEffectBegin(MOJOSHADER_glEffect *glEffect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   745
                                       unsigned int *numPasses,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   746
                                       int saveShaderState,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   747
                                       MOJOSHADER_effectStateChanges *stateChanges);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   748
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   749
/* Begin an effect pass from the currently applied technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   750
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   751
 * This function maps to ID3DXEffect::BeginPass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   752
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   753
 * (glEffect) is a MOJOSHADER_glEffect* obtained from
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   754
 *  MOJOSHADER_glCompileEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   755
 * (pass) is the index of the effect pass as found in the current technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   756
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   757
 * This call is NOT thread safe! As most OpenGL implementations are not thread
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   758
 * safe, you should probably only call this from the same thread that created
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   759
 * the GL context.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   760
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   761
DECLSPEC void MOJOSHADER_glEffectBeginPass(MOJOSHADER_glEffect *glEffect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   762
                                           unsigned int pass);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   763
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   764
/* Push render state changes that occurred within an actively rendering pass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   765
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   766
 * This function maps to ID3DXEffect::CommitChanges.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   767
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   768
 * (glEffect) is a MOJOSHADER_glEffect* obtained from
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   769
 *  MOJOSHADER_glCompileEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   770
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   771
 * This call is NOT thread safe! As most OpenGL implementations are not thread
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   772
 * safe, you should probably only call this from the same thread that created
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   773
 * the GL context.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   774
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   775
DECLSPEC void MOJOSHADER_glEffectCommitChanges(MOJOSHADER_glEffect *glEffect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   776
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   777
/* End an effect pass from the currently applied technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   778
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   779
 * This function maps to ID3DXEffect::EndPass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   780
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   781
 * (glEffect) is a MOJOSHADER_glEffect* obtained from
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   782
 *  MOJOSHADER_glCompileEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   783
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   784
 * This call is NOT thread safe! As most OpenGL implementations are not thread
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   785
 * safe, you should probably only call this from the same thread that created
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   786
 * the GL context.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   787
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   788
DECLSPEC void MOJOSHADER_glEffectEndPass(MOJOSHADER_glEffect *glEffect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   789
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   790
/* Complete rendering the effect technique, and restore the render state.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   791
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   792
 * This function maps to ID3DXEffect::End.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   793
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   794
 * (glEffect) is a MOJOSHADER_glEffect* obtained from
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   795
 *  MOJOSHADER_glCompileEffect().
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   796
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   797
 * This call is NOT thread safe! As most OpenGL implementations are not thread
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   798
 * safe, you should probably only call this from the same thread that created
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   799
 * the GL context.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   800
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   801
DECLSPEC void MOJOSHADER_glEffectEnd(MOJOSHADER_glEffect *glEffect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   802
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   803
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   804
/* Metal effect interface... */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   805
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   806
typedef struct MOJOSHADER_mtlEffect MOJOSHADER_mtlEffect;
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   807
typedef struct MOJOSHADER_mtlShader MOJOSHADER_mtlShader;
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   808
typedef struct MOJOSHADER_mtlShaderState MOJOSHADER_mtlShaderState;
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   809
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   810
/* Fully compile/link the shaders found within the effect.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   811
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   812
 * The MOJOSHADER_mtlEffect* is solely for use within the Metal-specific calls.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   813
 *  In all other cases you will be using the MOJOSHADER_effect* instead.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   814
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   815
 * In a typical use case, you will be calling this immediately after obtaining
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   816
 *  the MOJOSHADER_effect*.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   817
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   818
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_parseEffect().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   819
 * (mtlDevice) is a MTLDevice* obtained from a Metal device creation call,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   820
 *  such as MTLCreateSystemDefaultDevice().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   821
 * (numBackingBuffers) is the number of backing uniform buffers that you
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   822
 *  want to create for each shader. If you are using double-buffering,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   823
 *  this should be 2; for triple buffering, this should be 3, etc.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   824
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   825
 * This function returns a MOJOSHADER_mtlEffect*, containing Metal-specific
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   826
 *  data for an accompanying MOJOSHADER_effect*.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   827
 */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   828
DECLSPEC MOJOSHADER_mtlEffect *MOJOSHADER_mtlCompileEffect(MOJOSHADER_effect *effect,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   829
                                                           void *mtlDevice,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   830
                                                           int numBackingBuffers);
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   831
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   832
/* Delete the shaders that were allocated for an effect.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   833
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   834
 * (mtlEffect) is a MOJOSHADER_mtlEffect* obtained from
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   835
 *  MOJOSHADER_mtlCompileEffect().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   836
 */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   837
DECLSPEC void MOJOSHADER_mtlDeleteEffect(MOJOSHADER_mtlEffect *mtlEffect);
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   838
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   839
/* Prepare the effect for rendering with the currently applied technique.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   840
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   841
 * This function maps to ID3DXEffect::Begin.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   842
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   843
 * In addition to the expected Begin parameters, we also include a parameter
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   844
 *  to pass in a MOJOSHADER_effectRenderState. Rather than change the render
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   845
 *  state within MojoShader itself we will simply provide what the effect wants
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   846
 *  and allow you to use this information with your own renderer.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   847
 *  MOJOSHADER_glEffectBeginPass will update with the render state desired by
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   848
 *  the current effect pass.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   849
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   850
 * Note that we only provide the ability to preserve the shader state, but NOT
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   851
 * the ability to preserve the render/sampler states. You are expected to
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   852
 * track your own Metal state and restore these states as needed for your
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   853
 * application.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   854
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   855
 * (mtlEffect) is a MOJOSHADER_mtlEffect* obtained from
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   856
 *  MOJOSHADER_mtlCompileEffect().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   857
 * (numPasses) will be filled with the number of passes that this technique
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   858
 *  will need to fully render.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   859
 * (saveShaderState) is a boolean value informing the effect whether or not to
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   860
 *  restore the shader bindings after calling MOJOSHADER_mtlEffectEnd.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   861
 * (renderState) will be filled by the effect to inform you of the render state
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   862
 *  changes introduced by the technique and its passes.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   863
 */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   864
DECLSPEC void MOJOSHADER_mtlEffectBegin(MOJOSHADER_mtlEffect *mtlEffect,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   865
                                        unsigned int *numPasses,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   866
                                        int saveShaderState,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   867
                                        MOJOSHADER_effectStateChanges *stateChanges);
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   868
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   869
/* Begin an effect pass from the currently applied technique.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   870
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   871
 * This function maps to ID3DXEffect::BeginPass.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   872
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   873
 * (mtlEffect) is a MOJOSHADER_mtlEffect* obtained from
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   874
 *  MOJOSHADER_mtlCompileEffect().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   875
 * (pass) is the index of the effect pass as found in the current technique.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   876
 * (state) is a pointer to the current shader state object.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   877
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   878
 * The MOJOSHADER_mtlShaderState pointed to by (shState) must be created
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   879
 * before calling this function!
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   880
 */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   881
DECLSPEC void MOJOSHADER_mtlEffectBeginPass(MOJOSHADER_mtlEffect *mtlEffect,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   882
                                            unsigned int pass,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   883
                                            MOJOSHADER_mtlShaderState *shState);
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   884
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   885
/* Push render state changes that occurred within an actively rendering pass.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   886
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   887
 * This function maps to ID3DXEffect::CommitChanges.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   888
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   889
 * (mtlEffect) is a MOJOSHADER_mtlEffect* obtained from
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   890
 *  MOJOSHADER_mtlCompileEffect().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   891
 * (state) is a pointer to the current shader state object.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   892
 */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   893
DECLSPEC void MOJOSHADER_mtlEffectCommitChanges(MOJOSHADER_mtlEffect *mtlEffect,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   894
                                                MOJOSHADER_mtlShaderState *shState);
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   895
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   896
/* End an effect pass from the currently applied technique.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   897
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   898
 * This function maps to ID3DXEffect::EndPass.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   899
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   900
 * (mtlEffect) is a MOJOSHADER_mtlEffect* obtained from
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   901
 *  MOJOSHADER_mtlCompileEffect().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   902
 */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   903
DECLSPEC void MOJOSHADER_mtlEffectEndPass(MOJOSHADER_mtlEffect *mtlEffect);
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   904
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   905
/* Complete rendering the effect technique, and restore the render state.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   906
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   907
 * This function maps to ID3DXEffect::End.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   908
 *
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   909
 * (mtlEffect) is a MOJOSHADER_mtlEffect* obtained from
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   910
 *  MOJOSHADER_glCompileEffect().
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   911
 * (state) is a pointer to the current shader state object.
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   912
 */
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   913
DECLSPEC void MOJOSHADER_mtlEffectEnd(MOJOSHADER_mtlEffect *mtlEffect,
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   914
                                      MOJOSHADER_mtlShaderState *shState);
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   915
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   916
#endif /* MOJOSHADER_EFFECT_SUPPORT */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   917
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   918
#endif /* MOJOSHADER_EFFECTS_H */