void GeomRenderer::sendColor(GLuint colorIndex) { assert(colorData.size == 3 || colorData.size == 4); switch(colorData.type) { case GL_BYTE: if (colorData.size == 3) glColor3bv((const GLbyte*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4bv((const GLbyte*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; case GL_UNSIGNED_BYTE: if (colorData.size == 3) glColor3ubv((const GLubyte*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4ubv((const GLubyte*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; case GL_SHORT: if (colorData.size == 3) glColor3sv((const GLshort*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4sv((const GLshort*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; case GL_UNSIGNED_SHORT: if (colorData.size == 3) glColor3usv((const GLushort*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4usv((const GLushort*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; case GL_INT: if (colorData.size == 3) glColor3iv((const GLint*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4iv((const GLint*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; case GL_UNSIGNED_INT: if (colorData.size == 3) glColor3uiv((const GLuint*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4uiv((const GLuint*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; case GL_FLOAT: if (colorData.size == 3) glColor3fv((const GLfloat*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4fv((const GLfloat*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; case GL_DOUBLE: if (colorData.size == 3) glColor3dv((const GLdouble*)((const char*)colorData.pointer + colorIndex*colorData.stride)); if (colorData.size == 4) glColor4dv((const GLdouble*)((const char*)colorData.pointer + colorIndex*colorData.stride)); break; } }
///////////////////////////////////////////////////////// // Render // void GEMglColor3sv :: render(GemState *state) { glColor3sv (v); }
M(void, glColor3sv, jobject v) { glColor3sv(BUFF(GLshort, v)); }
inline void glColor3v( const GLshort * v ) { glColor3sv( v ); }
void __glXDisp_Color3sv(GLbyte *pc) { glColor3sv( (GLshort *)(pc + 0) ); }