當前位置: 首頁>>代碼示例>>Java>>正文


Java AppSettings.setSamples方法代碼示例

本文整理匯總了Java中com.jme3.system.AppSettings.setSamples方法的典型用法代碼示例。如果您正苦於以下問題:Java AppSettings.setSamples方法的具體用法?Java AppSettings.setSamples怎麽用?Java AppSettings.setSamples使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.jme3.system.AppSettings的用法示例。


在下文中一共展示了AppSettings.setSamples方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public void init(SurveyPlayback sim) {

		mSettings = new AppSettings(true);

		mSettings.setTitle("HELIOS - The Heidelberg LiDAR Operations Simulator");
		mSettings.setVSync(true);
		mSettings.setResolution(1680, 1050);
		mSettings.setResolution(1280, 1024);
		mSettings.setResolution(1600, 1024);
		// setting.setResolution(1024,768);
		mSettings.setResolution(1024,768);

		mSettings.setSamples(4);

		setSettings(mSettings);

		setShowSettings(false);

		// ATTENTION: This is REQUIRED to prevent freezing of the whole computer if the program loses focus!
		// setPauseOnLostFocus() must be "false" since currently, setting it to "true" won't stop the actual simulation anyway.
		setPauseOnLostFocus(false);
		this.sim = sim;
	}
 
開發者ID:GIScience,項目名稱:helios,代碼行數:24,代碼來源:JMEFrontEnd.java

示例2: start

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
@Override
public void start()
{
	DisplayPrefsItem dprefs = new DisplayPrefsItem();
	AppSettings settings = new AppSettings(true);
	settings.setTitle("Multiplicity v3.0");
	settings.setBitsPerPixel(dprefs.getBitsPerPixel());
	settings.setWidth(dprefs.getWidth());
	settings.setHeight(dprefs.getHeight());
	settings.setFullscreen(dprefs.getFullScreen());
	settings.setVSync(true);
	settings.setSamples(dprefs.getMinimumAntiAliasSamples());
	setSettings(settings);

	super.start();
}
 
開發者ID:synergynet,項目名稱:synergynet3.1,代碼行數:17,代碼來源:JMEAppRoot.java

示例3: getPanel

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
private Container getPanel() {
   	Dimension d3Dim = new Dimension (800, 600);
	
	AppSettings settings = new AppSettings(true);
	
	settings.setWidth(d3Dim.width);
	settings.setHeight(d3Dim.height);
	settings.setSamples(4);
	settings.setVSync(true);
	settings.setFrameRate(60);
	
	setSettings(settings);
	createCanvas();
	JmeCanvasContext ctx = (JmeCanvasContext) getContext();
	ctx.setSystemListener(this);
	
	Canvas canvas = ctx.getCanvas();
	canvas.setPreferredSize(d3Dim);
	
	JPanel panel = new JPanel(new BorderLayout());
	panel.add( canvas, BorderLayout.CENTER );
	
	return panel;
}
 
開發者ID:twak,項目名稱:siteplan,代碼行數:25,代碼來源:Preview.java

示例4: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) throws BackingStoreException {
    	Locale.setDefault(Locale.ENGLISH);
        MainApp app = new MainApp();
        app.setPauseOnLostFocus(false);
        app.setDisplayStatView(false);
        app.setDisplayFps(false);

                
        AppSettings settings = new AppSettings(false);
        settings.load("SMILE");
        settings.setTitle("SMILE");
        settings.setSettingsDialogImage("Interface/line500px.png");
        settings.setFrameRate(60);
        settings.setSamples(2);
        settings.putBoolean("DisableJoysticks", false);
        settings.save("SMILE");

        //        settings.setVSync(true);
//        settings.setResolution(800, 600);
//        settings.setSamples(4);
//        settings.setFullscreen(true);
//        GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
//        DisplayMode[] modes = device.getDisplayModes();
//        for (int i = 0; i < modes.length; ++i) {
//            System.err.println(modes[i].getWidth() + "x" + modes[i].getHeight() + " " + modes[i].getRefreshRate()
//                    + " " + modes[i].getBitDepth());
//        }
//
//        int i = 10; // note: there are usually several, let's pick the first
//        settings.setResolution(modes[i].getWidth(), modes[i].getHeight());
//        settings.setFrequency(modes[i].getRefreshRate());
//        settings.setBitsPerPixel(modes[i].getBitDepth());
////        settings.setFullscreen(device.isFullScreenSupported());
        
        app.setSettings(settings);
        app.setShowSettings(true);
        
        app.start(); // restart the context to apply changes
    }
 
開發者ID:dwhuang,項目名稱:SMILE,代碼行數:40,代碼來源:MainApp.java

