am 7f56e19b: am 2d496bfe: Fix point sprites.

Merge commit '7f56e19ba07b17bf72f5340a6cf06bcdad7f6b7e'

* commit '7f56e19ba07b17bf72f5340a6cf06bcdad7f6b7e':
  Fix point sprites.
This commit is contained in:
Romain Guy
2009-09-04 18:00:40 -07:00
committed by Android Git Automerger
2 changed files with 13 additions and 0 deletions

View File

@@ -56,6 +56,11 @@ void ProgramFragment::setupGL(const Context *rsc, ProgramFragmentState *state)
glEnable(GL_TEXTURE_2D);
if (rsc->checkVersion1_1()) {
if (mPointSpriteEnable) {
glEnable(GL_POINT_SPRITE_OES);
} else {
glDisable(GL_POINT_SPRITE_OES);
}
glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, mPointSpriteEnable);
}
glBindTexture(GL_TEXTURE_2D, mTextures[ct]->getTextureID());

View File

@@ -800,6 +800,12 @@ static void SC_shininess(float s)
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, s);
}
static void SC_pointAttenuation(float a, float b, float c)
{
GLfloat params[] = { a, b, c };
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, params);
}
static void SC_hsbToRgb(float h, float s, float b, float* rgb)
{
float red = 0.0f;
@@ -1185,6 +1191,8 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = {
"void", "(float, float, float, float)" },
{ "shininess", (void *)&SC_shininess,
"void", "(float)" },
{ "pointAttenuation", (void *)&SC_pointAttenuation,
"void", "(float, float, float)" },
{ "uploadToTexture", (void *)&SC_uploadToTexture,
"void", "(int, int)" },