HamsterofDeath
12-31-2003, 03:41 AM
at first, another question. will this work ?
(i'm using gl4java, just ignore the gl.* and glEnum.*)
public void setStates(GLFunc gl)
{
gl.glEnableClientState(GLEnum.GL_VERTEX_ARRAY);
if (hasNormals)
{
gl.glEnableClientState(GLEnum.GL_NORMAL_ARRAY);
}
if (hasColors)
{
gl.glEnableClientState(GLEnum.GL_COLOR_ARRAY);
}
if (hasFog)
{
gl.glEnableClientState(GLEnum.GL_FOG_COORDINATE_AR RAY_EXT);
}
if (hasUnit0TexCoords)
{
gl.glActiveTexture(0);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
if (hasUnit1TexCoords)
{
gl.glActiveTexture(1);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
if (hasUnit1TexCoords)
{
gl.glActiveTexture(2);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
if (hasUnit1TexCoords)
{
gl.glActiveTexture(3);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
}
or do i have to use glActiveTextureARB ? whats the difference ?
---
next question : i already have working vertex arrays. how can i make them faster by using vars ?
can i still manipulate single elements inside this array ?
-----
final question :
when i'm done, i want to use an interleaved array, storing all data that is needed, making use of indexed access, AND use all this as a var.
is it possible, and if yes, how ?
(i'm using gl4java, just ignore the gl.* and glEnum.*)
public void setStates(GLFunc gl)
{
gl.glEnableClientState(GLEnum.GL_VERTEX_ARRAY);
if (hasNormals)
{
gl.glEnableClientState(GLEnum.GL_NORMAL_ARRAY);
}
if (hasColors)
{
gl.glEnableClientState(GLEnum.GL_COLOR_ARRAY);
}
if (hasFog)
{
gl.glEnableClientState(GLEnum.GL_FOG_COORDINATE_AR RAY_EXT);
}
if (hasUnit0TexCoords)
{
gl.glActiveTexture(0);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
if (hasUnit1TexCoords)
{
gl.glActiveTexture(1);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
if (hasUnit1TexCoords)
{
gl.glActiveTexture(2);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
if (hasUnit1TexCoords)
{
gl.glActiveTexture(3);
gl.glEnableClientState(GLEnum.GL_TEXTURE_COORD_ARR AY);
}
}
or do i have to use glActiveTextureARB ? whats the difference ?
---
next question : i already have working vertex arrays. how can i make them faster by using vars ?
can i still manipulate single elements inside this array ?
-----
final question :
when i'm done, i want to use an interleaved array, storing all data that is needed, making use of indexed access, AND use all this as a var.
is it possible, and if yes, how ?