35 #include <libFreeWRL.h>
37 #include "../vrml_parser/Structs.h"
38 #include "../main/headers.h"
39 #include "../opengl/OpenGL_Utils.h"
40 #include "../opengl/Textures.h"
41 #include "../scenegraph/Component_Shape.h"
42 #include "../scenegraph/RenderFuncs.h"
171 switch(node->_nodeType){
172 case NODE_PixelTexture3D:
173 case NODE_ComposedTexture3D:
174 case NODE_ImageTexture3D:
183 loadTextureNode(X3D_NODE(node),NULL);
184 gglobal()->RenderFuncs.textureStackTop=1;
189 loadTextureNode(X3D_NODE(node),NULL);
190 gglobal()->RenderFuncs.textureStackTop=1;
195 if(node && node->_nodeType == NODE_ComposedTexture3D){
212 int nx, ny, nfound, nsamesize;
213 nfound = nsamesize = 0;
214 for(i=0;i<tex->n;i++){
217 tti = getTableTableFromTextureNode(tex->p[i]);
219 if(tti->status == TEX_LOADED){
222 nx = tti->x; ny = tti->y;
225 if(tti->x == nx && tti->y == ny) nsamesize++;
231 if(nsamesize == nfound && nfound == tex->n){
234 printf(
"ComposedTexture3D all same size textures n %d x %d y %d\n",tex->n,nx,ny);
240 printf(
"ComposedTexture3D not all same size textures \n");
245 gglobal()->RenderFuncs.textureStackTop = 0;
246 for(i=0;i<min(tex->n,MAX_MULTITEXTURE);i++){
249 loadTextureNode(X3D_NODE(tex->p[i]),NULL);
250 allLoaded = allLoaded && getTableTableFromTextureNode(X3D_NODE(tex->p[i]))->status >= TEX_LOADED;
251 gglobal()->RenderFuncs.textureStackTop++;
258 tti = getTableTableFromTextureNode(X3D_NODE(node));
259 tti->status = max(TEX_NEEDSBINDING, tti->status);
260 loadTextureNode(X3D_NODE(node),NULL);