示例5: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) {
    AppSettings settings = new AppSettings(true);
    settings.setResolution(640, 480);
    settings.setSamples(4);
    settings.setTitle("Projection");
    settings.setFrameRate(40);
    
    ProjectTest app = new ProjectTest();
    app.setSettings(settings);
    app.setShowSettings(false);
    app.setPauseOnLostFocus(false);
    app.start();
    
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:15,代碼來源:ProjectTest.java

示例6: start

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
private void start() {
    AppSettings settings = new AppSettings(true);
    settings.setResolution(1280, 720);
    settings.setFrameRate(90);
    settings.setSamples(4);
    
    Jfx.create(Editor.class.getName(), settings);
    Jfx.getMainFrame().setLocationRelativeTo(null);
    Jfx.getMainFrame().setVisible(true);
    Jfx.getMainFrame().setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    Jfx.getMainFrame().setIconImages(createIcons());
    Jfx.getMainFrame().addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            super.windowClosing(e);
            Quit.doQuit(); // 由Quicker負責退出
        }
    });
    
    // 開始構建JFX界麵
    // 這裏要等待JmeApp執行完simpleInit方法之後再開始執行Jfx UI,因為UI要依賴於JME的初始化
    Jfx.runOnJme(() -> {
        Jfx.runOnJfx(() -> {
            UIManager.initializeLayout(Jfx.getJfxRoot());
        });
    });
    
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:29,代碼來源:Starter.java

示例7: main

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
/**
 * Main class used to run the animation preview from command line.
 * @param args the command line arguments
 * @throws Exception if exception occurs during execution
 */
public static void main(String[] args) throws Exception {
    AnimationPreview app = new AnimationPreview();
    final AppSettings appSettings = new AppSettings(true);
    appSettings.setFullscreen(false);
    appSettings.setResolution(640, 480);
    appSettings.setSamples(8);
    appSettings.setVSync(false);
    app.setSettings(appSettings);
    app.setShowSettings(false);
    app.start();
}
 
開發者ID:bubblecloud,項目名稱:jme3-open-asset-pack,代碼行數:17,代碼來源:AnimationPreview.java

示例8: apply

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
void apply(SimpleApplication app) {
		try {
			app.setDisplayFps(showFps.isSelected());
			app.setDisplayStatView(showStats.isSelected());
			app.setShowSettings(true);
	    	AppSettings settingsEdit = new AppSettings(false);
	    	settingsEdit.copyFrom(app.getContext().getSettings());
	    	settingsEdit.setFullscreen(fullscreen.isSelected());
	    	settingsEdit.setVSync(vsync.isSelected());
	    	DisplayMode mode = resolution.getValue();
	    	settingsEdit.setResolution(mode.getWidth(), mode.getHeight());
	    	settingsEdit.setDepthBits(mode.getBitDepth());
	    	settingsEdit.setFrequency(!vsync.isSelected() ? 0 : (mode.getRefreshRate() != DisplayMode.REFRESH_RATE_UNKNOWN)? mode.getRefreshRate() : 60);
	    	settingsEdit.setSamples(antialiasing.getValue());
	    	app.setSettings(settingsEdit);
	    	settingsEdit.save(settingsEdit.getTitle());
	    	app.restart();
//	    	((Main)app).onNextReshape = new Function<Main,Boolean>(){
//				@Override
//				public Boolean apply(Main input) {
//		    		Widgets.fullCamera(hudPanel, input.getCamera());
//		    		return true;
//				}
//
//	    	};
		} catch(Exception exc) {
			throw new RuntimeException(exc);
		}
    }
 
開發者ID:davidB,項目名稱:jme3_skel,代碼行數:30,代碼來源:HudSettings.java

示例9: init

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static RenderProcessor init(INodeManager manager, IRenderPreparator preparator) {
    java.util.logging.Logger.getLogger("").setLevel(Level.WARNING);
    RenderProcessor app = new RenderProcessor();
    AppSettings settings = new AppSettings(true);
    settings.setResolution(800, 600);
    settings.setSamples(2);
    settings.setFullscreen(false);
    app.setSettings(settings);
    app.setShowSettings(false);
    app.initNodeManager(manager);
    app.initPreparator(preparator);
    app.initSecurityLock();
    app.start();
    return app;
}
 
開發者ID:mosstest,項目名稱:mosstest,代碼行數:16,代碼來源:RenderProcessor.java

