FreeWRL/FreeX3D  3.0.0
Component_Texturing.c
1 /*
2 
3 
4 X3D Texturing Component
5 
6 */
7 
8 
9 /****************************************************************************
10  This file is part of the FreeWRL/FreeX3D Distribution.
11 
12  Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
13 
14  FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
15  it under the terms of the GNU Lesser Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  FreeWRL/FreeX3D is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
26 ****************************************************************************/
27 
28 
29 
30 #include <config.h>
31 #include <system.h>
32 #include <display.h>
33 #include <internal.h>
34 
35 #include <libFreeWRL.h>
36 
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"
43 
44 
45 void render_PixelTexture (struct X3D_PixelTexture *node) {
46  loadTextureNode(X3D_NODE(node),NULL);
47  gglobal()->RenderFuncs.textureStackTop=1; /* not multitexture - should have saved to boundTextureStack[0] */
48 }
49 
50 void render_ImageTexture (struct X3D_ImageTexture *node) {
51  /* printf ("render_ImageTexture, global Transparency %f\n",getAppearanceProperties()->transparency); */
52  loadTextureNode(X3D_NODE(node),NULL);
53  gglobal()->RenderFuncs.textureStackTop=1; /* not multitexture - should have saved to boundTextureStack[0] */
54 }
55 
56 void render_MultiTexture (struct X3D_MultiTexture *node) {
57  loadMultiTexture(node);
58 }
59 void render_AudioClip(struct X3D_AudioClip * node);
60 void render_MovieTexture (struct X3D_MovieTexture *node) {
61  //july 2016 movietexture fields put in same order as audioclip, so can up-caste and delegate
62  struct X3D_AudioClip *anode = (struct X3D_AudioClip*)node;
63  render_AudioClip(anode); //just checks if loaded, schedules if not
64  loadTextureNode(X3D_NODE(node),NULL);
65  gglobal()->RenderFuncs.textureStackTop=1; /* not multitexture - should have saved to boundTextureStack[0] */
66 
67 }
68