Skip to content

Sync usage

damios edited this page Nov 1, 2020 · 2 revisions

-- Since 1.9.12 part of libGDX --

How to use the Sync class:

public static void main(String[] args) {
	Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
	config.setTitle("abc");
	// [...]		

	new Lwjgl3Application(new WhateverApplication() {
		private Sync sync = new Sync();

		@Override
		public void render() {
			super.render();

			if (!Gdx.graphics.isFullscreen())
				sync.sync(Gdx.graphics.getDisplayMode().refreshRate);
		}
	}, config);
}
Clone this wiki locally