当前位置: 首页>>代码示例>>Java>>正文


Java JmeContext类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:23,代码来源:JFXApplication.java

示例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();
      	}
      }
  }
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:17,代码来源:JmeAppHarness.java

示例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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:9,代码来源:TestAppStates.java

示例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;
        
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:47,代码来源:JfxSystem.java

示例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;
}
 
开发者ID:neph1,项目名称:jme-cardboard,代码行数:16,代码来源:JmeAndroidCardboardSystem.java

示例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);
}
 
开发者ID:Kendanware,项目名称:onegui,代码行数:9,代码来源:Jme3Example1.java

示例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);
}
 
开发者ID:duodecimo,项目名称:magicallyous,代码行数:10,代码来源:Main.java

示例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());
//        }
    }
 
开发者ID:devinbost,项目名称:jMathGame3d,代码行数:38,代码来源:TestMain.java

示例9: getContext

import com.jme3.system.JmeContext; //导入依赖的package包/类
/**
 * @return The {@link JmeContext display context} for the application
 */
public JmeContext getContext(){
    return context;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:7,代码来源:Application.java

示例10: getContext

import com.jme3.system.JmeContext; //导入依赖的package包/类
@Override
public JmeContext getContext() {
    defaultFakeError();
    return null;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:6,代码来源:FakeApplication.java

示例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);
}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:7,代码来源:ImpositorCreator.java

示例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);
}
 
开发者ID:duodecimo,项目名称:magicallyous,代码行数:6,代码来源:MainServer.java

示例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!
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:5,代码来源:OpenRTSServer.java

示例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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:9,代码来源:Application.java

示例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);
}
 
开发者ID:megagorilla,项目名称:Containing,代码行数:10,代码来源:ContainingServer.java


注:本文中的com.jme3.system.JmeContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。