lwjglを使って「ポン」ゲームを作りたいです。とりあえず、GameLoop と Inizializza の 2 つのクラスを作成しました。以下にマークされている 4 行のコードがあり、コンパイル エラーが発生しています。その部分は LJWGL wiki からコピーしました。
ゲームループ-
package game.engine;
public class GameLoop
{
//Main
public static void main(String[] argv)
{
Inizializza finestraGioco = new Inizializza();
finestraGioco.start();
}
}
イニシャルリッツァー
package game.engine;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
public class Inizializza
{
##This is where the code gives me errors##
GL11.glMatrixMode(GL11.GL_PROJECTION); >>Syntax error on token "glMatrixMode", identifier expected after this token
GL11.glLoadIdentity(); >>Syntax error on token "glLoadIdentity", Identifier expected after this toketn
GL11.glOrtho(0, width, height, 0, 1, -1); >>Syntax error on token "(",= expected
>>Syntax error(s) on tokens, misplaced construct(s)
GL11.glMatrixMode(GL11.GL_MODELVIEW); >>Syntax error on token "glMatrixMode", identifier expected after this token
>>Syntax error on tokent ".", ... expected
public void start()
{
try
{
Display.setDisplayMode(new DisplayMode(800,600));
Display.create();
} catch (LWJGLException e)
{
e.printStackTrace();
}
while(!Display.isCloseRequested())
{
Entità.pulisci();
Entità.colora();
Entità.disegna();
Display.update();
}
}
}