Mercurial > hg > Game > Cerium
view Renderer/Engine/TextureHash.h @ 2069:26aa08c9a1de draft default tip
cuda example fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 12 Feb 2017 10:04:55 +0900 |
parents | b8adf4e95e96 |
children |
line wrap: on
line source
#ifndef INCLUDED_TEXTURE_HASH #define INCLUDED_TEXTURE_HASH const int TABLE_SIZE = 9192; //8192 + 1000 struct hashtable{ int tx_id; char* key; }; class TextureHash { public: int id_count; hashtable *table; TextureHash(void); ~TextureHash(void); int hash_function(const unsigned char* image_name); int hash_regist(const char* image_name, int &tx_id); int sg_hash_regist(const char* image_name, int &tx_id); int get_sgid(const char* key); void remove(int id) { table[id].tx_id = -1; } }; #endif