-//\r
+/*\r
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.\r
//All rights reserved.\r
//\r
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
//POSSIBILITY OF SUCH DAMAGE.\r
-//\r
+*/\r
#ifndef _COMPILER_INTERFACE_INCLUDED_\r
#define _COMPILER_INTERFACE_INCLUDED_\r
\r
\r
#ifdef _WIN32\r
#define C_DECL __cdecl\r
-#ifdef SH_EXPORTING\r
+/*#ifdef SH_EXPORTING\r
#define SH_IMPORT_EXPORT __declspec(dllexport)\r
#else\r
#define SH_IMPORT_EXPORT __declspec(dllimport)\r
-#endif\r
+#endif*/\r
+/* disable DLL linking */\r
+#define SH_IMPORT_EXPORT\r
#else\r
#define SH_IMPORT_EXPORT\r
#define __fastcall\r
#define C_DECL\r
#endif\r
\r
-//\r
+/*\r
// This is the platform independent interface between an OGL driver\r
// and the shading language compiler/linker.\r
-//\r
+*/\r
\r
#ifdef __cplusplus\r
extern "C" {\r
#endif\r
\r
-//\r
+/*\r
// Driver must call this first, once, before doing any other\r
// compiler/linker operations.\r
-//\r
+*/\r
SH_IMPORT_EXPORT int ShInitialize();\r
-//\r
+/*\r
// Driver should call this at shutdown.\r
-//\r
+*/\r
SH_IMPORT_EXPORT int __fastcall ShFinalize();\r
\r
-//\r
+/*\r
// Types of languages the compiler can consume.\r
-//\r
+*/\r
typedef enum {\r
EShLangVertex,\r
EShLangFragment,\r
EShLangCount\r
} EShLanguage;\r
\r
-//\r
+/*\r
// Types of output the linker will create.\r
-//\r
+*/\r
typedef enum {\r
EShExVertexFragment,\r
EShExPackFragment,\r
EShExFragment\r
} EShExecutable;\r
\r
-//\r
+/*\r
// Optimization level for the compiler.\r
-//\r
+*/\r
typedef enum {\r
EShOptNoGeneration,\r
EShOptNone,\r
- EShOptSimple, // Optimizations that can be done quickly\r
- EShOptFull // Optimizations that will take more time\r
+ EShOptSimple, /* Optimizations that can be done quickly */\r
+ EShOptFull /* Optimizations that will take more time */\r
} EShOptimizationLevel;\r
\r
-//\r
+/*\r
// Build a table for bindings. This can be used for locating\r
// attributes, uniforms, globals, etc., as needed.\r
-//\r
+*/\r
typedef struct {\r
char* name;\r
int binding;\r
\r
typedef struct {\r
int numBindings;\r
- ShBinding* bindings; // array of bindings\r
+ ShBinding* bindings; /* array of bindings */\r
} ShBindingTable;\r
\r
-//\r
+/*\r
// ShHandle held by but opaque to the driver. It is allocated,\r
// managed, and de-allocated by the compiler/linker. It's contents \r
// are defined by and used by the compiler and linker. For example,\r
// to the linker can be stored where ShHandle points.\r
//\r
// If handle creation fails, 0 will be returned.\r
-//\r
+*/\r
typedef void* ShHandle;\r
\r
-//\r
+/*\r
// Driver calls these to create and destroy compiler/linker\r
// objects.\r
-//\r
-SH_IMPORT_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int debugOptions); // one per shader\r
-SH_IMPORT_EXPORT ShHandle ShConstructLinker(const EShExecutable, int debugOptions); // one per shader pair\r
-SH_IMPORT_EXPORT ShHandle ShConstructUniformMap(); // one per uniform namespace (currently entire program object)\r
+*/\r
+SH_IMPORT_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int debugOptions); /* one per shader */\r
+SH_IMPORT_EXPORT ShHandle ShConstructLinker(const EShExecutable, int debugOptions); /* one per shader pair */\r
+SH_IMPORT_EXPORT ShHandle ShConstructUniformMap(); /* one per uniform namespace (currently entire program object) */\r
SH_IMPORT_EXPORT void ShDestruct(ShHandle);\r
\r
-//\r
+/*\r
// The return value of ShCompile is boolean, indicating\r
// success or failure.\r
//\r
// The info-log should be written by ShCompile into \r
// ShHandle, so it can answer future queries.\r
-//\r
+*/\r
SH_IMPORT_EXPORT int ShCompile(\r
const ShHandle,\r
const char* const shaderStrings[],\r
);\r
\r
\r
-//\r
+/*\r
// Similar to ShCompile, but accepts an opaque handle to an\r
// intermediate language structure.\r
-//\r
+*/\r
SH_IMPORT_EXPORT int ShCompileIntermediate(\r
ShHandle compiler,\r
ShHandle intermediate,\r
const EShOptimizationLevel,\r
- int debuggable // boolean\r
+ int debuggable /* boolean */\r
);\r
\r
SH_IMPORT_EXPORT int ShLink(\r
- const ShHandle, // linker object\r
- const ShHandle h[], // compiler objects to link together\r
+ const ShHandle, /* linker object */\r
+ const ShHandle h[], /* compiler objects to link together */\r
const int numHandles,\r
- ShHandle uniformMap, // updated with new uniforms\r
- short int** uniformsAccessed, // returned with indexes of uniforms accessed\r
+ ShHandle uniformMap, /* updated with new uniforms */\r
+ short int** uniformsAccessed, /* returned with indexes of uniforms accessed */\r
int* numUniformsAccessed); \r
\r
-//\r
+/*\r
// ShSetEncrpytionMethod is a place-holder for specifying\r
// how source code is encrypted.\r
-//\r
+*/\r
SH_IMPORT_EXPORT void ShSetEncryptionMethod(ShHandle);\r
\r
-//\r
+/*\r
// All the following return 0 if the information is not\r
// available in the object passed down, or the object is bad.\r
-//\r
+*/\r
SH_IMPORT_EXPORT const char* ShGetInfoLog(const ShHandle);\r
SH_IMPORT_EXPORT const void* ShGetExecutable(const ShHandle);\r
-SH_IMPORT_EXPORT int ShSetVirtualAttributeBindings(const ShHandle, const ShBindingTable*); // to detect user aliasing\r
-SH_IMPORT_EXPORT int ShSetFixedAttributeBindings(const ShHandle, const ShBindingTable*); // to force any physical mappings\r
-SH_IMPORT_EXPORT int ShGetPhysicalAttributeBindings(const ShHandle, const ShBindingTable**); // for all attributes\r
-//\r
+SH_IMPORT_EXPORT int ShSetVirtualAttributeBindings(const ShHandle, const ShBindingTable*); /* to detect user aliasing */\r
+SH_IMPORT_EXPORT int ShSetFixedAttributeBindings(const ShHandle, const ShBindingTable*); /* to force any physical mappings */\r
+SH_IMPORT_EXPORT int ShGetPhysicalAttributeBindings(const ShHandle, const ShBindingTable**); /* for all attributes */\r
+/*\r
// Tell the linker to never assign a vertex attribute to this list of physical attributes\r
-//\r
+*/\r
SH_IMPORT_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int count);\r
\r
-//\r
+/*\r
// Returns the location ID of the named uniform.\r
// Returns -1 if error.\r
-//\r
+*/\r
SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name);\r
\r
enum TDebugOptions {\r
}\r
#endif\r
\r
-#endif // _COMPILER_INTERFACE_INCLUDED_\r
+#endif /* _COMPILER_INTERFACE_INCLUDED_ */\r