mod: making it possible to see color differences by clicking mouse buttons
This commit is contained in:
parent
0d1cc7583b
commit
f40973624c
|
@ -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.begin(GL.POLYGON);
|
||||
{
|
||||
float color = 1.0f;
|
||||
int buttonDown = 0;
|
||||
|
||||
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);
|
||||
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.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.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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
gl.vertex2f(position.x + 0.0f, position.y + 0.0f);
|
||||
float color = 1.0f;
|
||||
int buttonDown = 0;
|
||||
|
||||
gl.color3f(1.0f, 0.0f, 1.0f);
|
||||
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.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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue