mod: making it possible to see color differences by clicking mouse buttons

This commit is contained in:
Brian Matzon 2003-03-24 17:07:25 +00:00
parent 0d1cc7583b
commit f40973624c
2 changed files with 31 additions and 23 deletions

View File

@ -201,22 +201,26 @@ public class MouseCreationTest {
private void render() {
gl.clear(GL.COLOR_BUFFER_BIT);
gl.pushMatrix();
gl.begin(GL.POLYGON);
{
gl.color3f(0.0f, 1.0f, 1.0f);
gl.vertex2f(position.x + 0.0f, position.y + 0.0f);
gl.color3f(1.0f, 0.0f, 1.0f);
gl.vertex2f(position.x + 0.0f, position.y + 30.0f);
gl.vertex2f(position.x + 40.0f, position.y + 30.0f);
gl.color3f(1.0f, 1.0f, 0.0f);
gl.vertex2f(position.x + 60.0f, position.y + 15.f);
gl.vertex2f(position.x + 40.0f, position.y + 0.0f);
}
gl.end();
gl.popMatrix();
gl.begin(GL.POLYGON);
{
float color = 1.0f;
int buttonDown = 0;
for(int i=0;i<Mouse.buttonCount; i++) {
if(Mouse.isButtonDown(i)) {
color = (1.0f / Mouse.buttonCount) * (i+1);
break;
}
}
gl.color3f(color, color, color);
gl.vertex2f(position.x + 0.0f, position.y + 0.0f);
gl.vertex2f(position.x + 0.0f, position.y + 30.0f);
gl.vertex2f(position.x + 40.0f, position.y + 30.0f);
gl.vertex2f(position.x + 60.0f, position.y + 15.f);
gl.vertex2f(position.x + 40.0f, position.y + 0.0f);
}
gl.end();
}
/**

View File

@ -168,22 +168,26 @@ public class MouseTest {
private void render() {
gl.clear(GL.COLOR_BUFFER_BIT);
gl.pushMatrix();
gl.begin(GL.POLYGON);
{
gl.color3f(0.0f, 1.0f, 1.0f);
float color = 1.0f;
int buttonDown = 0;
for(int i=0;i<Mouse.buttonCount; i++) {
if(Mouse.isButtonDown(i)) {
color = (1.0f / Mouse.buttonCount) * (i+1);
break;
}
}
gl.color3f(color, color, color);
gl.vertex2f(position.x + 0.0f, position.y + 0.0f);
gl.color3f(1.0f, 0.0f, 1.0f);
gl.vertex2f(position.x + 0.0f, position.y + 30.0f);
gl.vertex2f(position.x + 40.0f, position.y + 30.0f);
gl.color3f(1.0f, 1.0f, 0.0f);
gl.vertex2f(position.x + 60.0f, position.y + 15.f);
gl.vertex2f(position.x + 40.0f, position.y + 0.0f);
}
gl.end();
gl.popMatrix();
}
/**