Newer
Older
JumpingGame / src / main / java / views / PlayerRenderer.java
k-fujii on 15 Nov 2021 678 bytes Vec2の追加
package views;

import static org.lwjgl.glfw.GLFW.glfwMakeContextCurrent;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL11C.glEnable;

public class PlayerRenderer implements IView {
    private long window;


    public PlayerRenderer(long window) {
        this.window = window;
    }

    public void display() {
        glfwMakeContextCurrent(window);
        glEnable(GL_TEXTURE_2D);
        glBegin(GL_QUADS);
        glVertex2f(-0.5f, 0.5f);
        glVertex2f(0.5f, 0.5f);
        glVertex2f(0.5f, -0.5f);
        glVertex2f(-0.5f, -0.5f);
        glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
        glEnd();
        glDisable(GL_TEXTURE_2D);
    }
}