내 프로그램을 다음과 같이 전체 화면으로 만드는 데 문제가있었습니다.
Display.setFullscreen(true);
...하지만 다음 답변이 도움이되었습니다. LWJGL Fullscreen not working
이 대답은 사용 가능한 모든 DisplayMode를 반복하고 호환되는 것을 찾을 것을 제안했습니다. 현재 가지고있는 코드는 다음과 같습니다.
if (!fullscreen)
Display.setDisplayMode(new DisplayMode(width, height));
else {
DisplayMode displayMode = null;
DisplayMode[] modes = Display.getAvailableDisplayModes();
ArrayList<String> compatibleModes = new ArrayList<String>();
for (int i = 0; i < modes.length; i++) {
System.out.println("Mode "+i+": "+modes[i].toString());
if (modes[i].getWidth() == width && modes[i].getHeight() == height
&& modes[i].isFullscreenCapable()) {
displayMode = modes[i];
compatibleModes.add(modes[i].toString());
}
}
if(compatibleModes.isEmpty()){
System.out.println("No compatible display modes!");
System.exit(-1);
}
System.out.println("Display Modes :: "+modes.length+" Total :: "+compatibleModes.size()+" Compatible :: "+displayMode.toString()+" Selected");
for (String string : compatibleModes) {
System.out.println("Compatible: "+string);
}
Display.setDisplayMode(displayMode);
Display.setFullscreen(true);
}
Display.create(new PixelFormat(), attribs);
내 콘솔 로그에 다음이 표시됩니다. (명확성을 위해 관련없는 모드를 생략했습니다.)
Mode 0: 1920 x 1080 x 32 @24Hz
Mode 5: 1920 x 1080 x 32 @23Hz
Mode 18: 1280 x 1024 x 32 @60Hz
Mode 19: 1920 x 1080 x 32 @59Hz
Mode 20: 1920 x 1080 x 32 @60Hz
Mode 21: 1920 x 1080 x 32 @50Hz
Mode 23: 1920 x 1200 x 32 @59Hz
Mode 25: 1920 x 1200 x 32 @60Hz
Mode 26: 1768 x 992 x 32 @24Hz
Mode 28: 1920 x 1440 x 32 @59Hz
Mode 29: 2560 x 1440 x 32 @59Hz <-- I have a 1440p monitor, why is this NOT compatible?
Mode 30: 1280 x 800 x 32 @60Hz
Mode 31: 1920 x 1440 x 32 @60Hz
Mode 49: 1600 x 1200 x 32 @59Hz
Mode 50: 1600 x 1200 x 32 @60Hz
Display Modes :: 53 Total :: 3 Compatible :: 1280 x 720 x 32 @60Hz Selected
Compatible: 1280 x 720 x 32 @50Hz
Compatible: 1280 x 720 x 32 @59Hz
Compatible: 1280 x 720 x 32 @60Hz
전체 화면 게임은 내 컴퓨터에서 1440p로 제대로 작동하므로 모드를 사용할 수없는 이유를 잘 모르겠습니다. 프로그램을 실행하면 화면이 매우 흐릿합니다.
이 문제를 어떻게 해결할 수 있습니까? 미리 감사드립니다.
어쩌면 사용해보십시오
Display.setDisplayModeAndFullscreen(Display.getDesktopDisplayMode());
1440p 문제를 해결하지 못하더라도 전체 화면 디스플레이 모드를 얻는 훨씬 깔끔한 방법입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다