d3d2glsl.h
author icculus
Sun, 16 Mar 2008 04:22:03 -0400
branchtrunk
changeset 20 bb2e8f285acc
parent 18 0dbdb2be8bf8
child 35 5749d174b537
permissions -rw-r--r--
[svn] Bunch More Work...higher level parses dest/src tokens before it goes to the emitters now, version info, some other things.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     1
/**
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     2
 * d3d2glsl; generate GLSL programs from bytecode of compiled Direct3D shaders.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     3
 *
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     4
 * Please see the file LICENSE.txt in the source's root directory.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     5
 *
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     6
 *  This file written by Ryan C. Gordon.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     7
 */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     8
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
     9
#ifndef __INCL_D3D2GLSL_H_
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    10
#define __INCL_D3D2GLSL_H_
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    11
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    12
#ifdef __cplusplus
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    13
extern "C" {
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    14
#endif
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    15
20
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    16
/*
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    17
 * const int compiled_against = D3D2GLSL_VERSION;
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    18
 * const int linked_against = D3D2GLSL_version();
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    19
 */
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    20
#define D3D2GLSL_VERSION 1
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    21
int D3D2GLSL_version(void);
bb2e8f285acc [svn] Bunch More Work...higher level parses dest/src tokens before it goes to the
icculus
parents: 18
diff changeset
    22
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
 * 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
    25
 *  (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
    26
 *  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
    27
 */
18
0dbdb2be8bf8 [svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
icculus
parents: 14
diff changeset
    28
typedef void *(*D3D2GLSL_malloc)(int bytes);
0dbdb2be8bf8 [svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
icculus
parents: 14
diff changeset
    29
typedef void (*D3D2GLSL_free)(void *ptr);
0dbdb2be8bf8 [svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
icculus
parents: 14
diff changeset
    30
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    31
/* !!! FIXME: documentation. */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    32
/* !!! FIXME: this needs to change to return a buffer of GLSL code. */
14
7075b6e31471 [svn] More proper split into profiles.
icculus
parents: 9
diff changeset
    33
int D3D2GLSL_parse(const char *profile, const unsigned char *tokenbuf,
18
0dbdb2be8bf8 [svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
icculus
parents: 14
diff changeset
    34
                   const unsigned int bufsize, D3D2GLSL_malloc m,
0dbdb2be8bf8 [svn] Bunch More Work. Cleanups, added app-supplied allocators, flexible output, etc.
icculus
parents: 14
diff changeset
    35
                   D3D2GLSL_free f);
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    36
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    37
#ifdef __cplusplus
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    38
}
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    39
#endif
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    40
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    41
#endif  /* include-once blocker. */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    42
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    43
/* end of d3d2glsl.h ... */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents:
diff changeset
    44