Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[svn] Cleanups, split things out.
--HG-- branch : trunk
- Loading branch information
icculus
committed
Feb 10, 2008
1 parent
2caaf91
commit 7e55d66
Showing
4 changed files
with
83 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
PROJECT(d3d2glsl) | ||
ADD_EXECUTABLE(parse parse.c) | ||
ADD_EXECUTABLE(parse testparse.c parse.c) | ||
|
||
# End of CMakeLists.txt ... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* d3d2glsl; generate GLSL programs from bytecode of compiled Direct3D shaders. | ||
* | ||
* Please see the file LICENSE.txt in the source's root directory. | ||
* | ||
* This file written by Ryan C. Gordon. | ||
*/ | ||
|
||
#ifndef __INCL_D3D2GLSL_H_ | ||
#define __INCL_D3D2GLSL_H_ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* !!! FIXME: documentation. */ | ||
/* !!! FIXME: this needs to change to return a buffer of GLSL code. */ | ||
int D3D2GLSL_parse(const uint8 *tokenbuf, const uint32 bufsize); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* include-once blocker. */ | ||
|
||
/* end of d3d2glsl.h ... */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
#include "d3d2glsl.h" | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
if (argv[1] != NULL) | ||
{ | ||
FILE *io = fopen(argv[1], "rb"); | ||
if (io != NULL) | ||
{ | ||
uint8 *buf = (uint8 *) malloc(1000000); | ||
int rc = fread(buf, 1, 1000000, io); | ||
fclose(io); | ||
D3D2GLSL_parse(buf, rc); | ||
free(buf); | ||
} // if | ||
} // if | ||
|
||
return 0; | ||
} // main | ||
|
||
// end of testparse.c ... | ||
|