1 package org.newdawn.slick.opengl;
2
3 import java.nio.ByteBuffer;
4
5 import org.lwjgl.BufferUtils;
6
7 import javax.annotation.Nonnull;
8
9
10
11
12
13
14 public class EmptyImageData implements ImageData {
15
16 private final int width;
17
18 private final int height;
19
20
21
22
23
24
25
26 public EmptyImageData(int width, int height) {
27 this.width = width;
28 this.height = height;
29 }
30
31
32
33
34 @Nonnull
35 public Format getFormat() {
36 return Format.RGBA;
37 }
38
39
40
41
42 public int getHeight() {
43 return height;
44 }
45
46
47
48
49 public ByteBuffer getImageBufferData() {
50 return BufferUtils.createByteBuffer(getTexWidth() * getTexHeight() * 4);
51 }
52
53
54
55
56 public int getTexHeight() {
57 return InternalTextureLoader.get2Fold(height);
58 }
59
60
61
62
63 public int getTexWidth() {
64 return InternalTextureLoader.get2Fold(width);
65 }
66
67
68
69
70 public int getWidth() {
71 return width;
72 }
73
74 }