Mercurial > hg > Members > kono > Cerium
diff TaskManager/Test/test_render/spe/Set_Texture.cpp @ 109:5c194c71eca8
Cerium cvs version
author | gongo@gendarme.local |
---|---|
date | Wed, 12 Nov 2008 17:39:33 +0900 |
parents | |
children | a52e193f9a42 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/spe/Set_Texture.cpp Wed Nov 12 17:39:33 2008 +0900 @@ -0,0 +1,25 @@ +#include <string.h> +#include "Set_Texture.h" +#include "texture.h" + +SchedDefineTask(SetTexture); + +//texture をglobal 領域にコピーするタスク +int +SetTexture::run(void *rbuf, void *wbuf) +{ + void *src[3]; + + src[0] = get_input(rbuf, 0); + src[1] = get_input(rbuf, 1); + src[2] = get_input(rbuf, 2); + + //タスクが共有できる領域確保 + void *data = global_alloc(TEXTURE_ID, MAX_LOAD_SIZE*3); + + memcpy(data, src[0], MAX_LOAD_SIZE); + memcpy((void*)((int)data + MAX_LOAD_SIZE), src[1], MAX_LOAD_SIZE); + memcpy((void*)((int)data + MAX_LOAD_SIZE*2), src[2], MAX_LOAD_SIZE); + + return 0; +}