/diverses/stuff/work/glslShader-0.0.1/glslTypes.h

00001 /***************************************************************************
00002  *                                                                         *
00003  *   (c) Art Tevs, MPI Informatik Saarbruecken                             *
00004  *       mailto: <tevs@mpi-sb.mpg.de>                                      *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  ***************************************************************************/
00012 
00013 #ifndef __GLSL_TYPES_H_
00014 #define __GLSL_TYPES_H_
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif /* __cplusplus */
00019 
00020 /*------------------------------------------------------------------------------
00021         Standard library includings and definitions
00022 ------------------------------------------------------------------------------*/
00023 //#include "GL/glew.h"
00024 #include "glslPlatform.h"
00025 #include <stddef.h>
00026 
00027 #define GL_GLEXT_PROTOTYPES
00028 #define GL_GLEXT_LEGACY
00029 
00030 #include <GL/gl.h>
00031 
00032 typedef unsigned int GLhandleARB;
00033 
00034 /*------------------------------------------------------------------------------
00035         Basic Type Definitions
00036 ------------------------------------------------------------------------------*/
00037 typedef unsigned char   GLSLbyte;
00038 
00039 typedef char                    GLSLint8;
00040 typedef unsigned char   GLSLuint8;
00041 
00042 typedef signed short    GLSLint16;
00043 typedef unsigned short  GLSLuint16;
00044 
00045 typedef signed int              GLSLint32;
00046 typedef unsigned int    GLSLuint32;
00047 
00048 typedef float                   GLSLfloat32;
00049 typedef double                  GLSLfloat64;
00050 
00051 typedef GLSLbyte                GLSLbool;
00052 
00053 #ifdef __WIN32__
00054         typedef   signed __int64  GLSLint64;
00055         typedef unsigned __int64  GLSLuint64;
00056 #else
00057         typedef   signed long long GLSLint64;
00058         typedef unsigned long long GLSLuint64;
00059 #endif
00060 
00061 
00062 /*------------------------------------------------------------------------------
00063         Basic program definitions and constants
00064 ------------------------------------------------------------------------------*/
00065 
00067 #define GLSL_LONGEST_NAME               256
00068 
00070 #define GLSL_STACK_SIZE                 64
00071 
00073 #define GLSL_TRUE                               0x1
00074 
00076 #define GLSL_FALSE                              0x0
00077 
00078 
00080 typedef enum _GLSL_ShaderType
00081 {
00083         GLSL_VERTEX,
00084         
00086         GLSL_FRAGMENT
00087         
00088 } GLSL_ShaderType;
00089 
00090 
00091 GLSLAPI const char* GLSL_ERR_NOT_VALID_PROGRAM;;
00092 GLSLAPI const char* GLSL_ERR_NO_PARAMETERS;
00093 GLSLAPI const char* GLSL_ERR_CAN_NOT_CREATE;
00094 GLSLAPI const char* GLSL_ERR_WRONG_SHADER_TYPE;
00095 GLSLAPI const char* GLSL_ERR_CANNOT_OPEN_FILE;
00096 GLSLAPI const char* GLSL_ERR_NOT_LINKED;
00097 GLSLAPI const char* GLSL_ERR_NO_PARAMETER;
00098 GLSLAPI const char* GLSL_ERR_OUT_OF_MEMORY;
00099 GLSLAPI const char* GLSL_ERR_ONLY_BEFORE_LINK;
00100 
00102 typedef struct _GLSL_Attr
00103 {
00105         int index;
00106         
00108         char name[GLSL_LONGEST_NAME];
00109 } GLSL_Attr;
00110 
00112 typedef struct _GLSL_Param 
00113 {
00115         GLint location;
00116         
00118         GLenum type;
00119         
00121         int length;
00122         
00124         char name[GLSL_LONGEST_NAME];
00125 } GLSL_Param;
00126 
00128 typedef struct _GLSL_Shader
00129 {
00131         GLhandleARB program;
00132 
00134         GLSL_Param* params;
00135         
00137         int param_count;
00138 
00140         GLSL_Attr*  attrs;
00141         
00143         int attr_count;
00144         
00146         GLSLbool is_valid;      
00147 } GLSL_Shader;
00148  
00149 
00151 typedef GLSL_Shader*                            GLSLprogram;
00152 
00154 typedef void(*GLSLerrorCallback)(GLSLprogram, void*);
00155 
00156 
00157 #ifdef __cplusplus
00158 }
00159 #endif /* __cplusplus */
00160 
00161 
00162 #endif

Generated on Sat Apr 7 18:49:42 2007 for glslShader by  doxygen 1.5.1