-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplayManager.java
More file actions
44 lines (34 loc) · 1 KB
/
DisplayManager.java
File metadata and controls
44 lines (34 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package renderEngine;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.*;
public class DisplayManager
{
//private static final int WIDTH = 1280;
//private static final int HEIGHT = 720;
private static final int WIDTH = 852;
private static final int HEIGHT = 480;
private static final int FPS_CAP = 120;
public static void createDisplay()
{
ContextAttribs attribs = new ContextAttribs(3,2);
attribs.withForwardCompatible(true);
attribs.withProfileCore(true);
try {
Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
Display.create(new PixelFormat(), attribs);
Display.setTitle("Hexers");
} catch (LWJGLException e) {
e.printStackTrace();
}
GL11.glViewport(0, 0, WIDTH, HEIGHT);
}
public static void updateDisplay()
{
Display.sync(FPS_CAP);
Display.update();
}
public static void closeDisplay()
{
Display.destroy();
}
}