2 |
|
|
3 |
package gzz.gfx.gl; |
package gzz.gfx.gl; |
4 |
import gzz.mem.*; |
import gzz.mem.*; |
5 |
|
import gzz.client.*; |
6 |
|
|
7 |
/** A memory consumer for a texture which is loaded from a set of files |
/** A memory consumer for a texture which is loaded from a set of files |
8 |
* (of different resolutions) at request. |
* (of different resolutions) at request. |
9 |
*/ |
*/ |
10 |
public abstract class FileSetTextureMemoryConsumer extends TextureMemoryConsumer { |
public abstract class FileSetTextureMemoryConsumer extends TextureMemoryConsumer { |
11 |
|
|
12 |
|
Runnable r_runTexImage = new Runnable() { |
13 |
|
public void run() { runTexImage(); } |
14 |
|
}; |
15 |
|
Runnable r_runRequest = new Runnable() { |
16 |
|
public void run() { runRequest(); } |
17 |
|
}; |
18 |
|
|
19 |
|
static final int STATE_IDLE = 0, |
20 |
|
STATE_REQUESTED = 1, |
21 |
|
STATE_TEXIMAGING = 2; |
22 |
|
|
23 |
public class File { |
public class File { |
24 |
int w, h; |
int w, h; |
25 |
String name; |
String name; |
26 |
} |
} |
27 |
|
|
28 |
|
int state; |
29 |
|
|
30 |
|
private void runRequest() { |
31 |
|
state = STATE_TEXIMAGING; |
32 |
|
// High priority, we're using a lot of memory |
33 |
|
AbstractUpdateManager.doWhenIdle(r_runRequest, -10); |
34 |
|
} |
35 |
|
|
36 |
|
private void runTexImage() { |
37 |
|
} |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
} |
} |