【发布时间】:2017-11-23 11:41:02
【问题描述】:
我想使用 .tmx 文件作为 TiledMap
这是我的主要课程:
package com.company;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.tiled.TiledMap;
public class Main {
private static TiledMap map;
public static void main(String[] args) {
try {
init();
}
catch (SlickException e) {
e.printStackTrace();
}
}
private static void init() throws SlickException {
map = new TiledMap("com/company/untitled.tmx");
map.render(100,100);
}
}
我在 intellij 中编译程序时遇到以下问题:
Tue Jun 20 23:37:23 IRDT 2017 错误:在当前线程中找不到 OpenGL 上下文。 java.lang.RuntimeException:在当前线程中找不到 OpenGL 上下文。 在 org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124) 在 org.lwjgl.opengl.GL11.glGetError(GL11.java:1377) 在 org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:226) 在 org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:171) 在 org.newdawn.slick.Image.(Image.java:196) 在 org.newdawn.slick.tiled.TileSet.(TileSet.java:113) 在 org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:447) 在 org.newdawn.slick.tiled.TiledMap.(TiledMap.java:90) 在 org.newdawn.slick.tiled.TiledMap.(TiledMap.java:77) 在 com.company.Main.init(Main.java:18) 在 com.company.Main.main(Main.java:11) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:498) 在 com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
【问题讨论】:
标签: java opengl intellij-idea slick tiled