mojoshader.h
branchtrunk
changeset 36 5ea7c5f6cf2d
parent 35 5749d174b537
child 46 ff5a0ec44f00
equal deleted inserted replaced
35:5749d174b537 36:5ea7c5f6cf2d
       
     1 /**
       
     2  * MojoShader; generate shader programs from bytecode of compiled
       
     3  *  Direct3D shaders.
       
     4  *
       
     5  * Please see the file LICENSE.txt in the source's root directory.
       
     6  *
       
     7  *  This file written by Ryan C. Gordon.
       
     8  */
       
     9 
       
    10 #ifndef __INCL_MOJOSHADER_H_
       
    11 #define __INCL_MOJOSHADER_H_
       
    12 
       
    13 #ifdef __cplusplus
       
    14 extern "C" {
       
    15 #endif
       
    16 
       
    17 /*
       
    18  * const int compiled_against = MOJOSHADER_VERSION;
       
    19  * const int linked_against = MOJOSHADER_version();
       
    20  */
       
    21 #define MOJOSHADER_VERSION 1
       
    22 int MOJOSHADER_version(void);
       
    23 
       
    24 /*
       
    25  * These allocators work just like the C runtime's malloc() and free()
       
    26  *  (in fact, they use malloc() and free() internally if you don't
       
    27  *  specify your own allocator).
       
    28  */
       
    29 typedef void *(*MOJOSHADER_malloc)(int bytes);
       
    30 typedef void (*MOJOSHADER_free)(void *ptr);
       
    31 
       
    32 /* !!! FIXME: documentation. */
       
    33 /* !!! FIXME: this needs to change to return a buffer of GLSL code. */
       
    34 int MOJOSHADER_parse(const char *profile, const unsigned char *tokenbuf,
       
    35                    const unsigned int bufsize, MOJOSHADER_malloc m,
       
    36                    MOJOSHADER_free f);
       
    37 
       
    38 #ifdef __cplusplus
       
    39 }
       
    40 #endif
       
    41 
       
    42 #endif  /* include-once blocker. */
       
    43 
       
    44 /* end of mojoshader.h ... */
       
    45