View Javadoc
1   package org.newdawn.slick.opengl;
2   
3   /**
4    * The description of a texture loaded by the TextureLoader utility
5    * 
6    * @author kevin
7    */
8   public interface Texture {
9   
10      /**
11       * Check if the texture has alpha
12       *
13       * @return True if the texture has alpha
14       */
15      public boolean hasAlpha();
16  
17      /**
18       * Get the reference from which this texture was loaded
19       *
20       * @return The reference from which this texture was loaded
21       */
22      public String getTextureRef();
23  
24      /**
25       * Bind the  GL context to a texture
26       */
27      public void bind();
28  
29      /**
30       * Get the height of the original image (in pixels; e.g. 200px)
31       *
32       * @return The height of the original image
33       */
34      public int getImageHeight();
35  
36      /**
37       * Get the width of the original image (in pixels; e.g. 200px)
38       *
39       * @return The width of the original image
40       */
41      public int getImageWidth();
42  
43      /**
44       * Get the height of the physical texture (the normalized value
45       * between 0.0 and 1.0, attained by dividing the image height
46       * by the texture height).
47       *
48       * @return The height of physical texture
49       */
50      public float getHeight();
51  
52      /**
53       * Get the width of the physical texture (the normalized value
54       * between 0.0 and 1.0, attained by dividing the image width
55       * by the texture width).
56       *
57       * @return The width of physical texture
58       */
59      public float getWidth();
60  
61      /**
62       * Get the power-of-two height of the actual texture (in pixels, e.g. 256)
63       *
64       * @return The height of the actual texture
65       */
66      public int getTextureHeight();
67  
68      /**
69       * Get the power-of-two width of the actual texture (in pixels, e.g. 256)
70       *
71       * @return The width of the actual texture
72       */
73      public int getTextureWidth();
74  
75      /**
76       * Destroy the texture reference
77       */
78      public void release();
79  
80      /**
81       * Get the OpenGL texture ID for this texture
82       *
83       * @return The OpenGL texture ID
84       */
85      public int getTextureID();
86  
87      /**
88       * Get the pixel data from the card for this texture
89       *
90       * @return The texture data from the card for this texture
91       */
92      public byte[] getTextureData();
93  
94      /**
95       * Apply a given texture filter to the texture
96       *
97       * @param textureFilter The texture filter to apply (GL_LINEAR, GL_NEAREST, etc..)
98       */
99      public void setTextureFilter(int textureFilter);
100 
101 }