testparse.c
branchtrunk
changeset 37 63b5ba0bcda0
parent 18 0dbdb2be8bf8
child 46 ff5a0ec44f00
equal deleted inserted replaced
36:5ea7c5f6cf2d 37:63b5ba0bcda0
     1 #include <stdio.h>
     1 #include <stdio.h>
     2 #include <stdlib.h>
     2 #include <stdlib.h>
     3 #include "d3d2glsl.h"
     3 #include "mojoshader.h"
     4 
     4 
     5 int main(int argc, char **argv)
     5 int main(int argc, char **argv)
     6 {
     6 {
       
     7     printf("Compiled against version %d\n", MOJOSHADER_VERSION);
       
     8     printf("Linked against version %d\n", MOJOSHADER_version());
       
     9 
     7     if (argv[1] != NULL)
    10     if (argv[1] != NULL)
     8     {
    11     {
     9         FILE *io = fopen(argv[1], "rb");
    12         FILE *io = fopen(argv[1], "rb");
    10         if (io != NULL)
    13         if (io != NULL)
    11         {
    14         {
    12             unsigned char *buf = (unsigned char *) malloc(1000000);
    15             unsigned char *buf = (unsigned char *) malloc(1000000);
    13             int rc = fread(buf, 1, 1000000, io);
    16             int rc = fread(buf, 1, 1000000, io);
    14             fclose(io);
    17             fclose(io);
    15             D3D2GLSL_parse("d3d", buf, rc, NULL, NULL);
    18             MOJOSHADER_parse("d3d", buf, rc, NULL, NULL);
    16             free(buf);
    19             free(buf);
    17         } // if
    20         } // if
    18     } // if
    21     } // if
    19 
    22 
    20     return 0;
    23     return 0;