FreeWRL/FreeX3D  3.0.0
RenderFuncs.h
1 /*
2 
3 
4 Proximity sensor macro.
5 
6 */
7 
8 /****************************************************************************
9  This file is part of the FreeWRL/FreeX3D Distribution.
10 
11  Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
12 
13  FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
14  it under the terms of the GNU Lesser Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  FreeWRL/FreeX3D is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
25 ****************************************************************************/
26 
27 
28 #ifndef __FREEWRL_SCENEGRAPH_RENDERFUNCS_H__
29 #define __FREEWRL_SCENEGRAPH_RENDERFUNCS_H__
30 
31 void enableGlobalShader(s_shader_capabilities_t *);
32 void resetGlobalShader(void);
33 void finishedWithGlobalShader(void);
34 
35 /* trat: test if a ratio is reasonable */
36 #define TRAT(a) ((a) > 0 && ((a) < gglobal()->RenderFuncs.hitPointDist || gglobal()->RenderFuncs.hitPointDist < 0))
37 
38 /* structure for rayhits */
39 struct currayhit {
40  struct X3D_Node *hitNode; /* What node hit at that distance? */
41  GLDOUBLE modelMatrix[16]; /* What the matrices were at that node */
42  GLDOUBLE projMatrix[16];
43  GLDOUBLE justModel[16]; //view taken off, so transfroms from geometry-local to World
44 };
45 
46 void get_current_ray(struct point_XYZ* p1, struct point_XYZ* p2);
47 extern struct point_XYZ r1, r2; /* in VRMLC.pm */
48 
49 
50 /* function protos */
51 int nextlight(void);
52 void render_node(struct X3D_Node *node);
53 
54 struct X3D_Anchor *AnchorsAnchor();
55 void setAnchorsAnchor(struct X3D_Anchor* anchor);
56 
57 void clearLightTable();
58 
59 void setLightState(GLint light, int status);
60 void setLightType(GLint light, int type);
61 //JAS void saveLightState2(int *ls);
62 //JAS void restoreLightState2(int ls);
63 void setLightChangedFlag(GLint light);
64 void fwglLightfv (int light, int pname, GLfloat *params);
65 void fwglLightf (int light, int pname, GLfloat param);
66 void initializeLightTables(void);
67 void sendAttribToGPU(int myType, int mySize, int xtype, int normalized, int stride, float *pointer, int, char*, int);
68 void sendArraysToGPU (int mode, int first, int count);
69 void sendBindBufferToGPU (GLenum target, GLuint buffer,char *, int);
70 void sendElementsToGPU (int mode, int count, unsigned short *indices);
71 void render_hier(struct X3D_Node *p, int rwhat);
72 void sendLightInfo (s_shader_capabilities_t *me);
73 void restoreGlobalShader();
74 
75 
76 typedef struct ivec4 {int X; int Y; int W; int H;} ivec4;
77 typedef struct ivec2 {int X; int Y;} ivec2;
78 void pushviewport(Stack *vpstack, ivec4 vp);
79 void popviewport(Stack *vpstack);
80 void setcurrentviewport(Stack *_vpstack);
81 int currentviewportvisible(Stack *vpstack);
82 
83 typedef struct usehit {
84  struct X3D_Node *node;
85  double mvm[16];
86  void *userdata;
87 } usehit;
88 void usehit_add(struct X3D_Node *node, double *modelviewmatrix);
89 void usehit_add2(struct X3D_Node *node, double *modelviewmatrix, void *userdata);
90 usehit * usehit_next(struct X3D_Node *node, usehit* lasthit);
91 void usehit_clear();
92 void usehitB_add(struct X3D_Node *node, double *modelviewmatrix);
93 void usehitB_add2(struct X3D_Node *node, double *modelviewmatrix, void *userdata);
94 usehit * usehitB_next(struct X3D_Node *node, usehit* lasthit);
95 Stack *getUseHitBStack();
96 void usehitB_clear();
97 bool setupShaderB();
98 #endif /* __FREEWRL_SCENEGRAPH_RENDERFUNCS_H__ */
Definition: Vector.h:36
Definition: display.c:66
Definition: display.c:65