本文整理汇总了Java中com.jme3.system.JmeContext类的典型用法代码示例。如果您正苦于以下问题:Java JmeContext类的具体用法?Java JmeContext怎么用?Java JmeContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JmeContext类属于com.jme3.system包,在下文中一共展示了JmeContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startJMEApplication
import com.jme3.system.JmeContext; //导入依赖的package包/类
/**
* Start the new jME application.
*
* @param application the new jME application.
*/
@JMEThread
private static void startJMEApplication(@NotNull final JmeToJFXApplication application) {
final InitializationManager initializationManager = InitializationManager.getInstance();
initializationManager.onBeforeCreateJMEContext();
application.start();
final JmeContext context = application.getContext();
final Renderer renderer = context.getRenderer();
if (renderer == null) {
final EditorConfig editorConfig = EditorConfig.getInstance();
editorConfig.setOpenGLVersion(OpenGLVersion.GL_20);
editorConfig.save();
}
}
示例2: appDraw
import com.jme3.system.JmeContext; //导入依赖的package包/类
@Override
public void appDraw() {
logger.log(Level.FINE, "JmeAppHarness appDraw");
if (renderer == null) {
JmeContext iosContext = app.getContext();
renderer = (GLRenderer)iosContext.getRenderer();
renderer.initialize();
input = (IosInputHandler)iosContext.getTouchInput();
input.initialize();
} else {
app.update();
if (autoFlush) {
renderer.postFrame();
}
}
}
示例3: start
import com.jme3.system.JmeContext; //导入依赖的package包/类
@Override
public void start(JmeContext.Type contextType){
AppSettings settings = new AppSettings(true);
settings.setResolution(1024, 768);
setSettings(settings);
super.start(contextType);
}
示例4: startApp
import com.jme3.system.JmeContext; //导入依赖的package包/类
/**
* Create JfxView and start application. the renderer will be set to custom, see below:<BR>
* settings.setRenderer("CUSTOM" + JfxContext.class.getName())) , this custom renderer is a proxy.<BR>
* If you need to specify the actual renderer, you need to set like below:<BR>
* settings.put(JfxContext.JFX_WRAP_RENDERER, AppSettings.LWJGL_OPENGL3);
*
* @param appClass
* @param settings
* @return
*/
public static JfxView startApp(String appClass, AppSettings settings) {
// ---- Custom JmeContext for render.
settings.setCustomRenderer(JfxContext.class);
// Specify a true renderer to render game, default is: LWJGL_OPENGL2
// settings.put(JfxContext.JFX_WRAP_RENDERER, AppSettings.LWJGL_OPENGL3);
// ---- Create Application
LegacyApplication app;
try{
Class<? extends LegacyApplication> clazz = (Class<? extends LegacyApplication>) Class.forName(appClass);
app = clazz.newInstance();
}catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex){
LOG.log(Level.SEVERE, "Could not create application by appClass={0}, error={1}"
, new Object[]{appClass, ex.getMessage()});
return null;
}
JfxAppState jfxAppState = new JfxAppState();
app.setSettings(settings);
app.setPauseOnLostFocus(false);
app.getStateManager().attach(jfxAppState);
app.start(JmeContext.Type.OffscreenSurface);
// ---- Create JfxView and set event converter
JfxView jfxView = new JfxView(app, jfxAppState, settings.getWidth(), settings.getHeight());
jfxView.setSmooth(true);
jfxView.setCache(true);
jfxView.setScaleY(-1);
jfxView.setPreserveRatio(true);
jfxView.setMouseEventEnabled(true);
jfxView.setKeyEventEnabled(true);
return jfxView;
}
示例5: newContext
import com.jme3.system.JmeContext; //导入依赖的package包/类
@Override
public JmeContext newContext(AppSettings settings, JmeContext.Type contextType) {
if (settings.getAudioRenderer().equals(AppSettings.ANDROID_MEDIAPLAYER)) {
//audioRendererType = AppSettings.ANDROID_MEDIAPLAYER;
} else if (settings.getAudioRenderer().equals(AppSettings.ANDROID_OPENAL_SOFT)) {
//audioRendererType = AppSettings.ANDROID_OPENAL_SOFT;
} else {
logger.log(Level.INFO, "AudioRenderer not set. Defaulting to OpenAL Soft");
//audioRendererType = AppSettings.ANDROID_OPENAL_SOFT;
}
initialize(settings);
JmeContext ctx = new CardboardContext();
ctx.setSettings(settings);
return ctx;
}
示例6: main
import com.jme3.system.JmeContext; //导入依赖的package包/类
public static void main(final String... arguments) {
final AppSettings settings = new AppSettings(true);
settings.setResolution(1280, 720);
final Jme3Example1 example = new Jme3Example1();
example.setSettings(settings);
example.start(JmeContext.Type.Display);
}
示例7: main
import com.jme3.system.JmeContext; //导入依赖的package包/类
public static void main(String[] args) {
Main app = new Main();
AppSettings settings = new AppSettings(true);
settings.setTitle("Magicallyous");
//settings.setSettingsDialogImage("Interface/splashscreen.png");
settings.setResolution(1280, 800);
app.setSettings(settings);
app.start(JmeContext.Type.Display);
}
示例8: main
import com.jme3.system.JmeContext; //导入依赖的package包/类
public static void main(String[] args) {
testMain = new TestMain();
testMain.start(JmeContext.Type.Headless);
// try {
// System.out.println("Creating application..");
// Application app = new Application();
// System.out.println("Starting application in LWJGL mode..");
// app.start();
// System.out.println("Waiting 5 seconds");
// Thread.sleep(5000);
// System.out.println("Closing application..");
// app.stop();
//
// Thread.sleep(2000);
// System.out.println("Starting in fullscreen mode");
// app = new Application();
// AppSettings settings = new AppSettings(true);
// settings.setFullscreen(true);
// settings.setResolution(-1,-1); // current width/height
// app.setSettings(settings);
// app.start();
// Thread.sleep(5000);
// app.stop();
//
// Thread.sleep(2000);
// System.out.println("Creating offscreen buffer application");
// app = new Application();
// app.start(Type.OffscreenSurface);
// Thread.sleep(3000);
// System.out.println("Destroying offscreen buffer");
// app.stop();
//
// }
// catch (InterruptedException e){
// System.err.println("InterruptedException: " + e.getMessage());
// }
}
示例9: getContext
import com.jme3.system.JmeContext; //导入依赖的package包/类
/**
* @return The {@link JmeContext display context} for the application
*/
public JmeContext getContext(){
return context;
}
示例10: getContext
import com.jme3.system.JmeContext; //导入依赖的package包/类
@Override
public JmeContext getContext() {
defaultFakeError();
return null;
}
示例11: main
import com.jme3.system.JmeContext; //导入依赖的package包/类
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
new ImpositorCreator().start(JmeContext.Type.OffscreenSurface);
}
示例12: main
import com.jme3.system.JmeContext; //导入依赖的package包/类
public static void main(String[] args) {
MainServer app = new MainServer();
//app.start(JmeContext.Type.Headless);
app.start(JmeContext.Type.Display);
}
示例13: main
import com.jme3.system.JmeContext; //导入依赖的package包/类
public static void main(String[] args) {
OpenRTSServer app = new OpenRTSServer();
app.start(JmeContext.Type.Headless); // headless type for servers!
}
示例14: start
import com.jme3.system.JmeContext; //导入依赖的package包/类
/**
* Starts the application in {@link Type#Display display} mode.
*
* @see #start(com.jme3.system.JmeContext.Type)
*/
public void start(){
start(JmeContext.Type.Display);
}
示例15: main
import com.jme3.system.JmeContext; //导入依赖的package包/类
/**
* Starts the app headless (no display)
*
* @param args
*/
public static void main(String[] args) {
ContainingServer app = new ContainingServer();
app.start(JmeContext.Type.Headless);
}