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() {
|
private void render() {
|
||||||
gl.clear(GL.COLOR_BUFFER_BIT);
|
gl.clear(GL.COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
gl.pushMatrix();
|
gl.begin(GL.POLYGON);
|
||||||
gl.begin(GL.POLYGON);
|
{
|
||||||
{
|
float color = 1.0f;
|
||||||
gl.color3f(0.0f, 1.0f, 1.0f);
|
int buttonDown = 0;
|
||||||
gl.vertex2f(position.x + 0.0f, position.y + 0.0f);
|
|
||||||
|
|
||||||
gl.color3f(1.0f, 0.0f, 1.0f);
|
for(int i=0;i<Mouse.buttonCount; i++) {
|
||||||
gl.vertex2f(position.x + 0.0f, position.y + 30.0f);
|
if(Mouse.isButtonDown(i)) {
|
||||||
gl.vertex2f(position.x + 40.0f, position.y + 30.0f);
|
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 + 0.0f, position.y + 0.0f);
|
||||||
gl.vertex2f(position.x + 60.0f, position.y + 15.f);
|
gl.vertex2f(position.x + 0.0f, position.y + 30.0f);
|
||||||
gl.vertex2f(position.x + 40.0f, position.y + 0.0f);
|
gl.vertex2f(position.x + 40.0f, position.y + 30.0f);
|
||||||
}
|
gl.vertex2f(position.x + 60.0f, position.y + 15.f);
|
||||||
gl.end();
|
gl.vertex2f(position.x + 40.0f, position.y + 0.0f);
|
||||||
gl.popMatrix();
|
}
|
||||||
|
gl.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -168,22 +168,26 @@ public class MouseTest {
|
||||||
private void render() {
|
private void render() {
|
||||||
gl.clear(GL.COLOR_BUFFER_BIT);
|
gl.clear(GL.COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
gl.pushMatrix();
|
|
||||||
gl.begin(GL.POLYGON);
|
gl.begin(GL.POLYGON);
|
||||||
{
|
{
|
||||||
gl.color3f(0.0f, 1.0f, 1.0f);
|
float color = 1.0f;
|
||||||
gl.vertex2f(position.x + 0.0f, position.y + 0.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 + 0.0f, position.y + 30.0f);
|
||||||
gl.vertex2f(position.x + 40.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 + 60.0f, position.y + 15.f);
|
||||||
gl.vertex2f(position.x + 40.0f, position.y + 0.0f);
|
gl.vertex2f(position.x + 40.0f, position.y + 0.0f);
|
||||||
}
|
}
|
||||||
gl.end();
|
gl.end();
|
||||||
gl.popMatrix();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue