Hello!
Can anybody help me? Ive got this problem. I have created a game, where you have to build shops. I have this code:
if (Mouse.isButtonDown(0) {
stall(mouseX, mouseY);
}
And this code to set the value to the var, in the main game loop:
mouseX = Mouse.getX();
mouseY = Mouse.getY();
When I start the game, and I click the left mouse button, the shop appeares, but after I take my finger of the mouse
button, it disappeares! Please help!
my shop code:
public static void stall(int x, int y) {
glLoadIdentity();
store.bind();
glTranslatef(x, y, 0);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(0, 0);
glTexCoord2f(0, store.getHeight());
glVertex2f(0, 50);
glTexCoord2f(store.getWidth(), store.getHeight());
glVertex2f(50, 50);
glTexCoord2f(store.getWidth(), 0);
glVertex2f(50, 0);
glEnd();