示例10: TweedFrame

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public TweedFrame() {

		instance = this;

		frame = new JFrame();

		WindowManager.register( frame );

		Dimension d3Dim = new Dimension( 1024, 640 );

		AppSettings settings = new AppSettings( true );

		settings.setWidth( d3Dim.width );
		settings.setHeight( d3Dim.height );
		settings.setSamples( 4 );
		settings.setVSync( true );
		settings.setFrameRate( 60 );

		tweed = new Tweed( this );
		tweed.setSettings( settings );
		tweed.createCanvas();
		JmeCanvasContext ctx = (JmeCanvasContext) tweed.getContext();
		ctx.setSystemListener( tweed );

		canvas = ctx.getCanvas();
		canvas.setPreferredSize( d3Dim );

		frame.setLayout( new BorderLayout() );
		frame.add( buildUI(), BorderLayout.EAST );
		frame.add( canvas, BorderLayout.CENTER );
		frame.setExtendedState( frame.getExtendedState() | JFrame.MAXIMIZED_BOTH );

		frame.addWindowListener( new WindowAdapter() {
			public void windowClosing( WindowEvent e ) {
				TweedSettings.save(true);
				Tweed.deleteScratch();
			};
		} );

		scheduler.scheduleAtFixedRate( new Runnable() {
			@Override
			public void run() {
				TweedSettings.save(true);
			}
		}, 30, 30, TimeUnit.SECONDS );

		scheduler.scheduleAtFixedRate( new Runnable() {
			@Override
			public void run() {
				Vector3d pt = tweed.cursorPosition;
				if ( coordLabel != null && TweedSettings.settings.trans != null) {
					worldLabel.setText( pt == null ? "..." : String.format( "%.4f, %.4f ", 
							pt.x, 
							pt.z) );
					coordLabel.setText( pt == null ? "..." : String.format( "%.4f, %.4f ", 
							pt.x + TweedSettings.settings.trans[0], 
							pt.z + TweedSettings.settings.trans[1]) );
					crsLabel.setText(TweedSettings.settings.gmlCoordSystem);
				}

				JFrame.setDefaultLookAndFeelDecorated( true );

			}
		}, 100, 100, TimeUnit.MILLISECONDS );

		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		frame.pack();
		frame.setVisible( !HEADLESS );

		tweed.startCanvas();
	}
 
開發者ID:twak,項目名稱:chordatlas,代碼行數:72,代碼來源:TweedFrame.java

示例11: onCreate

import com.jme3.system.AppSettings; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    initializeLogHandler();
    JmeSystem.setSystemDelegate(new JmeAndroidCardboardSystem());
    logger.fine("onCreate");
    super.onCreate(savedInstanceState);

    if (screenFullScreen) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                             WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
        if (!screenShowTitle) {
            requestWindowFeature(Window.FEATURE_NO_TITLE);
        }
    }

    final DataObject data = (DataObject) getLastNonConfigurationInstance();
    if (data != null) {
        logger.log(Level.FINE, "Using Retained App");
        this.app = data.app;
    } else {
        // Discover the screen reolution
        //TODO try to find a better way to get a hand on the resolution
        WindowManager wind = this.getWindowManager();
        Display disp = wind.getDefaultDisplay();
        
        
        DisplayMetrics displaymetrics = new DisplayMetrics();
        getWindow().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
        Log.d("CardboardHarness", "Resolution from Window, width:" + displaymetrics.widthPixels + ", height: " + displaymetrics.heightPixels);
        // Create Settings
        logger.log(Level.FINE, "Creating settings");
        AppSettings settings = new AppSettings(true);
        settings.setEmulateMouse(mouseEventsEnabled);
        settings.setEmulateMouseFlipAxis(mouseEventsInvertX, mouseEventsInvertY);
        settings.setUseJoysticks(joystickEventsEnabled);
        settings.setEmulateKeyboard(keyEventsEnabled);

        settings.setBitsPerPixel(eglBitsPerPixel);
        settings.setAlphaBits(eglAlphaBits);
        settings.setDepthBits(eglDepthBits);
        settings.setSamples(eglSamples);
        settings.setStencilBits(eglStencilBits);

        settings.setResolution(displaymetrics.widthPixels, displaymetrics.heightPixels);
        settings.setAudioRenderer(audioRendererType);

        settings.setFrameRate(frameRate);

        // Create application instance
        try {
            if (app == null) {
                @SuppressWarnings("unchecked")
                Class<? extends Application> clazz = (Class<? extends Application>) Class.forName(appClass);
                app = clazz.newInstance();
            }

            app.setSettings(settings);
            app.start();
        } catch (Exception ex) {
            handleError("Class " + appClass + " init failed", ex);
            setContentView(new TextView(this));
        }
    }

    ctx = (CardboardContext) app.getContext();
    view = ctx.createView(this);
    // AndroidHarness wraps the app as a SystemListener.
    ctx.setSystemListener(this);
    layoutDisplay();
    
    vrAppState = new CardboardState(ctx);
    (getJmeApplication()).getStateManager().attach(vrAppState);
}
 
開發者ID:neph1,項目名稱:jme-cardboard,代碼行數:76,代碼來源:CardboardHarness.java


注:本文中的com.jme3.system.AppSettings.setSamples方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。