-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathAWTUtils.java
More file actions
26 lines (21 loc) · 709 Bytes
/
AWTUtils.java
File metadata and controls
26 lines (21 loc) · 709 Bytes
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
package com.jme3.system;
import com.jme3.texture.FrameBuffer;
import com.jme3.texture.Image;
import com.jme3.texture.FrameBuffer.FrameBufferTarget;
public class AWTUtils {
/**
* Returns a Frame buffer.
*
* @param width
* @param height
* @param samples
* @return
*/
public static FrameBuffer getFrameBuffer(int width, int height, int samples) {
FrameBuffer frameBuffer = new FrameBuffer(width, height, samples);
frameBuffer.addColorTarget(FrameBufferTarget.newTarget(Image.Format.RGBA8));
frameBuffer.setDepthTarget(FrameBufferTarget.newTarget(Image.Format.Depth));
frameBuffer.setSrgb(true);
return frameBuffer;
}
}