parent
ca50a90c09
commit
5a4c51a5cb
32
gfx/gl.c
32
gfx/gl.c
|
@ -242,31 +242,19 @@ static void gl_set_coords(const struct gl_coords *coords)
|
||||||
{
|
{
|
||||||
pglClientActiveTexture(GL_TEXTURE0);
|
pglClientActiveTexture(GL_TEXTURE0);
|
||||||
|
|
||||||
if (coords->vertex)
|
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||||
{
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (coords->color)
|
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||||
{
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (coords->tex_coord)
|
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||||
{
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
|
||||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (coords->lut_tex_coord)
|
pglClientActiveTexture(GL_TEXTURE1);
|
||||||
{
|
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||||
pglClientActiveTexture(GL_TEXTURE1);
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
pglClientActiveTexture(GL_TEXTURE0);
|
||||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
|
||||||
pglClientActiveTexture(GL_TEXTURE0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1299,48 +1299,38 @@ bool gl_glsl_set_coords(const struct gl_coords *coords)
|
||||||
if (!glsl_enable || !glsl_modern)
|
if (!glsl_enable || !glsl_modern)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (coords->tex_coord)
|
int loc;
|
||||||
|
|
||||||
|
loc = pglGetAttribLocation(gl_program[active_index], "rubyTexCoord");
|
||||||
|
if (loc >= 0)
|
||||||
{
|
{
|
||||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyTexCoord");
|
pglEnableVertexAttribArray(loc);
|
||||||
if (loc >= 0)
|
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->tex_coord);
|
||||||
{
|
gl_attribs[gl_attrib_index++] = loc;
|
||||||
pglEnableVertexAttribArray(loc);
|
|
||||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->tex_coord);
|
|
||||||
gl_attribs[gl_attrib_index++] = loc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coords->vertex)
|
loc = pglGetAttribLocation(gl_program[active_index], "rubyVertexCoord");
|
||||||
|
if (loc >= 0)
|
||||||
{
|
{
|
||||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyVertexCoord");
|
pglEnableVertexAttribArray(loc);
|
||||||
if (loc >= 0)
|
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->vertex);
|
||||||
{
|
gl_attribs[gl_attrib_index++] = loc;
|
||||||
pglEnableVertexAttribArray(loc);
|
|
||||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->vertex);
|
|
||||||
gl_attribs[gl_attrib_index++] = loc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coords->color)
|
loc = pglGetAttribLocation(gl_program[active_index], "rubyColor");
|
||||||
|
if (loc >= 0)
|
||||||
{
|
{
|
||||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyColor");
|
pglEnableVertexAttribArray(loc);
|
||||||
if (loc >= 0)
|
pglVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, 0, coords->color);
|
||||||
{
|
gl_attribs[gl_attrib_index++] = loc;
|
||||||
pglEnableVertexAttribArray(loc);
|
|
||||||
pglVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, 0, coords->color);
|
|
||||||
gl_attribs[gl_attrib_index++] = loc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coords->lut_tex_coord)
|
loc = pglGetAttribLocation(gl_program[active_index], "rubyLUTTexCoord");
|
||||||
|
if (loc >= 0)
|
||||||
{
|
{
|
||||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyLUTTexCoord");
|
pglEnableVertexAttribArray(loc);
|
||||||
if (loc >= 0)
|
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->lut_tex_coord);
|
||||||
{
|
gl_attribs[gl_attrib_index++] = loc;
|
||||||
pglEnableVertexAttribArray(loc);
|
|
||||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->lut_tex_coord);
|
|
||||||
gl_attribs[gl_attrib_index++] = loc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue