Skip to content

Commit 135cbbe

Browse files
mardyWinterMute
authored andcommitted
Implement glArrayElement()
1 parent cf9161d commit 135cbbe

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/gc_gl.c

+25
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,31 @@ static void flat_draw_elements(void *cb_data)
22212221
GX_End();
22222222
}
22232223

2224+
void glArrayElement(GLint i)
2225+
{
2226+
float value[3];
2227+
if (glparamstate.imm_mode.in_gl_begin && glparamstate.cs.vertex_enabled) {
2228+
_ogx_array_reader_read_pos3f(&glparamstate.vertex_array, i, value);
2229+
glVertex3fv(value);
2230+
}
2231+
2232+
if (glparamstate.cs.normal_enabled) {
2233+
_ogx_array_reader_read_norm3f(&glparamstate.normal_array, i, value);
2234+
glNormal3fv(value);
2235+
}
2236+
2237+
if (glparamstate.cs.texcoord_enabled) {
2238+
_ogx_array_reader_read_tex2f(&glparamstate.texcoord_array, i, value);
2239+
glTexCoord2fv(value);
2240+
}
2241+
2242+
if (glparamstate.cs.color_enabled) {
2243+
GXColor color;
2244+
_ogx_array_reader_read_color(&glparamstate.color_array, i, &color);
2245+
glColor4ub(color.r, color.g, color.b, color.a);
2246+
}
2247+
}
2248+
22242249
void glDrawArrays(GLenum mode, GLint first, GLsizei count)
22252250
{
22262251
DrawMode gxmode = draw_mode(mode);

0 commit comments

Comments
 (0)