   [java] Disabling vsync in full screen
  Hello!I'm a new member of these forums but have been lurking around for quite a long time. It's a great resource! However, I've run in to a problem that I can't really find a solution of.I'm currently working on a project using full screen exclusive mode.I'm using the technique described in http://www.gamedev.net/reference/programming/features/javarender/default.asp .My problem is that the app seems to get vertically synchronized. I don't want that (at least not while perfomance testing!).Is there a way of using double buffering but skipping the vertical synchronization?If not, how do i disable vsync anyway (losing double buffering)?And another thing: When forcing OpenGL acceleration i get slightly lower input lag (but still some of it). Why is that? I still have the same fps (60)...Here is the relevant code:try {// Clear back buffer...engineG2D = engineCanvas.createGraphics();engineG2D.setColor(Color.GRAY);engineG2D.fillRect(0, 0, resolutionWidth, resolutionHeight);if (MenuSystem.active) {MenuSystem.run();MenuSystem.draw(engineG2D, resolutionWidth, resolutionHeight);} else {gameG2D = gameCanvas.createGraphics();gameG2D.setColor(Color.BLACK);gameG2D.fillRect(0, 0, settings.Game.VIEW_WIDTH, settings.Game.VIEW_HEIGHT);// TODO run game logicsession.doStuff();// Draw gamesession.paint(gameG2D);// Scale gameCanvas onto engineCanvasengineG2D.drawImage(gameCanvas, scaledX, scaledY, scaledWidth, scaledHeight, null);}// Calculate and draw FPSlong now = System.currentTimeMillis();long delta = now - lastUpdate;if (delta > 1000) {lastUpdate = now;fps = (frames * delta) / 1000;frames = 0;}drawFPS(engineG2D, fps);// Blit image and flip...graphics = bufferStrat.getDrawGraphics();graphics.drawImage(engineCanvas, 0, 0, null);if (!bufferStrat.contentsLost()) {bufferStrat.show();}} finally {// release resourcesif (graphics != null) {graphics.dispose();}if (engineG2D != null) {engineG2D.dispose();}if (gameG2D != null) {gameG2D.dispose();}}[Edited by - MrMadMan on May 23, 2010 11:12:27 AM]
  I changed your "code" tags to "source" tags.  I assume you would like to disable the vsync so you see how many frames pre second you are getting.  I do not know if you can disable the vsync when using the BufferStrategy, but it would be a good thing to know.If you figure out a way, or if anyone else has figured this, please let us know.   ;Quote:Original post by Glass_KnifeI changed your "code" tags to "source" tags.  I assume you would like to disable the vsync so you see how many frames pre second you are getting.  I do not know if you can disable the vsync when using the BufferStrategy, but it would be a good thing to know.If you figure out a way, or if anyone else has figured this, please let us know.Thanks for the help with the source tags. I'll try to remember that. I've googled this matter a lot and have yet to come up with something useful. I guess I will have to skip the buffering while testing.But how do i render my game in full screen without the use of buffer strategies? I know this will make it flicker a lot, but it should still work fine for performance testing, right?   