Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[svn] Might as well keep the tradition alive.
--HG-- branch : trunk
- Loading branch information
icculus
committed
Mar 22, 2008
1 parent
dd3444f
commit 7b5803f
Showing
3 changed files
with
31 additions
and
28 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,6 @@ | ||
PROJECT(d3d2glsl) | ||
ADD_EXECUTABLE(testparse testparse.c d3d2glsl.c) | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4) | ||
PROJECT(MojoShader) | ||
ADD_EXECUTABLE(testparse testparse.c mojoshader.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
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,44 +1,45 @@ | ||
/** | ||
* d3d2glsl; generate GLSL programs from bytecode of compiled Direct3D shaders. | ||
* MojoShader; generate shader 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_ | ||
#ifndef __INCL_MOJOSHADER_H_ | ||
#define __INCL_MOJOSHADER_H_ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* | ||
* const int compiled_against = D3D2GLSL_VERSION; | ||
* const int linked_against = D3D2GLSL_version(); | ||
* const int compiled_against = MOJOSHADER_VERSION; | ||
* const int linked_against = MOJOSHADER_version(); | ||
*/ | ||
#define D3D2GLSL_VERSION 1 | ||
int D3D2GLSL_version(void); | ||
#define MOJOSHADER_VERSION 1 | ||
int MOJOSHADER_version(void); | ||
|
||
/* | ||
* These allocators work just like the C runtime's malloc() and free() | ||
* (in fact, they use malloc() and free() internally if you don't | ||
* specify your own allocator). | ||
*/ | ||
typedef void *(*D3D2GLSL_malloc)(int bytes); | ||
typedef void (*D3D2GLSL_free)(void *ptr); | ||
typedef void *(*MOJOSHADER_malloc)(int bytes); | ||
typedef void (*MOJOSHADER_free)(void *ptr); | ||
|
||
/* !!! FIXME: documentation. */ | ||
/* !!! FIXME: this needs to change to return a buffer of GLSL code. */ | ||
int D3D2GLSL_parse(const char *profile, const unsigned char *tokenbuf, | ||
const unsigned int bufsize, D3D2GLSL_malloc m, | ||
D3D2GLSL_free f); | ||
int MOJOSHADER_parse(const char *profile, const unsigned char *tokenbuf, | ||
const unsigned int bufsize, MOJOSHADER_malloc m, | ||
MOJOSHADER_free f); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* include-once blocker. */ | ||
|
||
/* end of d3d2glsl.h ... */ | ||
/* end of mojoshader.h ... */ | ||
|