]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Added new files in the makefile
authorAxel Isouard <axel.isouard@epitech.eu>
Wed, 25 Jul 2012 11:58:27 +0000 (13:58 +0200)
committerAxel Isouard <axel.isouard@epitech.eu>
Wed, 25 Jul 2012 11:58:27 +0000 (13:58 +0200)
gl_backend.c
gl_backend.h
gl_cache.h
gl_rmain.c
makefile.inc

index bb20a109a8b92ccc97a25d159cf4930f10bb6b93..e90ec46844ea5cd06b75ddfb9931c916aae3838c 100644 (file)
@@ -1,4 +1,4 @@
-
+#include "shadermodeinfo.h"
 #include "quakedef.h"
 #include "cl_collision.h"
 #include "dpsoftrast.h"
@@ -2616,11 +2616,12 @@ void R_Mesh_Start(void)
        }
 }
 
-static qboolean GL_Backend_CompileShader(int programobject, GLenum shadertypeenum, const char *shadertype, int numstrings, const char **strings)
+static qboolean GL_Backend_CompileShader(shadermodeinfo_t *modeinfo, int programobject, GLenum shadertypeenum, const char *shadertype, int numstrings, const char **strings)
 {
        int shaderobject;
        int shadercompiled;
        char compilelog[MAX_INPUTLINE];
+
        shaderobject = qglCreateShader(shadertypeenum);CHECKGLERROR
        if (!shaderobject)
                return false;
@@ -2647,7 +2648,7 @@ static qboolean GL_Backend_CompileShader(int programobject, GLenum shadertypeenu
        return true;
 }
 
-unsigned int GL_Backend_CompileProgram(int vertexstrings_count, const char **vertexstrings_list, int geometrystrings_count, const char **geometrystrings_list, int fragmentstrings_count, const char **fragmentstrings_list)
+unsigned int GL_Backend_CompileProgram(shadermodeinfo_t *modeinfo, int vertexstrings_count, const char **vertexstrings_list, int geometrystrings_count, const char **geometrystrings_list, int fragmentstrings_count, const char **fragmentstrings_list)
 {
        GLint programlinked;
        GLuint programobject = 0;
@@ -2673,15 +2674,15 @@ unsigned int GL_Backend_CompileProgram(int vertexstrings_count, const char **ver
                qglBindFragDataLocation(programobject, 0, "dp_FragColor");
 #endif
 
-       if (vertexstrings_count && !GL_Backend_CompileShader(programobject, GL_VERTEX_SHADER, "vertex", vertexstrings_count, vertexstrings_list))
+       if (vertexstrings_count && !GL_Backend_CompileShader(modeinfo, programobject, GL_VERTEX_SHADER, "vertex", vertexstrings_count, vertexstrings_list))
                goto cleanup;
 
 #ifdef GL_GEOMETRY_SHADER
-       if (geometrystrings_count && !GL_Backend_CompileShader(programobject, GL_GEOMETRY_SHADER, "geometry", geometrystrings_count, geometrystrings_list))
+       if (geometrystrings_count && !GL_Backend_CompileShader(modeinfo, programobject, GL_GEOMETRY_SHADER, "geometry", geometrystrings_count, geometrystrings_list))
                goto cleanup;
 #endif
 
-       if (fragmentstrings_count && !GL_Backend_CompileShader(programobject, GL_FRAGMENT_SHADER, "fragment", fragmentstrings_count, fragmentstrings_list))
+       if (fragmentstrings_count && !GL_Backend_CompileShader(modeinfo, programobject, GL_FRAGMENT_SHADER, "fragment", fragmentstrings_count, fragmentstrings_list))
                goto cleanup;
 
        qglLinkProgram(programobject);CHECKGLERROR
index 86b2d310d97031cf49b95b8704abb31e02c5d18a..b85be4b801467816750579d3dfa30006986435b0 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef GL_BACKEND_H
 #define GL_BACKEND_H
 
+typedef struct shadermodeinfo_s shadermodeinfo_t;
+
 extern r_viewport_t gl_viewport;
 extern matrix4x4_t gl_modelmatrix;
 extern matrix4x4_t gl_viewmatrix;
@@ -54,7 +56,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
 void R_Mesh_DestroyFramebufferObject(int fbo);
 void R_Mesh_SetRenderTargets(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, rtexture_t *colortexture2, rtexture_t *colortexture3, rtexture_t *colortexture4);
 
-unsigned int GL_Backend_CompileProgram(int vertexstrings_count, const char **vertexstrings_list, int geometrystrings_count, const char **geometrystrings_list, int fragmentstrings_count, const char **fragmentstrings_list);
+unsigned int GL_Backend_CompileProgram(shadermodeinfo_t *modeinfo, int vertexstrings_count, const char **vertexstrings_list, int geometrystrings_count, const char **geometrystrings_list, int fragmentstrings_count, const char **fragmentstrings_list);
 void GL_Backend_FreeProgram(unsigned int prog);
 
 extern cvar_t gl_paranoid;
index dde21425a20962ba4dcf2dc620b890f8b36c585b..8ec5ffe8a609480d44f2916b48aaf6927e9caccd 100644 (file)
@@ -1,6 +1,6 @@
 #define GL_CACHE_VERSION        1
 
-typedefstruct gl_cache_header_s
+typedef struct gl_cache_header_s
 {
   int version;
   int crc;
index 002355ccdd64882000d45a1eb7f3841b7c37f014..55cd9b7fea0ffd6b5db653f5e601b2e05f79da26 100644 (file)
@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // r_main.c
 
+#include "shadermodeinfo.h"
 #include "quakedef.h"
 #include "cl_dyntexture.h"
 #include "r_shadow.h"
@@ -616,6 +617,8 @@ typedef struct shaderpermutationinfo_s
 }
 shaderpermutationinfo_t;
 
+// ~exidl: moved to shadermodeinfo.h
+/*
 typedef struct shadermodeinfo_s
 {
        const char *vertexfilename;
@@ -625,6 +628,7 @@ typedef struct shadermodeinfo_s
        const char *name;
 }
 shadermodeinfo_t;
+*/
 
 // NOTE: MUST MATCH ORDER OF SHADERPERMUTATION_* DEFINES!
 shaderpermutationinfo_t shaderpermutationinfo[SHADERPERMUTATION_COUNT] =
@@ -1088,7 +1092,7 @@ static void R_GLSL_CompilePermutation(r_glsl_permutation_t *p, unsigned int mode
 
        // compile the shader program
        if (vertstrings_count + geomstrings_count + fragstrings_count)
-               p->program = GL_Backend_CompileProgram(vertstrings_count, vertstrings_list, geomstrings_count, geomstrings_list, fragstrings_count, fragstrings_list);
+         p->program = GL_Backend_CompileProgram(modeinfo, vertstrings_count, vertstrings_list, geomstrings_count, geomstrings_list, fragstrings_count, fragstrings_list);
        if (p->program)
        {
                CHECKGLERROR
index fe1eabe12a8421255e80ce5bd51dc6ba2bd0bf9c..df0cdd82db762b9310209df25922b4ac30e3cf62 100644 (file)
@@ -124,6 +124,7 @@ OBJ_COMMON= \
        ft2.o \
        utf8lib.o \
        gl_backend.o \
+       gl_cache.o \
        gl_draw.o \
        gl_rmain.o \
        gl_rsurf.o \