mojoshader.h
author icculus
Sat, 22 Mar 2008 00:02:49 -0400
branchtrunk
changeset 36 5ea7c5f6cf2d
parent 35 d3d2glsl.h@5749d174b537
child 46 ff5a0ec44f00
permissions -rw-r--r--
[svn] Renamed files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     1
/**
35
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
     2
 * MojoShader; generate shader programs from bytecode of compiled
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
     3
 *  Direct3D shaders.
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     4
 *
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     5
 * Please see the file LICENSE.txt in the source's root directory.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     6
 *
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     7
 *  This file written by Ryan C. Gordon.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     8
 */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     9
35
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    10
#ifndef __INCL_MOJOSHADER_H_
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    11
#define __INCL_MOJOSHADER_H_
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    12
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    13
#ifdef __cplusplus
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    14
extern "C" {
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    15
#endif
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    16
20
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    17
/*
35
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    18
 * const int compiled_against = MOJOSHADER_VERSION;
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    19
 * const int linked_against = MOJOSHADER_version();
20
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    20
 */
35
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    21
#define MOJOSHADER_VERSION 1
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    22
int MOJOSHADER_version(void);
20
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    23
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    24
/*
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    25
 * These allocators work just like the C runtime's malloc() and free()
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    26
 *  (in fact, they use malloc() and free() internally if you don't
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    27
 *  specify your own allocator).
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    28
 */
35
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    29
typedef void *(*MOJOSHADER_malloc)(int bytes);
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    30
typedef void (*MOJOSHADER_free)(void *ptr);
18
0dbdb2be8bf8 [svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
icculus
parents: 14
diff changeset
    31
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    32
/* !!! FIXME: documentation. */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    33
/* !!! FIXME: this needs to change to return a buffer of GLSL code. */
35
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    34
int MOJOSHADER_parse(const char *profile, const unsigned char *tokenbuf,
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    35
                   const unsigned int bufsize, MOJOSHADER_malloc m,
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    36
                   MOJOSHADER_free f);
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    37
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    38
#ifdef __cplusplus
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    39
}
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    40
#endif
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    41
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    42
#endif  /* include-once blocker. */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    43
35
5749d174b537 [svn] Might as well keep the tradition alive.
icculus
parents: 20
diff changeset
    44
/* end of mojoshader.h ... */
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    45