Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/TextureHash.h @ 1047:6a80ca9a65d9
broken texure ( h/w != 2^n ) protection
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 08 Dec 2010 05:38:45 +0900 |
parents | 735f76483bb2 |
children |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_TEXTURE_HASH |
2 #define INCLUDED_TEXTURE_HASH | |
3 | |
4 const int TABLE_SIZE = 8192; | |
5 | |
6 struct hashtable{ | |
7 int tx_id; | |
8 char* key; | |
9 }; | |
10 | |
11 class TextureHash { | |
12 public: | |
13 hashtable *table; | |
14 | |
15 TextureHash(void); | |
16 ~TextureHash(void); | |
507 | 17 int hash_function(const char* image_name); |
18 int hash_regist(const char* image_name, int &tx_id); | |
1047
6a80ca9a65d9
broken texure ( h/w != 2^n ) protection
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
507
diff
changeset
|
19 void remove(int id) { table[id].tx_id = -1; } |
283 | 20 }; |
21 | |
22 #endif |