Index: ddraw/glExtensions.cpp |
— | — | @@ -36,6 +36,7 @@ |
37 | 37 | GLint (APIENTRY *glGetAttribLocation) (GLuint program, const GLchar* name) = NULL;
|
38 | 38 | void (APIENTRY *glVertexAttribPointer) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer) = NULL;
|
39 | 39 | void (APIENTRY *glEnableVertexAttribArray) (GLuint index) = NULL;
|
| 40 | +void (APIENTRY *glDisableVertexAttribArray) (GLuint index) = NULL;
|
40 | 41 |
|
41 | 42 | void (APIENTRY *glGenFramebuffers) (GLsizei n, GLuint* ids) = NULL;
|
42 | 43 | void (APIENTRY *glBindFramebuffer) (GLenum target, GLuint framebuffer) = NULL;
|
— | — | @@ -142,6 +143,7 @@ |
143 | 144 | glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)wglGetProcAddress("glGetAttribLocation");
|
144 | 145 | glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)wglGetProcAddress("glVertexAttribPointer");
|
145 | 146 | glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)wglGetProcAddress("glEnableVertexAttribArray");
|
| 147 | + glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)wglGetProcAddress("glDisableVertexAttribArray");
|
146 | 148 | }
|
147 | 149 | else
|
148 | 150 | {
|
Index: ddraw/glExtensions.h |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | GLAPI GLint (APIENTRY *glGetAttribLocation) (GLuint program, const GLchar* name);
|
58 | 58 | GLAPI void (APIENTRY *glVertexAttribPointer) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer);
|
59 | 59 | GLAPI void (APIENTRY *glEnableVertexAttribArray) (GLuint index);
|
| 60 | +GLAPI void (APIENTRY *glDisableVertexAttribArray) (GLuint index);
|
60 | 61 |
|
61 | 62 | GLAPI void (APIENTRY *glGenFramebuffers) (GLsizei n, GLuint* ids);
|
62 | 63 | GLAPI void (APIENTRY *glBindFramebuffer) (GLenum target, GLuint framebuffer);
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -811,6 +811,7 @@ |
812 | 812 | ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
813 | 813 | ClearDepth(1.0);
|
814 | 814 | ClearStencil(0);
|
| 815 | + EnableArray(-1,false);
|
815 | 816 | glClear(GL_COLOR_BUFFER_BIT);
|
816 | 817 | glFlush();
|
817 | 818 | SetScissor(false,0,0,0,0);
|
— | — | @@ -844,6 +845,7 @@ |
845 | 846 | void glRenderer::_Blt(LPRECT lpDestRect, glDirectDrawSurface7 *src,
|
846 | 847 | glDirectDrawSurface7 *dest, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
847 | 848 | {
|
| 849 | + int progtype;
|
848 | 850 | LONG sizes[6];
|
849 | 851 | ddInterface->GetSizes(sizes);
|
850 | 852 | int error;
|
— | — | @@ -886,6 +888,7 @@ |
887 | 889 | if(dwFlags & DDBLT_COLORFILL)
|
888 | 890 | {
|
889 | 891 | SetShader(PROG_FILL,NULL,NULL,true);
|
| 892 | + progtype = PROG_FILL;
|
890 | 893 | switch(ddInterface->GetBPP())
|
891 | 894 | {
|
892 | 895 | case 8:
|
— | — | @@ -925,6 +928,7 @@ |
926 | 929 | if((dwFlags & DDBLT_KEYSRC) && (src && src->colorkey[0].enabled) && !(dwFlags & DDBLT_COLORFILL))
|
927 | 930 | {
|
928 | 931 | SetShader(PROG_CKEY,NULL,NULL,true);
|
| 932 | + progtype = PROG_CKEY;
|
929 | 933 | GLint keyloc = glGetUniformLocation(shaders[PROG_CKEY].prog,"keyIn");
|
930 | 934 | switch(ddInterface->GetBPP())
|
931 | 935 | {
|
— | — | @@ -956,6 +960,7 @@ |
957 | 961 | else if(!(dwFlags & DDBLT_COLORFILL))
|
958 | 962 | {
|
959 | 963 | SetShader(PROG_TEXTURE,NULL,NULL,true);
|
| 964 | + progtype = PROG_TEXTURE;
|
960 | 965 | GLint texloc = glGetUniformLocation(shaders[PROG_TEXTURE].prog,"Texture");
|
961 | 966 | glUniform1i(texloc,0);
|
962 | 967 | }
|
— | — | @@ -965,20 +970,17 @@ |
966 | 971 | GLint viewloc = glGetUniformLocation(prog,"view");
|
967 | 972 | glUniform4f(viewloc,0,(GLfloat)dest->fakex,0,(GLfloat)dest->fakey);
|
968 | 973 | dest->dirty |= 2;
|
969 | | - GLint xyloc = glGetAttribLocation(prog,"xy");
|
970 | | - glEnableVertexAttribArray(xyloc);
|
971 | | - glVertexAttribPointer(xyloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].x);
|
972 | | - GLint rgbloc = glGetAttribLocation(prog,"rgb");
|
973 | | - if(rgbloc != -1)
|
| 974 | + EnableArray(shaders[progtype].pos,true);
|
| 975 | + glVertexAttribPointer(shaders[progtype].pos,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].x);
|
| 976 | + if(shaders[progtype].rgb != -1)
|
974 | 977 | {
|
975 | | - glEnableVertexAttribArray(rgbloc);
|
976 | | - glVertexAttribPointer(rgbloc,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
| 978 | + EnableArray(shaders[progtype].rgb,true);
|
| 979 | + glVertexAttribPointer(shaders[progtype].rgb,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
977 | 980 | }
|
978 | 981 | if(!(dwFlags & DDBLT_COLORFILL))
|
979 | 982 | {
|
980 | | - GLint stloc = glGetAttribLocation(prog,"st");
|
981 | | - glEnableVertexAttribArray(stloc);
|
982 | | - glVertexAttribPointer(stloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
| 983 | + EnableArray(shaders[progtype].texcoord,true);
|
| 984 | + glVertexAttribPointer(shaders[progtype].texcoord,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
983 | 985 | }
|
984 | 986 | glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
985 | 987 | SetFBO(0,0,false);
|
— | — | @@ -1003,7 +1005,7 @@ |
1004 | 1006 | return texture;
|
1005 | 1007 | }
|
1006 | 1008 |
|
1007 | | -void glRenderer::_DrawBackbuffer(GLuint *texture, int x, int y)
|
| 1009 | +void glRenderer::_DrawBackbuffer(GLuint *texture, int x, int y, int progtype)
|
1008 | 1010 | {
|
1009 | 1011 | GLfloat view[4];
|
1010 | 1012 | SetActiveTexture(0);
|
— | — | @@ -1037,12 +1039,10 @@ |
1038 | 1040 | bltvertices[0].y = bltvertices[1].y = bltvertices[1].x = bltvertices[3].x = 0.;
|
1039 | 1041 | bltvertices[0].x = bltvertices[2].x = (float)x;
|
1040 | 1042 | bltvertices[2].y = bltvertices[3].y = (float)y;
|
1041 | | - GLint xyloc = glGetAttribLocation(prog,"xy");
|
1042 | | - glEnableVertexAttribArray(xyloc);
|
1043 | | - glVertexAttribPointer(xyloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].x);
|
1044 | | - GLint stloc = glGetAttribLocation(prog,"st");
|
1045 | | - glEnableVertexAttribArray(stloc);
|
1046 | | - glVertexAttribPointer(stloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
| 1043 | + EnableArray(shaders[progtype].pos,true);
|
| 1044 | + glVertexAttribPointer(shaders[progtype].pos,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].x);
|
| 1045 | + EnableArray(shaders[progtype].texcoord,true);
|
| 1046 | + glVertexAttribPointer(shaders[progtype].texcoord,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
1047 | 1047 | glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
1048 | 1048 | SetFBO(0,0,false);
|
1049 | 1049 | }
|
— | — | @@ -1049,6 +1049,7 @@ |
1050 | 1050 |
|
1051 | 1051 | void glRenderer::_DrawScreen(GLuint texture, GLuint paltex, glDirectDrawSurface7 *dest, glDirectDrawSurface7 *src, bool setsync)
|
1052 | 1052 | {
|
| 1053 | + int progtype;
|
1053 | 1054 | RECT r,r2;
|
1054 | 1055 | if((dest->ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
|
1055 | 1056 | {
|
— | — | @@ -1109,6 +1110,7 @@ |
1110 | 1111 | if(ddInterface->GetBPP() == 8)
|
1111 | 1112 | {
|
1112 | 1113 | SetShader(PROG_PAL256,NULL,NULL,true);
|
| 1114 | + progtype = PROG_PAL256;
|
1113 | 1115 | glBindTexture(GL_TEXTURE_2D,paltex);
|
1114 | 1116 | glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,256,1,0,GL_RGBA,GL_UNSIGNED_BYTE,dest->palette->GetPalette(NULL));
|
1115 | 1117 | GLint palloc = glGetUniformLocation(shaders[PROG_PAL256].prog,"ColorTable");
|
— | — | @@ -1122,8 +1124,9 @@ |
1123 | 1125 | SetActiveTexture(0);
|
1124 | 1126 | if(dxglcfg.scalingfilter)
|
1125 | 1127 | {
|
1126 | | - _DrawBackbuffer(&texture,dest->fakex,dest->fakey);
|
| 1128 | + _DrawBackbuffer(&texture,dest->fakex,dest->fakey,progtype);
|
1127 | 1129 | SetShader(PROG_TEXTURE,NULL,NULL,true);
|
| 1130 | + progtype = PROG_TEXTURE;
|
1128 | 1131 | glBindTexture(GL_TEXTURE_2D,texture);
|
1129 | 1132 | GLuint prog = GetProgram() & 0xFFFFFFFF;
|
1130 | 1133 | GLint texloc = glGetUniformLocation(prog,"Texture");
|
— | — | @@ -1133,6 +1136,7 @@ |
1134 | 1137 | else
|
1135 | 1138 | {
|
1136 | 1139 | SetShader(PROG_TEXTURE,NULL,NULL,true);
|
| 1140 | + progtype = PROG_TEXTURE;
|
1137 | 1141 | glBindTexture(GL_TEXTURE_2D,texture);
|
1138 | 1142 | GLuint prog = GetProgram() & 0xFFFFFFFF;
|
1139 | 1143 | GLint texloc = glGetUniformLocation(prog,"Texture");
|
— | — | @@ -1156,17 +1160,14 @@ |
1157 | 1161 | }
|
1158 | 1162 | bltvertices[0].s = bltvertices[0].t = bltvertices[1].t = bltvertices[2].s = 1.;
|
1159 | 1163 | bltvertices[1].s = bltvertices[2].t = bltvertices[3].s = bltvertices[3].t = 0.;
|
1160 | | - GLint xyloc = glGetAttribLocation(prog,"xy");
|
1161 | | - glEnableVertexAttribArray(xyloc);
|
1162 | | - glVertexAttribPointer(xyloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].x);
|
1163 | | - GLint stloc = glGetAttribLocation(prog,"st");
|
1164 | | - glEnableVertexAttribArray(stloc);
|
1165 | | - glVertexAttribPointer(stloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
1166 | | - GLint rgbloc = glGetAttribLocation(prog,"rgb");
|
1167 | | - if(rgbloc != -1)
|
| 1164 | + EnableArray(shaders[progtype].pos,true);
|
| 1165 | + glVertexAttribPointer(shaders[progtype].pos,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].x);
|
| 1166 | + EnableArray(shaders[progtype].texcoord,true);
|
| 1167 | + glVertexAttribPointer(shaders[progtype].texcoord,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
| 1168 | + if(shaders[progtype].rgb != -1)
|
1168 | 1169 | {
|
1169 | | - glEnableVertexAttribArray(rgbloc);
|
1170 | | - glVertexAttribPointer(rgbloc,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
| 1170 | + EnableArray(shaders[progtype].rgb,true);
|
| 1171 | + glVertexAttribPointer(shaders[progtype].rgb,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
1171 | 1172 | }
|
1172 | 1173 | glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
1173 | 1174 | glFlush();
|
— | — | @@ -1333,13 +1334,13 @@ |
1334 | 1335 | if(device->renderstate[D3DRENDERSTATE_ZWRITEENABLE]) DepthWrite(true);
|
1335 | 1336 | else DepthWrite(false);
|
1336 | 1337 | _GENSHADER prog = genshaders[current_genshader].shader;
|
1337 | | - glEnableVertexAttribArray(prog.attribs[0]);
|
| 1338 | + EnableArray(prog.attribs[0],true);
|
1338 | 1339 | glVertexAttribPointer(prog.attribs[0],3,GL_FLOAT,false,vertices[0].stride,vertices[0].data);
|
1339 | 1340 | if(transformed)
|
1340 | 1341 | {
|
1341 | 1342 | if(prog.attribs[1] != -1)
|
1342 | 1343 | {
|
1343 | | - glEnableVertexAttribArray(prog.attribs[1]);
|
| 1344 | + EnableArray(prog.attribs[1],true);
|
1344 | 1345 | glVertexAttribPointer(prog.attribs[1],4,GL_FLOAT,false,vertices[1].stride,vertices[1].data);
|
1345 | 1346 | }
|
1346 | 1347 | }
|
— | — | @@ -1349,7 +1350,7 @@ |
1350 | 1351 | {
|
1351 | 1352 | if(prog.attribs[i+2] != -1)
|
1352 | 1353 | {
|
1353 | | - glEnableVertexAttribArray(prog.attribs[i+2]);
|
| 1354 | + EnableArray(prog.attribs[i+2],true);
|
1354 | 1355 | glVertexAttribPointer(prog.attribs[i+2],1,GL_FLOAT,false,vertices[i+2].stride,vertices[i+2].data);
|
1355 | 1356 | }
|
1356 | 1357 | }
|
— | — | @@ -1358,7 +1359,7 @@ |
1359 | 1360 | {
|
1360 | 1361 | if(prog.attribs[7] != -1)
|
1361 | 1362 | {
|
1362 | | - glEnableVertexAttribArray(prog.attribs[7]);
|
| 1363 | + EnableArray(prog.attribs[7],true);
|
1363 | 1364 | glVertexAttribPointer(prog.attribs[7],3,GL_FLOAT,false,vertices[7].stride,vertices[7].data);
|
1364 | 1365 | }
|
1365 | 1366 | }
|
— | — | @@ -1368,7 +1369,7 @@ |
1369 | 1370 | {
|
1370 | 1371 | if(prog.attribs[8+i] != -1)
|
1371 | 1372 | {
|
1372 | | - glEnableVertexAttribArray(prog.attribs[8+i]);
|
| 1373 | + EnableArray(prog.attribs[8+i],true);
|
1373 | 1374 | glVertexAttribPointer(prog.attribs[8+i],4,GL_UNSIGNED_BYTE,true,vertices[i+8].stride,vertices[i+8].data);
|
1374 | 1375 | }
|
1375 | 1376 | }
|
— | — | @@ -1383,7 +1384,7 @@ |
1384 | 1385 | case 0: // st
|
1385 | 1386 | if(prog.attribs[i+18] != -1)
|
1386 | 1387 | {
|
1387 | | - glEnableVertexAttribArray(prog.attribs[i+18]);
|
| 1388 | + EnableArray(prog.attribs[i+18],true);
|
1388 | 1389 | glVertexAttribPointer(prog.attribs[i+18],2,GL_FLOAT,false,vertices[i+10].stride,vertices[i+10].data);
|
1389 | 1390 | }
|
1390 | 1391 | break;
|
— | — | @@ -1390,7 +1391,7 @@ |
1391 | 1392 | case 1: // str
|
1392 | 1393 | if(prog.attribs[i+26] != -1)
|
1393 | 1394 | {
|
1394 | | - glEnableVertexAttribArray(prog.attribs[i+26]);
|
| 1395 | + EnableArray(prog.attribs[i+26],true);
|
1395 | 1396 | glVertexAttribPointer(prog.attribs[i+26],3,GL_FLOAT,false,vertices[i+10].stride,vertices[i+10].data);
|
1396 | 1397 | }
|
1397 | 1398 | break;
|
— | — | @@ -1397,7 +1398,7 @@ |
1398 | 1399 | case 2: // strq
|
1399 | 1400 | if(prog.attribs[i+34] != -1)
|
1400 | 1401 | {
|
1401 | | - glEnableVertexAttribArray(prog.attribs[i+34]);
|
| 1402 | + EnableArray(prog.attribs[i+34],true);
|
1402 | 1403 | glVertexAttribPointer(prog.attribs[i+34],4,GL_FLOAT,false,vertices[i+10].stride,vertices[i+10].data);
|
1403 | 1404 | }
|
1404 | 1405 | break;
|
— | — | @@ -1404,7 +1405,7 @@ |
1405 | 1406 | case 3: // s
|
1406 | 1407 | if(prog.attribs[i+10] != -1)
|
1407 | 1408 | {
|
1408 | | - glEnableVertexAttribArray(prog.attribs[i+10]);
|
| 1409 | + EnableArray(prog.attribs[i+10],true);
|
1409 | 1410 | glVertexAttribPointer(prog.attribs[i+10],1,GL_FLOAT,false,vertices[i+10].stride,vertices[i+10].data);
|
1410 | 1411 | }
|
1411 | 1412 | break;
|
Index: ddraw/glRenderer.h |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | GLuint _MakeTexture(GLint min, GLint mag, GLint wraps, GLint wrapt, DWORD width, DWORD height, GLint texformat1, GLint texformat2, GLint texformat3);
|
112 | 112 | void _DrawScreen(GLuint texture, GLuint paltex, glDirectDrawSurface7 *dest, glDirectDrawSurface7 *src, bool setsync);
|
113 | 113 | void _DeleteTexture(GLuint texture);
|
114 | | - void _DrawBackbuffer(GLuint *texture, int x, int y);
|
| 114 | + void _DrawBackbuffer(GLuint *texture, int x, int y, int progtype);
|
115 | 115 | void _InitD3D(int zbuffer);
|
116 | 116 | void _Clear(glDirectDrawSurface7 *target, DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil);
|
117 | 117 | void glRenderer::_DrawPrimitives(glDirect3DDevice7 *device, GLenum mode, GLVERTEX *vertices, int *texcormats, DWORD count, LPWORD indices,
|
Index: ddraw/glutil.cpp |
— | — | @@ -51,6 +51,7 @@ |
52 | 52 | GLclampf cleara = 0.0;
|
53 | 53 | GLclampd cleardepth = 1.0;
|
54 | 54 | GLint clearstencil = 0;
|
| 55 | +bool arrays[42];
|
55 | 56 |
|
56 | 57 | void InitFBO()
|
57 | 58 | {
|
— | — | @@ -327,4 +328,21 @@ |
328 | 329 | clearstencil = stencil;
|
329 | 330 | glClearStencil(stencil);
|
330 | 331 | }
|
| 332 | +}
|
| 333 | +
|
| 334 | +void EnableArray(int index, bool enabled)
|
| 335 | +{
|
| 336 | + if(index == -1)
|
| 337 | + {
|
| 338 | + for(int i = 0; i < 42; i++)
|
| 339 | + arrays[i] = false;
|
| 340 | + return;
|
| 341 | + }
|
| 342 | + if(index >= 42) return;
|
| 343 | + if(arrays[index] != enabled)
|
| 344 | + {
|
| 345 | + arrays[index] = enabled;
|
| 346 | + if(enabled) glEnableVertexAttribArray(index);
|
| 347 | + else glDisableVertexAttribArray(index);
|
| 348 | + }
|
331 | 349 | } |
\ No newline at end of file |
Index: ddraw/glutil.h |
— | — | @@ -41,5 +41,6 @@ |
42 | 42 | void ClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a);
|
43 | 43 | void ClearDepth(GLclampd depth);
|
44 | 44 | void ClearStencil(GLint stencil);
|
| 45 | +void EnableArray(int index, bool enabled);
|
45 | 46 |
|
46 | 47 | #endif //_GLUTIL_H |
\ No newline at end of file |
Index: ddraw/shaders.cpp |
— | — | @@ -120,12 +120,12 @@ |
121 | 121 | const int SHADER_START = __LINE__;
|
122 | 122 | SHADER shaders[] =
|
123 | 123 | {
|
124 | | - {0,0, vert_ortho, frag_Color, 0},
|
125 | | - {0,0, vert_ortho, frag_Texture, 0},
|
126 | | - {0,0, vert_ortho, frag_Pal256, 0},
|
127 | | - {0,0, vert_ortho, frag_ColorKey, 0},
|
128 | | - {0,0, vert_ortho, frag_ColorKeyMask, 0},
|
129 | | - {0,0, vert_ortho, frag_2ColorKey, 0}
|
| 124 | + {0,0, vert_ortho, frag_Color, 0,-1,-1,-1},
|
| 125 | + {0,0, vert_ortho, frag_Texture, 0,-1,-1,-1},
|
| 126 | + {0,0, vert_ortho, frag_Pal256, 0,-1,-1,-1},
|
| 127 | + {0,0, vert_ortho, frag_ColorKey, 0,-1,-1,-1},
|
| 128 | + {0,0, vert_ortho, frag_ColorKeyMask, 0,-1,-1,-1},
|
| 129 | + {0,0, vert_ortho, frag_2ColorKey, 0,-1,-1,-1}
|
130 | 130 | };
|
131 | 131 | const int SHADER_END = __LINE__ - 4;
|
132 | 132 | const int NumberOfShaders = SHADER_END - SHADER_START;
|
— | — | @@ -157,6 +157,9 @@ |
158 | 158 | glAttachShader(shaders[i].prog,shaders[i].fs);
|
159 | 159 | }
|
160 | 160 | glLinkProgram(shaders[i].prog);
|
| 161 | + shaders[i].pos = glGetAttribLocation(shaders[i].prog,"xy");
|
| 162 | + shaders[i].rgb = glGetAttribLocation(shaders[i].prog,"rgb");
|
| 163 | + shaders[i].texcoord = glGetAttribLocation(shaders[i].prog,"st");
|
161 | 164 | }
|
162 | 165 | }
|
163 | 166 |
|
Index: ddraw/shaders.h |
— | — | @@ -26,6 +26,9 @@ |
27 | 27 | const char *vsrc;
|
28 | 28 | const char *fsrc;
|
29 | 29 | GLint prog;
|
| 30 | + GLint pos;
|
| 31 | + GLint rgb;
|
| 32 | + GLint texcoord;
|
30 | 33 | } SHADER;
|
31 | 34 |
|
32 | 35 | extern SHADER shaders[];
|