Changeset 1001 for GTP/trunk/Lib/Vis
- Timestamp:
- 06/05/06 23:14:04 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 8 added
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj
r931 r1001 104 104 Name="VCLinkerTool" 105 105 IgnoreImportLibrary="TRUE" 106 AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplibd.lib Preprocessor.lib xerces-c_2.lib devil.lib qtmain.lib QtOpenGL4.lib QtCored4.lib QtGuid4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib "106 AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplibd.lib Preprocessor.lib xerces-c_2.lib devil.lib qtmain.lib QtOpenGL4.lib QtCored4.lib QtGuid4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib glew32.lib glew32s.lib" 107 107 OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll" 108 108 Version="0.99" -
GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj
r971 r1001 168 168 </File> 169 169 <File 170 RelativePath="..\src\glInterface.h"> 171 </File> 172 <File 170 173 RelativePath="..\src\GlRenderer.cpp"> 171 174 </File> … … 216 219 </File> 217 220 <File 221 RelativePath="..\src\LogManager.cpp"> 222 </File> 223 <File 224 RelativePath="..\src\LogManager.h"> 225 </File> 226 <File 218 227 RelativePath="..\src\Material.cpp"> 219 228 </File> … … 253 262 <File 254 263 RelativePath="..\src\MutualVisibility.h"> 264 </File> 265 <File 266 RelativePath="..\src\OcclusionQuery.cpp"> 267 </File> 268 <File 269 RelativePath="..\src\OcclusionQuery.h"> 255 270 </File> 256 271 <File … … 360 375 </File> 361 376 <File 377 RelativePath="..\src\ResourceManager.h"> 378 </File> 379 <File 362 380 RelativePath="..\src\RssPreprocessor.cpp"> 363 381 </File> -
GTP/trunk/Lib/Vis/Preprocessing/scripts/TestPreprocessor.vcproj
r997 r1001 80 80 <Tool 81 81 Name="VCLinkerTool" 82 AdditionalDependencies="xerces-c_2.lib zdll.lib zziplib.lib devil.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib QtCore4.lib QtOpenGL4.lib"82 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib QtCore4.lib QtOpenGL4.lib" 83 83 OutputFile="$(OutDir)/Preprocessor.exe" 84 84 LinkIncremental="1" -
GTP/trunk/Lib/Vis/Preprocessing/scripts/atlanta.env
r942 r1001 247 247 samplingType box 248 248 histogram true 249 histo Passes5000249 histoStepSize 5000 250 250 } 251 251 -
GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h
r863 r1001 38 38 typedef vector<ViewCell *> ViewCellContainer; 39 39 40 /** Container for ViewCell pointers primarily for the use within the kDTree and41 BSP hierarchies */42 //typedef vector<MeshInstance *> MeshInstanceContainer;43 44 40 /** Container for HierarchyNodes pointers primarily for the use within the kDTree and 45 BSP hierarchies */46 41 BSP hierarchies 42 */ 47 43 typedef vector<HierarchyNode *> NodeContainer; 48 44 -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r997 r1001 1168 1168 "1000"); 1169 1169 1170 RegisterOption("RenderSampler.visibleThreshold", 1171 optInt, 1172 "render_sampler_visible_threshold=", 1173 "0"); 1174 1175 1170 1176 RegisterOption("RenderSampler.useOcclusionQueries", 1171 1177 optBool, … … 1178 1184 "100000"); 1179 1185 1180 RegisterOption("VssPreprocessor.testBeamSampling", optBool, "beam_sampling", "false"); 1186 RegisterOption("VssPreprocessor.testBeamSampling", 1187 optBool, 1188 "beam_sampling", 1189 "false"); 1181 1190 1182 1191 RegisterOption("VssPreprocessor.vssSamples", -
GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp
r970 r1001 288 288 for (int i = 0; i < limit; ++i) 289 289 { 290 Intersectable *object = objects[i]; //*it;290 Intersectable *object = objects[i]; 291 291 Mesh *mesh = NULL; 292 292 … … 299 299 mesh = dynamic_cast<ViewCell *>(object)->GetMesh(); 300 300 break; 301 // TODO: handle transformed mesh instances 301 case Intersectable::TRANSFORMED_MESH_INSTANCE: 302 { 303 TransformedMeshInstance *mi = 304 dynamic_cast<TransformedMeshInstance *>(object); 305 306 if (!mi->GetMesh()) 307 break; 308 309 mesh = new Mesh(*mi->GetMesh()); 310 311 Matrix4x4 m; 312 mi->GetWorldTransform(m); 313 mesh->ApplyTransformation(m); 314 315 break; 316 } 302 317 default: 303 318 Debug << "intersectable type not supported" << endl; … … 309 324 mBox.Include(object->GetBox()); // add to BSP tree aabb 310 325 AddMeshToPolygons(mesh, polys, NULL); 326 327 // cleanup 328 if (object->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 329 DEL_PTR(mesh); 311 330 } 312 331 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GL/glew.h
r498 r1001 1 1 /* 2 2 ** The OpenGL Extension Wrangler Library 3 ** Copyright (C) 200 4, 2003, 2002, Milan Ikits <milan ikits[at]ieee org>4 ** Copyright (C) 200 4, 2003, 2002, Marcelo E. Magallon <mmagallo[at]debian org>3 ** Copyright (C) 2002-2006, Milan Ikits <milan ikits[]ieee org> 4 ** Copyright (C) 2002-2006, Marcelo E. Magallon <mmagallo[]debian org> 5 5 ** Copyright (C) 2002, Lev Povalahev 6 6 ** All rights reserved. … … 78 78 #define __GLEXT_H_ 79 79 #define __gl_ATI_h_ 80 #define __GLX_glx_h__ 81 82 #if defined(_WIN32) 80 81 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) 83 82 84 83 /* … … 92 91 # if defined(__CYGWIN__) || defined(__MINGW32__) 93 92 # define APIENTRY __stdcall 94 # elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) 93 # elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) 95 94 # define APIENTRY __stdcall 96 95 # else … … 120 119 #endif 121 120 /* <ctype.h> */ 122 #if defined(_MSC_VER) && !defined(_WCHAR_T_DEFINED)121 #if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) 123 122 typedef unsigned short wchar_t; 124 123 # define _WCHAR_T_DEFINED … … 204 203 #define GL_VERSION_1_1 1 205 204 205 #if defined(__APPLE__) 206 typedef unsigned long GLenum; 207 typedef unsigned long GLbitfield; 208 typedef unsigned long GLuint; 209 typedef long GLint; 210 typedef long GLsizei; 211 #else 206 212 typedef unsigned int GLenum; 213 typedef unsigned int GLbitfield; 214 typedef unsigned int GLuint; 215 typedef int GLint; 216 typedef int GLsizei; 217 #endif 207 218 typedef unsigned char GLboolean; 208 typedef unsigned int GLbitfield;209 219 typedef signed char GLbyte; 210 220 typedef short GLshort; 211 typedef int GLint;212 typedef int GLsizei;213 221 typedef unsigned char GLubyte; 214 222 typedef unsigned short GLushort; 215 typedef unsigned int GLuint;216 223 typedef float GLfloat; 217 224 typedef float GLclampf; … … 1580 1587 typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); 1581 1588 typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); 1582 typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint params);1589 typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); 1583 1590 typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); 1584 1591 typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); … … 1615 1622 #define GL_VERSION_2_0 1 1616 1623 1624 #define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION 1625 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 1626 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 1627 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 1628 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 1629 #define GL_CURRENT_VERTEX_ATTRIB 0x8626 1630 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 1631 #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 1632 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 1633 #define GL_STENCIL_BACK_FUNC 0x8800 1634 #define GL_STENCIL_BACK_FAIL 0x8801 1635 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 1636 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 1637 #define GL_MAX_DRAW_BUFFERS 0x8824 1638 #define GL_DRAW_BUFFER0 0x8825 1639 #define GL_DRAW_BUFFER1 0x8826 1640 #define GL_DRAW_BUFFER2 0x8827 1641 #define GL_DRAW_BUFFER3 0x8828 1642 #define GL_DRAW_BUFFER4 0x8829 1643 #define GL_DRAW_BUFFER5 0x882A 1644 #define GL_DRAW_BUFFER6 0x882B 1645 #define GL_DRAW_BUFFER7 0x882C 1646 #define GL_DRAW_BUFFER8 0x882D 1647 #define GL_DRAW_BUFFER9 0x882E 1648 #define GL_DRAW_BUFFER10 0x882F 1649 #define GL_DRAW_BUFFER11 0x8830 1650 #define GL_DRAW_BUFFER12 0x8831 1651 #define GL_DRAW_BUFFER13 0x8832 1652 #define GL_DRAW_BUFFER14 0x8833 1653 #define GL_DRAW_BUFFER15 0x8834 1654 #define GL_BLEND_EQUATION_ALPHA 0x883D 1655 #define GL_POINT_SPRITE 0x8861 1656 #define GL_COORD_REPLACE 0x8862 1657 #define GL_MAX_VERTEX_ATTRIBS 0x8869 1658 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A 1659 #define GL_MAX_TEXTURE_COORDS 0x8871 1660 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 1661 #define GL_FRAGMENT_SHADER 0x8B30 1662 #define GL_VERTEX_SHADER 0x8B31 1663 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 1664 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A 1665 #define GL_MAX_VARYING_FLOATS 0x8B4B 1666 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C 1667 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D 1668 #define GL_SHADER_TYPE 0x8B4F 1669 #define GL_FLOAT_VEC2 0x8B50 1670 #define GL_FLOAT_VEC3 0x8B51 1671 #define GL_FLOAT_VEC4 0x8B52 1672 #define GL_INT_VEC2 0x8B53 1673 #define GL_INT_VEC3 0x8B54 1674 #define GL_INT_VEC4 0x8B55 1675 #define GL_BOOL 0x8B56 1676 #define GL_BOOL_VEC2 0x8B57 1677 #define GL_BOOL_VEC3 0x8B58 1678 #define GL_BOOL_VEC4 0x8B59 1679 #define GL_FLOAT_MAT2 0x8B5A 1680 #define GL_FLOAT_MAT3 0x8B5B 1681 #define GL_FLOAT_MAT4 0x8B5C 1682 #define GL_SAMPLER_1D 0x8B5D 1683 #define GL_SAMPLER_2D 0x8B5E 1684 #define GL_SAMPLER_3D 0x8B5F 1685 #define GL_SAMPLER_CUBE 0x8B60 1686 #define GL_SAMPLER_1D_SHADOW 0x8B61 1687 #define GL_SAMPLER_2D_SHADOW 0x8B62 1688 #define GL_DELETE_STATUS 0x8B80 1689 #define GL_COMPILE_STATUS 0x8B81 1690 #define GL_LINK_STATUS 0x8B82 1691 #define GL_VALIDATE_STATUS 0x8B83 1692 #define GL_INFO_LOG_LENGTH 0x8B84 1693 #define GL_ATTACHED_SHADERS 0x8B85 1694 #define GL_ACTIVE_UNIFORMS 0x8B86 1695 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 1696 #define GL_SHADER_SOURCE_LENGTH 0x8B88 1697 #define GL_ACTIVE_ATTRIBUTES 0x8B89 1698 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A 1699 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B 1700 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C 1701 #define GL_CURRENT_PROGRAM 0x8B8D 1702 #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 1703 #define GL_LOWER_LEFT 0x8CA1 1704 #define GL_UPPER_LEFT 0x8CA2 1705 #define GL_STENCIL_BACK_REF 0x8CA3 1706 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 1707 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 1708 1709 typedef char GLchar; 1710 1711 typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); 1712 typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); 1713 typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); 1714 typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); 1715 typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); 1716 typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); 1717 typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); 1718 typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); 1719 typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); 1720 typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); 1721 typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); 1722 typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); 1723 typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); 1724 typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); 1725 typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); 1726 typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); 1727 typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); 1728 typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); 1729 typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); 1730 typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source); 1731 typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); 1732 typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLint programObj, const GLchar* name); 1733 typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); 1734 typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); 1735 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid*); 1736 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); 1737 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); 1738 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); 1739 typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); 1740 typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); 1741 typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); 1742 typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); 1743 typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); 1744 typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); 1745 typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); 1746 typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); 1747 typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); 1748 typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); 1749 typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); 1750 typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); 1751 typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); 1752 typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); 1753 typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); 1754 typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); 1755 typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); 1756 typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); 1757 typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); 1758 typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); 1759 typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); 1760 typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); 1761 typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); 1762 typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 1763 typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 1764 typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); 1765 typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); 1766 typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); 1767 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); 1768 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); 1769 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); 1770 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); 1771 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); 1772 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); 1773 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); 1774 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); 1775 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); 1776 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); 1777 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); 1778 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); 1779 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); 1780 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); 1781 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); 1782 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); 1783 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); 1784 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); 1785 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); 1786 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); 1787 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); 1788 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); 1789 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); 1790 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); 1791 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); 1792 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); 1793 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); 1794 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); 1795 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 1796 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); 1797 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); 1798 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); 1799 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); 1800 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); 1801 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); 1802 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); 1803 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); 1804 1805 #define glAttachShader GLEW_GET_FUN(__glewAttachShader) 1806 #define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) 1807 #define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) 1808 #define glCompileShader GLEW_GET_FUN(__glewCompileShader) 1809 #define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) 1810 #define glCreateShader GLEW_GET_FUN(__glewCreateShader) 1811 #define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) 1812 #define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) 1813 #define glDetachShader GLEW_GET_FUN(__glewDetachShader) 1814 #define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) 1815 #define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) 1816 #define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) 1817 #define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) 1818 #define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) 1819 #define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) 1820 #define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) 1821 #define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) 1822 #define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) 1823 #define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) 1824 #define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) 1825 #define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) 1826 #define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) 1827 #define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) 1828 #define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) 1829 #define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) 1830 #define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) 1831 #define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) 1832 #define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) 1833 #define glIsProgram GLEW_GET_FUN(__glewIsProgram) 1834 #define glIsShader GLEW_GET_FUN(__glewIsShader) 1835 #define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) 1836 #define glShaderSource GLEW_GET_FUN(__glewShaderSource) 1837 #define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) 1838 #define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) 1839 #define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) 1840 #define glUniform1f GLEW_GET_FUN(__glewUniform1f) 1841 #define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) 1842 #define glUniform1i GLEW_GET_FUN(__glewUniform1i) 1843 #define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) 1844 #define glUniform2f GLEW_GET_FUN(__glewUniform2f) 1845 #define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) 1846 #define glUniform2i GLEW_GET_FUN(__glewUniform2i) 1847 #define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) 1848 #define glUniform3f GLEW_GET_FUN(__glewUniform3f) 1849 #define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) 1850 #define glUniform3i GLEW_GET_FUN(__glewUniform3i) 1851 #define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) 1852 #define glUniform4f GLEW_GET_FUN(__glewUniform4f) 1853 #define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) 1854 #define glUniform4i GLEW_GET_FUN(__glewUniform4i) 1855 #define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) 1856 #define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) 1857 #define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) 1858 #define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) 1859 #define glUseProgram GLEW_GET_FUN(__glewUseProgram) 1860 #define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) 1861 #define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) 1862 #define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) 1863 #define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) 1864 #define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) 1865 #define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) 1866 #define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) 1867 #define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) 1868 #define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) 1869 #define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) 1870 #define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) 1871 #define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) 1872 #define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) 1873 #define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) 1874 #define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) 1875 #define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) 1876 #define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) 1877 #define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) 1878 #define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) 1879 #define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) 1880 #define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) 1881 #define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) 1882 #define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) 1883 #define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) 1884 #define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) 1885 #define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) 1886 #define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) 1887 #define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) 1888 #define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) 1889 #define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) 1890 #define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) 1891 #define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) 1892 #define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) 1893 #define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) 1894 #define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) 1895 #define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) 1896 #define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) 1897 #define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) 1898 1617 1899 #define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) 1618 1900 … … 1747 2029 1748 2030 #endif /* GL_APPLE_float_pixels */ 2031 2032 /* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ 2033 2034 #ifndef GL_APPLE_pixel_buffer 2035 #define GL_APPLE_pixel_buffer 1 2036 2037 #define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 2038 2039 #define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) 2040 2041 #endif /* GL_APPLE_pixel_buffer */ 1749 2042 1750 2043 /* ------------------------ GL_APPLE_specular_vector ----------------------- */ … … 2330 2623 #endif /* GL_ARB_occlusion_query */ 2331 2624 2625 /* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ 2626 2627 #ifndef GL_ARB_pixel_buffer_object 2628 #define GL_ARB_pixel_buffer_object 1 2629 2630 #define GL_PIXEL_PACK_BUFFER_ARB 0x88EB 2631 #define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC 2632 #define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED 2633 #define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF 2634 2635 #define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) 2636 2637 #endif /* GL_ARB_pixel_buffer_object */ 2638 2332 2639 /* ------------------------ GL_ARB_point_parameters ------------------------ */ 2333 2640 … … 2403 2710 2404 2711 typedef char GLcharARB; 2405 typedef int GLhandleARB;2712 typedef unsigned int GLhandleARB; 2406 2713 2407 2714 typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); … … 2715 3022 #define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 2716 3023 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 3024 #define GL_SAMPLER_2D_RECT_ARB 0x8B63 3025 #define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 2717 3026 2718 3027 #define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) … … 2729 3038 #define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 2730 3039 #define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 3040 3041 typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); 3042 typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); 3043 typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); 3044 typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); 3045 3046 #define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) 3047 #define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) 3048 #define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) 3049 #define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) 2731 3050 2732 3051 #define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) … … 3342 3661 #define GL_SWIZZLE_STR_DR_ATI 0x8978 3343 3662 #define GL_SWIZZLE_STQ_DQ_ATI 0x8979 3663 #define GL_SWIZZLE_STRQ_ATI 0x897A 3664 #define GL_SWIZZLE_STRQ_DQ_ATI 0x897B 3344 3665 3345 3666 typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); … … 4107 4428 #endif /* GL_EXT_fragment_lighting */ 4108 4429 4430 /* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ 4431 4432 #ifndef GL_EXT_framebuffer_blit 4433 #define GL_EXT_framebuffer_blit 1 4434 4435 #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 4436 #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 4437 #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 4438 #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA 4439 4440 typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); 4441 4442 #define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) 4443 4444 #define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) 4445 4446 #endif /* GL_EXT_framebuffer_blit */ 4447 4448 /* --------------------- GL_EXT_framebuffer_multisample -------------------- */ 4449 4450 #ifndef GL_EXT_framebuffer_multisample 4451 #define GL_EXT_framebuffer_multisample 1 4452 4453 #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB 4454 4455 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); 4456 4457 #define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) 4458 4459 #define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) 4460 4461 #endif /* GL_EXT_framebuffer_multisample */ 4462 4463 /* ----------------------- GL_EXT_framebuffer_object ----------------------- */ 4464 4465 #ifndef GL_EXT_framebuffer_object 4466 #define GL_EXT_framebuffer_object 1 4467 4468 #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 4469 #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 4470 #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 4471 #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 4472 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 4473 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 4474 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 4475 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 4476 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 4477 #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 4478 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 4479 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 4480 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 4481 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA 4482 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB 4483 #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC 4484 #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD 4485 #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF 4486 #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 4487 #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 4488 #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 4489 #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 4490 #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 4491 #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 4492 #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 4493 #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 4494 #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 4495 #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 4496 #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA 4497 #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB 4498 #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC 4499 #define GL_COLOR_ATTACHMENT13_EXT 0x8CED 4500 #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE 4501 #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF 4502 #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 4503 #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 4504 #define GL_FRAMEBUFFER_EXT 0x8D40 4505 #define GL_RENDERBUFFER_EXT 0x8D41 4506 #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 4507 #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 4508 #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 4509 #define GL_STENCIL_INDEX1_EXT 0x8D46 4510 #define GL_STENCIL_INDEX4_EXT 0x8D47 4511 #define GL_STENCIL_INDEX8_EXT 0x8D48 4512 #define GL_STENCIL_INDEX16_EXT 0x8D49 4513 #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 4514 #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 4515 #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 4516 #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 4517 #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 4518 #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 4519 4520 typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); 4521 typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); 4522 typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); 4523 typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); 4524 typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); 4525 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); 4526 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); 4527 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); 4528 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); 4529 typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); 4530 typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); 4531 typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); 4532 typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); 4533 typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); 4534 typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); 4535 typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); 4536 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); 4537 4538 #define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) 4539 #define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) 4540 #define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) 4541 #define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) 4542 #define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) 4543 #define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) 4544 #define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) 4545 #define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) 4546 #define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) 4547 #define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) 4548 #define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) 4549 #define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) 4550 #define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) 4551 #define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) 4552 #define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) 4553 #define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) 4554 #define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) 4555 4556 #define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) 4557 4558 #endif /* GL_EXT_framebuffer_object */ 4559 4109 4560 /* ---------------------------- GL_EXT_histogram --------------------------- */ 4110 4561 … … 4280 4731 4281 4732 #endif /* GL_EXT_multisample */ 4733 4734 /* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ 4735 4736 #ifndef GL_EXT_packed_depth_stencil 4737 #define GL_EXT_packed_depth_stencil 1 4738 4739 #define GL_DEPTH_STENCIL_EXT 0x84F9 4740 #define GL_UNSIGNED_INT_24_8_EXT 0x84FA 4741 #define GL_DEPTH24_STENCIL8_EXT 0x88F0 4742 #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 4743 4744 #define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) 4745 4746 #endif /* GL_EXT_packed_depth_stencil */ 4282 4747 4283 4748 /* -------------------------- GL_EXT_packed_pixels ------------------------- */ … … 4541 5006 4542 5007 #endif /* GL_EXT_shared_texture_palette */ 5008 5009 /* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ 5010 5011 #ifndef GL_EXT_stencil_clear_tag 5012 #define GL_EXT_stencil_clear_tag 1 5013 5014 #define GL_STENCIL_TAG_BITS_EXT 0x88F2 5015 #define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 5016 5017 #define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) 5018 5019 #endif /* GL_EXT_stencil_clear_tag */ 4543 5020 4544 5021 /* ------------------------ GL_EXT_stencil_two_side ------------------------ */ … … 4890 5367 4891 5368 #endif /* GL_EXT_texture_rectangle */ 5369 5370 /* -------------------------- GL_EXT_texture_sRGB -------------------------- */ 5371 5372 #ifndef GL_EXT_texture_sRGB 5373 #define GL_EXT_texture_sRGB 1 5374 5375 #define GL_SRGB_EXT 0x8C40 5376 #define GL_SRGB8_EXT 0x8C41 5377 #define GL_SRGB_ALPHA_EXT 0x8C42 5378 #define GL_SRGB8_ALPHA8_EXT 0x8C43 5379 #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 5380 #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 5381 #define GL_SLUMINANCE_EXT 0x8C46 5382 #define GL_SLUMINANCE8_EXT 0x8C47 5383 #define GL_COMPRESSED_SRGB_EXT 0x8C48 5384 #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 5385 #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A 5386 #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B 5387 #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C 5388 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D 5389 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E 5390 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F 5391 5392 #define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) 5393 5394 #endif /* GL_EXT_texture_sRGB */ 4892 5395 4893 5396 /* -------------------------- GL_EXT_vertex_array -------------------------- */ … … 5191 5694 #endif /* GL_EXT_vertex_weighting */ 5192 5695 5696 /* ------------------------ GL_GREMEDY_string_marker ----------------------- */ 5697 5698 #ifndef GL_GREMEDY_string_marker 5699 #define GL_GREMEDY_string_marker 1 5700 5701 typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string); 5702 5703 #define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) 5704 5705 #define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) 5706 5707 #endif /* GL_GREMEDY_string_marker */ 5708 5193 5709 /* --------------------- GL_HP_convolution_border_modes -------------------- */ 5194 5710 … … 5442 5958 5443 5959 #endif /* GL_KTX_buffer_region */ 5960 5961 /* ------------------------- GL_MESAX_texture_stack ------------------------ */ 5962 5963 #ifndef GL_MESAX_texture_stack 5964 #define GL_MESAX_texture_stack 1 5965 5966 #define GL_TEXTURE_1D_STACK_MESAX 0x8759 5967 #define GL_TEXTURE_2D_STACK_MESAX 0x875A 5968 #define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B 5969 #define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C 5970 #define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D 5971 #define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E 5972 5973 #define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) 5974 5975 #endif /* GL_MESAX_texture_stack */ 5444 5976 5445 5977 /* -------------------------- GL_MESA_pack_invert -------------------------- */ … … 5755 6287 typedef unsigned short GLhalf; 5756 6288 5757 typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GL uint red, GLuint green, GLuintblue);5758 typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GL uint* v);5759 typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GL uint red, GLuint green, GLuint blue, GLuintalpha);5760 typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GL uint* v);5761 typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GL uintfog);5762 typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GL uint* fog);5763 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GL uints);5764 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GL uint* v);5765 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GL uint s, GLuintt);5766 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GL uint* v);5767 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GL uint s, GLuint t, GLuintr);5768 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GL uint* v);5769 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GL uint s, GLuint t, GLuint r, GLuintq);5770 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GL uint* v);5771 typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GL uint nx, GLuint ny, GLuintnz);5772 typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GL uint* v);5773 typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GL uint red, GLuint green, GLuintblue);5774 typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GL uint* v);5775 typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GL uints);5776 typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GL uint* v);5777 typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GL uint s, GLuintt);5778 typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GL uint* v);5779 typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GL uint s, GLuint t, GLuintr);5780 typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GL uint* v);5781 typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GL uint s, GLuint t, GLuint r, GLuintq);5782 typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GL uint* v);5783 typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GL uint x, GLuinty);5784 typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GL uint* v);5785 typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GL uint x, GLuint y, GLuintz);5786 typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GL uint* v);5787 typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GL uint x, GLuint y, GLuint z, GLuintw);5788 typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GL uint* v);5789 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GL uintx);5790 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GL uint* v);5791 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GL uint x, GLuinty);5792 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GL uint* v);5793 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GL uint x, GLuint y, GLuintz);5794 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GL uint* v);5795 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GL uint x, GLuint y, GLuint z, GLuintw);5796 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GL uint* v);5797 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GL uint* v);5798 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GL uint* v);5799 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GL uint* v);5800 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GL uint* v);5801 typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GL uintweight);5802 typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GL uint* weight);6289 typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); 6290 typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); 6291 typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); 6292 typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); 6293 typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); 6294 typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); 6295 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); 6296 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); 6297 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); 6298 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); 6299 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); 6300 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); 6301 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); 6302 typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); 6303 typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); 6304 typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); 6305 typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); 6306 typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); 6307 typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); 6308 typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); 6309 typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); 6310 typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); 6311 typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); 6312 typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); 6313 typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); 6314 typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); 6315 typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); 6316 typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); 6317 typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); 6318 typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); 6319 typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); 6320 typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); 6321 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); 6322 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); 6323 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); 6324 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); 6325 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); 6326 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); 6327 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); 6328 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); 6329 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); 6330 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); 6331 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); 6332 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); 6333 typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); 6334 typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); 5803 6335 5804 6336 #define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) … … 7192 7724 #define GL_SGIX_shadow 1 7193 7725 7726 #define GL_TEXTURE_COMPARE_SGIX 0x819A 7727 #define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B 7728 #define GL_TEXTURE_LEQUAL_R_SGIX 0x819C 7729 #define GL_TEXTURE_GEQUAL_R_SGIX 0x819D 7730 7194 7731 #define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) 7195 7732 … … 7841 8378 GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; 7842 8379 8380 GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; 8381 GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; 8382 GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; 8383 GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; 8384 GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; 8385 GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; 8386 GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; 8387 GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; 8388 GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; 8389 GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; 8390 GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; 8391 GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; 8392 GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; 8393 GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; 8394 GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; 8395 GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; 8396 GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; 8397 GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; 8398 GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; 8399 GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; 8400 GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; 8401 GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; 8402 GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; 8403 GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; 8404 GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; 8405 GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; 8406 GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; 8407 GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; 8408 GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; 8409 GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; 8410 GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; 8411 GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; 8412 GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; 8413 GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; 8414 GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; 8415 GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; 8416 GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; 8417 GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; 8418 GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; 8419 GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; 8420 GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; 8421 GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; 8422 GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; 8423 GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; 8424 GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; 8425 GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; 8426 GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; 8427 GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; 8428 GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; 8429 GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; 8430 GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; 8431 GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; 8432 GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; 8433 GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; 8434 GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; 8435 GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; 8436 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; 8437 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; 8438 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; 8439 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; 8440 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; 8441 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; 8442 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; 8443 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; 8444 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; 8445 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; 8446 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; 8447 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; 8448 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; 8449 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; 8450 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; 8451 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; 8452 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; 8453 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; 8454 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; 8455 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; 8456 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; 8457 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; 8458 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; 8459 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; 8460 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; 8461 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; 8462 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; 8463 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; 8464 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; 8465 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; 8466 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; 8467 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; 8468 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; 8469 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; 8470 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; 8471 GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; 8472 GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; 8473 7843 8474 GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; 7844 8475 … … 8009 8640 GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; 8010 8641 GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; 8642 8643 GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; 8644 GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; 8645 GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; 8646 GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; 8011 8647 8012 8648 GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; … … 8276 8912 GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; 8277 8913 8914 GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; 8915 8916 GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; 8917 8918 GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; 8919 GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; 8920 GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; 8921 GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; 8922 GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; 8923 GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; 8924 GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; 8925 GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; 8926 GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; 8927 GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; 8928 GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; 8929 GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; 8930 GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; 8931 GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; 8932 GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; 8933 GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; 8934 GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; 8935 8278 8936 GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; 8279 8937 GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; … … 8412 9070 GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; 8413 9071 GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; 9072 9073 GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; 8414 9074 8415 9075 GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; … … 8797 9457 GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; 8798 9458 GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; 9459 GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; 8799 9460 GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; 8800 9461 GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; … … 8815 9476 GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; 8816 9477 GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; 9478 GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; 8817 9479 GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; 8818 9480 GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; … … 8879 9541 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; 8880 9542 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; 9543 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; 9544 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; 9545 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; 8881 9546 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; 8882 9547 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; … … 8888 9553 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; 8889 9554 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; 9555 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; 8890 9556 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; 8891 9557 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; … … 8901 9567 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; 8902 9568 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; 9569 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; 8903 9570 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; 8904 9571 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; … … 8920 9587 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; 8921 9588 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; 9589 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; 8922 9590 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; 8923 9591 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; 8924 9592 GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; 9593 GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; 8925 9594 GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; 8926 9595 GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; … … 8938 9607 GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; 8939 9608 GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; 9609 GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; 8940 9610 GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; 8941 9611 GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; … … 9065 9735 typedef struct GLEWContextStruct GLEWContext; 9066 9736 GLEWAPI GLenum glewContextInit (GLEWContext* ctx); 9737 GLEWAPI GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name); 9738 9739 #define glewInit() glewContextInit(glewGetContext()) 9740 #define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) 9741 #define glewIsExtensionSupported(x) glewIsSupported(x) 9067 9742 9068 9743 #ifdef _WIN32 … … 9077 9752 9078 9753 GLEWAPI GLenum glewInit (); 9754 GLEWAPI GLboolean glewIsSupported (const char* name); 9755 #define glewIsExtensionSupported(x) glewIsSupported(x) 9079 9756 9080 9757 #define GLEW_GET_VAR(x) x -
GTP/trunk/Lib/Vis/Preprocessing/src/GL/wglew.h
r498 r1001 1 1 /* 2 2 ** The OpenGL Extension Wrangler Library 3 ** Copyright (C) 200 4, 2003, 2002, Milan Ikits <milan ikits[at]ieee org>4 ** Copyright (C) 200 4, 2003, 2002, Marcelo E. Magallon <mmagallo[at]debian org>3 ** Copyright (C) 2002-2006, Milan Ikits <milan ikits[]ieee org> 4 ** Copyright (C) 2002-2006, Marcelo E. Magallon <mmagallo[]debian org> 5 5 ** Copyright (C) 2002, Lev Povalahev 6 6 ** All rights reserved. … … 30 30 */ 31 31 32 /*33 ** License Applicability. Except to the extent portions of this file are34 ** made subject to an alternative license as permitted in the SGI Free35 ** Software License B, Version 1.1 (the "License"), the contents of this36 ** file are subject only to the provisions of the License. You may not use37 ** this file except in compliance with the License. You may obtain a copy38 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 160039 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:40 **41 ** http://oss.sgi.com/projects/FreeB42 **43 ** Note that, as provided in the License, the Software is distributed on an44 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS45 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND46 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A47 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.48 **49 ** Original Code. The Original Code is: OpenGL Sample Implementation,50 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,51 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.52 ** Copyright in any portions created by third parties is as indicated53 ** elsewhere herein. All Rights Reserved.54 **55 ** Additional Notice Provisions: This software was created using the56 ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has57 ** not been independently verified as being compliant with the OpenGL(R)58 ** version 1.2.1 Specification.59 */60 61 32 #ifndef __wglew_h__ 62 33 #define __wglew_h__ … … 70 41 71 42 #if !defined(APIENTRY) && !defined(__CYGWIN__) 72 #define WIN32_LEAN_AND_MEAN 1 43 # ifndef WIN32_LEAN_AND_MEAN 44 # define WIN32_LEAN_AND_MEAN 1 45 # endif 73 46 #include <windows.h> 74 47 #endif … … 103 76 104 77 #endif /* WGL_3DFX_multisample */ 78 79 /* ------------------------- WGL_3DL_stereo_control ------------------------ */ 80 81 #ifndef WGL_3DL_stereo_control 82 #define WGL_3DL_stereo_control 1 83 84 #define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 85 #define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 86 #define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 87 #define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 88 89 typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); 90 91 #define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) 92 93 #define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) 94 95 #endif /* WGL_3DL_stereo_control */ 105 96 106 97 /* ------------------------- WGL_ARB_buffer_region ------------------------- */ … … 342 333 #endif /* WGL_ATI_pixel_format_float */ 343 334 335 /* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ 336 337 #ifndef WGL_ATI_render_texture_rectangle 338 #define WGL_ATI_render_texture_rectangle 1 339 340 #define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 341 342 #define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) 343 344 #endif /* WGL_ATI_render_texture_rectangle */ 345 344 346 /* -------------------------- WGL_EXT_depth_float -------------------------- */ 345 347 … … 769 771 #endif /* GLEW_MX */ 770 772 773 WGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; 774 771 775 WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; 772 776 WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; … … 862 866 WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; 863 867 WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample; 868 WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control; 864 869 WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region; 865 870 WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string; … … 871 876 WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture; 872 877 WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; 878 WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; 873 879 WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float; 874 880 WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table; … … 901 907 typedef struct WGLEWContextStruct WGLEWContext; 902 908 GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx); 909 GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name); 910 911 #define wglewInit() wglewContextInit(wglewGetContext()) 912 #define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) 903 913 904 914 #define WGLEW_GET_VAR(x) wglewGetContext()->x … … 909 919 #define WGLEW_GET_VAR(x) x 910 920 #define WGLEW_GET_FUN(x) x 921 922 GLEWAPI GLboolean wglewIsSupported (const char* name); 911 923 912 924 #endif /* GLEW_MX */ -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r1000 r1001 1 1 #include "Mesh.h" 2 #include "glInterface.h" 3 #include "OcclusionQuery.h" 2 4 #include "GlRenderer.h" 3 5 #include "ViewCellsManager.h" … … 9 11 #include "Environment.h" 10 12 13 11 14 //#define GL_GLEXT_PROTOTYPES 12 #include <GL/glext.h> 15 16 13 17 #include <Cg/cg.h> 14 18 #include <Cg/cgGL.h> 19 15 20 16 21 #include <QVBoxLayout> … … 26 31 27 32 const int depthMapSize = 512; 28 static vector< int> sQueries;33 static vector<OcclusionQuery *> sQueries; 29 34 30 35 GlRendererWidget *rendererWidget = NULL; 31 36 GlDebuggerWidget *debuggerWidget = NULL; 32 37 33 34 #ifdef _WIN32 35 PFNGLGENOCCLUSIONQUERIESNVPROC glGenOcclusionQueriesNV; 36 PFNGLBEGINOCCLUSIONQUERYNVPROC glBeginOcclusionQueryNV; 37 PFNGLENDOCCLUSIONQUERYNVPROC glEndOcclusionQueryNV; 38 PFNGLGETOCCLUSIONQUERYUIVNVPROC glGetOcclusionQueryuivNV; 39 40 //PFNGLGENQUERIESARBPROC glGenQueriesARB; 41 //PFNGLBEGINQUERYARBPROC glBeginQueryARB; 42 //PFNGLENDQUERYARBPROC glEndQueryARB; 43 //PFNGLGETQUERYUIVARBPROC glGetQueryuivARB; 44 #endif 38 static bool arbQuerySupport = false; 39 static bool nvQuerySupport = false; 40 41 42 static void InitExtensions() 43 { 44 GLenum err = glewInit(); 45 46 if (GLEW_OK != err) 47 { 48 // problem: glewInit failed, something is seriously wrong 49 cerr << "Error: " << glewGetErrorString(err) << endl; 50 exit(1); 51 } 52 53 if (GLEW_ARB_occlusion_query) 54 arbQuerySupport = true; 55 56 if (GLEW_NV_occlusion_query) 57 nvQuerySupport = true; 58 59 60 if (!arbQuerySupport && !nvQuerySupport) 61 { 62 cout << "I require the GL_ARB_occlusion_query or the GL_NV_occlusion_query OpenGL extension to work.\n"; 63 exit(1); 64 } 65 } 45 66 46 67 … … 71 92 72 93 mUseGlLists = true; 73 94 //mUseGlLists = false; 74 95 } 75 96 … … 82 103 cgDestroyContext(sCgContext); 83 104 cerr<<"done."<<endl; 105 106 CLEAR_CONTAINER(sQueries); 107 CLEAR_CONTAINER(mOcclusionQueries); 84 108 } 85 109 … … 107 131 RenderViewCell(dynamic_cast<ViewCell *>(object)); 108 132 break; 133 case Intersectable::TRANSFORMED_MESH_INSTANCE: 134 RenderTransformedMeshInstance(dynamic_cast<TransformedMeshInstance *>(object)); 135 break; 109 136 default: 110 137 cerr<<"Rendering this object not yet implemented\n"; … … 151 178 } 152 179 180 181 void 182 GlRenderer::RenderTransformedMeshInstance(TransformedMeshInstance *mi) 183 { 184 // apply world transform before rendering 185 Matrix4x4 m; 186 mi->GetWorldTransform(m); 187 188 glPushMatrix(); 189 /* 190 cout << "\n*******" << endl; 191 for (int i = 0; i < 16; ++ i) 192 cout << (float *)(m.x)[i] << " "; 193 194 cout << "\n*******" << endl; 195 for (int i = 0; i < 4; ++ i) 196 for (int j = 0; j < 4; ++ j) 197 cout << m.x[i][j] << " "; 198 199 cout << "\n==" << endl;*/ 200 201 glMultMatrixf((float *)m.x); 202 GLfloat dummy[16]; 203 204 /*glGetFloatv(GL_MODELVIEW_MATRIX, dummy); 205 206 for (int i = 0; i < 16; ++ i) 207 cout << dummy[i] << " "; 208 cout << endl;*/ 209 RenderMesh(mi->GetMesh()); 210 211 glPopMatrix(); 212 } 213 214 153 215 void 154 216 GlRenderer::SetupFalseColor(const int id) … … 207 269 glEnable(GL_CULL_FACE); 208 270 209 glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC) 210 wglGetProcAddress("glGenOcclusionQueriesNV"); 211 glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC) 212 wglGetProcAddress("glBeginOcclusionQueryNV"); 213 glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC) 214 wglGetProcAddress("glEndOcclusionQueryNV"); 215 glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC) 216 wglGetProcAddress("glGetOcclusionQueryuivNV"); 217 218 219 #if 0 220 glGenQueriesARB = (PFNGLGENDQUERIESARBPROC) 221 wglGetProcAddress("glGenQueriesARB"); 222 glBeginQueryARB = (PFNGLBEGINQUERYARBPROC) 223 wglGetProcAddress("glBeginQueryARB"); 224 glEndQueryARB = (PFNGLENDQUERYARBPROC) 225 wglGetProcAddress("glEndQueryARB"); 226 glGetQueryuivARB = (PFNGLGETQUERYUIVARBPROC) 227 wglGetProcAddress("glGetQueryuivARB"); 228 229 #endif 230 231 271 // HACK!! but using glew keeps crashing for some reason ... 272 InitExtensions(); 273 232 274 #if 0 233 275 GLfloat mat_ambient[] = { 0.5, 0.5, 0.5, 1.0 }; … … 445 487 void 446 488 GlRendererBuffer::EvalQueryWithItemBuffer( 447 489 //RenderCostSample &sample 448 490 ) 449 491 { … … 470 512 } 471 513 472 std::ofstream outfile("try_100.txt");514 //std::ofstream outfile("try_arb.txt"); 473 515 void 474 516 GlRendererBuffer::EvalQueryWithOcclusionQueries( … … 483 525 484 526 // simulate detectemptyviewspace using backface culling 485 /*if (mDetectEmptyViewSpace)527 if (mDetectEmptyViewSpace) 486 528 { 487 529 glEnable(GL_CULL_FACE); 488 cout << "culling" << endl;530 //cout << "culling" << endl; 489 531 } 490 532 else 491 533 { 492 cout << "not culling" << endl;534 //cout << "not culling" << endl; 493 535 glDisable(GL_CULL_FACE); 494 }*/ 495 496 497 const int numQ = 500;//(int)mOcclusionQueries.size(); 498 499 //outfile << "\n**************" << endl; 500 glFinish(); 536 } 537 538 539 //const int numQ = 1; 540 const int numQ = (int)mOcclusionQueries.size(); 541 542 //glFinish(); 543 #if 0 501 544 //-- now issue queries for all objects 502 545 for (int j = 0; j < (int)mObjects.size(); ++ j) 546 { 547 mOcclusionQueries[j]->BeginQuery(); 548 RenderIntersectable(mObjects[j]); 549 mOcclusionQueries[j]->EndQuery(); 550 551 unsigned int pixelCount; 552 553 pixelCount = mOcclusionQueries[j]->GetQueryResult(); 554 mObjects[j]->mCounter += pixelCount; 555 } 556 #else 557 558 int q = 0; 559 560 //-- now issue queries for all objects 561 for (int j = 0; j < (int)mObjects.size(); j += q) 503 562 { 504 for ( intq = 0; ((j + q) < (int)mObjects.size()) && (q < numQ); ++ q)563 for (q = 0; ((j + q) < (int)mObjects.size()) && (q < numQ); ++ q) 505 564 { 506 565 //glFinish(); 507 // outfile << "queries: " << mOcclusionQueries[q] << " "; 508 glBeginOcclusionQueryNV(mOcclusionQueries[q]); 566 mOcclusionQueries[q]->BeginQuery(); 509 567 510 568 RenderIntersectable(mObjects[j + q]); 511 569 512 glFlush(); 513 glEndOcclusionQueryNV(); 570 mOcclusionQueries[q]->EndQuery(); 514 571 //glFinish(); 515 572 } 516 517 // outfile << endl; 573 //cout << "q: " << q << endl; 518 574 // collect results of the queries 519 for (int q = 0; ((j + q) < (int)mObjects.size()) && (q < numQ); ++ q)575 for (int t = 0; t < q; ++ t) 520 576 { 521 577 unsigned int pixelCount; 522 578 523 579 //-- reenable other state 524 #if 1 580 #if 0 581 bool available; 582 525 583 do 526 584 { 527 glGetOcclusionQueryuivNV(mOcclusionQueries[q], GL_PIXEL_COUNT_AVAILABLE_NV, &pixelCount);528 529 if ( pixelCount == 0) cout << "W";585 available = mOcclusionQueries[t]->ResultAvailable(); 586 587 if (!available) cout << "W"; 530 588 } 531 while (! pixelCount);589 while (!available); 532 590 #endif 533 591 534 glGetOcclusionQueryuivNV(mOcclusionQueries[q], GL_PIXEL_COUNT_NV, &pixelCount); 535 536 if (pixelCount > 0) 537 outfile <<"o="<<j+q<<" q="<<mOcclusionQueries[q]<<" pc="<<pixelCount<<" "; 538 539 mObjects[j + q]->mCounter += pixelCount; 592 pixelCount = mOcclusionQueries[t]->GetQueryResult(); 593 594 //if (pixelCount > 0) 595 // cout <<"o="<<j+q<<" q="<<mOcclusionQueries[q]->GetQueryId()<<" pc="<<pixelCount<<" "; 596 mObjects[j + t]->mCounter += pixelCount; 540 597 } 541 598 542 j += q;543 } 544 545 glFinish();599 //j += q; 600 } 601 #endif 602 //glFinish(); 546 603 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 547 604 glDepthMask(GL_TRUE); … … 552 609 553 610 void 554 GlRendererBuffer::EvalRenderCostSample( 555 RenderCostSample &sample 611 GlRendererBuffer::EvalRenderCostSample(RenderCostSample &sample, 612 const bool useOcclusionQueries, 613 const int threshold 556 614 ) 557 615 { … … 575 633 int i, j; 576 634 635 // reset object counters 577 636 ObjectContainer::const_iterator it, it_end = mObjects.end(); 578 637 … … 584 643 ++ mFrame; 585 644 586 // either use occlusion queries or item buffer587 bool useOcclusionQueries;588 environment->GetBoolValue("RenderSampler.useOcclusionQueries", useOcclusionQueries);589 590 //if (useOcclusionQueries) cout << "using occlusion queries" << endl;591 //else cout << "using item buffer" << endl;592 593 645 //glCullFace(GL_FRONT); 594 646 glCullFace(GL_BACK); 595 647 glDisable(GL_CULL_FACE); 648 649 650 // query all 6 directions for a full point sample 596 651 for (i = 0; i < 6; ++ i) 597 652 { … … 601 656 glClearColor(1.0f, 1.0f, 1.0f, 1.0f); 602 657 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 658 //glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask(GL_TRUE); 603 659 glDepthFunc(GL_LESS); 660 604 661 mUseFalseColors = true; 605 662 606 // the actual scene rendering 663 // the actual scene rendering fills the depth (for occlusion queries) 664 // and the frame buffer (for item buffer) 607 665 RenderScene(); 608 666 … … 616 674 } 617 675 676 // evaluate the sample 618 677 if (useOcclusionQueries) 619 678 { … … 633 692 { 634 693 Intersectable *obj = *it; 635 if (obj->mCounter )694 if (obj->mCounter >= threshold) 636 695 { 637 696 ++ sample.mVisibleObjects; … … 640 699 } 641 700 642 outfile << "RS=" << sample.mVisibleObjects << " "; 643 } 644 645 646 void 647 GlRendererBuffer::SampleRenderCost( 648 const int n, 649 vector<RenderCostSample> &samples 701 //cout << "RS=" << sample.mVisibleObjects << " "; 702 } 703 704 705 void 706 GlRendererBuffer::SampleRenderCost(const int numSamples, 707 vector<RenderCostSample> &samples, 708 const bool useOcclusionQueries, 709 const int threshold 650 710 ) 651 711 { … … 655 715 mPixelBuffer = new unsigned int[GetWidth()*GetHeight()]; 656 716 717 // using 90 degree projection to capture 360 view with 6 samples 657 718 SetupProjection(GetHeight(), GetHeight(), 90.0f); 658 719 659 samples.resize(n );720 samples.resize(numSamples); 660 721 halton.Reset(); 661 722 662 // the number of queries simultanosly allocated 663 const int numQ = 400; 664 //const int numQ = 3; 665 #if 1 666 for (int i = (int)mOcclusionQueries.size(); i < numQ; ++ i) 723 // the number of queries queried in batch mode 724 const int numQ = 500; 725 //const int numQ = (int)mObjects.size(); 726 if (useOcclusionQueries) 667 727 { 668 unsigned int query;669 glGenOcclusionQueriesNV(1, &query);670 mOcclusionQueries.push_back(query);671 //mOcclusionQueries[i] = queries[i]; 672 } 673 #else 674 if ((int)mOcclusionQueries.size() < numQ)728 cout << "\ngenerating " << numQ << " queries ... "; 729 OcclusionQuery::GenQueries(mOcclusionQueries, numQ); 730 cout << "finished" << endl; 731 } 732 733 // sampling queries 734 for (int i = 0; i < numSamples; ++ i) 675 735 { 676 cout << "allocating occ queries..." << endl; 677 678 unsigned int *queries = new unsigned int[numQ]; 679 680 // matt: ? 681 for (int i = 0; i < numQ; ++ i) 682 queries[i] = 111; 683 684 glGenOcclusionQueriesNV(numQ, queries); 685 mOcclusionQueries.resize(numQ); 686 687 688 for (int i = 0; i < numQ; ++ i) 689 { 690 mOcclusionQueries[i] = queries[i]; 691 } 692 693 DEL_PTR(queries); 694 } 695 #endif 696 697 for (int i = 0; i < n; ++ i) 698 { 699 EvalRenderCostSample(samples[i]); 736 cout << "."; 737 EvalRenderCostSample(samples[i], useOcclusionQueries, threshold); 700 738 } 701 739 … … 707 745 void 708 746 GlRendererBuffer::RandomViewPoint() 709 { 710 711 747 { 712 748 // do not use this function since it could return different viewpoints for 713 749 // different executions of the algorithm … … 770 806 771 807 mUseFalseColors = false; 772 773 static int query = -1;774 808 unsigned int pixelCount; 775 809 776 if (query == -1) 777 glGenOcclusionQueriesNV(1, (unsigned int *)&query); 810 //static int query = -1; 811 //if (query == -1) 812 // glGenOcclusionQueriesNV(1, (unsigned int *)&query); 813 814 OcclusionQuery query; 778 815 779 816 if (mDetectEmptyViewSpace) { … … 789 826 glDisable( GL_CULL_FACE ); 790 827 791 glBeginOcclusionQueryNV(query);828 query.BeginQuery(); 792 829 793 830 RenderScene(); 794 831 795 glEndOcclusionQueryNV();832 query.EndQuery(); 796 833 797 834 // at this point, if possible, go and do some other computation … … 801 838 802 839 // reenable other state 803 glGetOcclusionQueryuivNV(query, 804 GL_PIXEL_COUNT_NV, 805 &pixelCount); 840 pixelCount = query.GetQueryResult(); 806 841 807 842 if (pixelCount > 0) … … 842 877 mUseFalseColors = true; 843 878 844 glBeginOcclusionQueryNV(query);879 query.BeginQuery(); 845 880 846 881 SetupCamera(); … … 848 883 RenderScene(); 849 884 850 glEndOcclusionQueryNV();885 query.EndQuery(); 851 886 852 887 853 888 unsigned int pixelCount; 854 889 // reenable other state 855 glGetOcclusionQueryuivNV(query, 856 GL_PIXEL_COUNT_NV, 857 &pixelCount); 890 pixelCount = query.GetQueryResult(); 891 858 892 859 893 pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); … … 1117 1151 { 1118 1152 ObjectContainer::const_iterator oi = mObjects.begin(); 1153 1119 1154 for (; oi != mObjects.end(); oi++) 1120 1155 RenderIntersectable(*oi); … … 1902 1937 1903 1938 // create new queries if necessary 1904 GenQueries((int)beam.mViewCells.size());1939 OcclusionQuery::GenQueries(sQueries, (int)beam.mViewCells.size()); 1905 1940 1906 1941 // check whether any backfacing polygon would pass the depth test? … … 1919 1954 for (vit = beam.mViewCells.begin(); vit != vit_end; ++ vit) 1920 1955 { 1921 glBeginOcclusionQueryNV(sQueries[queryIdx ++]);1956 sQueries[queryIdx ++]->BeginQuery(); 1922 1957 1923 1958 RenderIntersectable(*vit); 1924 1959 1925 glEndOcclusionQueryNV(); 1960 sQueries[queryIdx]->EndQuery(); 1961 1962 ++ queryIdx; 1926 1963 } 1927 1964 … … 1937 1974 1938 1975 queryIdx = 0; 1939 unsigned int pixelCount;1940 1976 1941 1977 for (vit = beam.mViewCells.begin(); vit != vit_end; ++ vit) 1942 1978 { 1943 1979 // fetch queries 1944 glGetOcclusionQueryuivNV(sQueries[queryIdx ++], 1945 GL_PIXEL_COUNT_NV, 1946 &pixelCount); 1980 unsigned int pixelCount = sQueries[queryIdx ++]->GetQueryResult(); 1981 1947 1982 if (pixelCount) 1948 1983 Debug << "view cell " << (*vit)->GetId() << " visible pixels: " << pixelCount << endl; … … 1991 2026 if (beam.mFlags & !Beam::STORE_OBJECTS) 1992 2027 beam.mObjects.clear(); 1993 }1994 1995 1996 void GlRendererBuffer::GenQueries(const int numQueries)1997 {1998 if ((int)sQueries.size() < numQueries)1999 {2000 const int n = numQueries - (int)sQueries.size();2001 unsigned int *newQueries = new unsigned int[n];2002 2003 glGenOcclusionQueriesNV(n, (unsigned int *)newQueries);2004 2005 for (int i = 0; i < n; ++ i)2006 {2007 sQueries.push_back(newQueries[i]);2008 }2009 2010 delete [] newQueries;2011 }2012 2028 } 2013 2029 -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r997 r1001 2 2 #define __GLRENDERER_H 3 3 4 //#include "glInterface.h" 4 5 #include <QtOpenGL> 5 6 #include <QWaitCondition> 7 6 8 //#include <QGLPixelBuffer> 7 9 … … 26 28 class GlRendererBuffer; 27 29 class BeamSampleStatistics; 30 class OcclusionQuery; 31 class TransformedMeshInstance; 28 32 29 33 struct VssRayContainer; … … 107 111 QWaitCondition mRenderingFinished; 108 112 109 vector< unsigned int> mOcclusionQueries;113 vector<OcclusionQuery *> mOcclusionQueries; 110 114 111 115 GlRenderer(SceneGraph *sceneGraph, … … 120 124 void RenderViewCell(ViewCell *vc); 121 125 void RenderMeshInstance(MeshInstance *mi); 126 void RenderTransformedMeshInstance(TransformedMeshInstance *mi); 122 127 void RenderMesh(Mesh *m); 123 128 void SetupMaterial(Material *m); … … 157 162 158 163 159 void 160 EvalRenderCostSample( 161 RenderCostSample &sample 162 ); 163 164 void 165 SampleRenderCost( 166 const int n, 167 vector<RenderCostSample> &samples 168 ); 164 /** Evaluates render cost of a point sample. 165 @param sample the render cost sample to be evaluated 166 @param useOcclusionQueries if occlusion queries should be used or item buffer 167 @param threshold number of pixels / samples from where an object is considered visible. 168 */ 169 void EvalRenderCostSample(RenderCostSample &sample, 170 const bool useOcclusionQueries, 171 const int threshold); 172 173 /** Evaluates render cost of a number of point samples. The point samples 174 are distributed uniformly over the defined view space. 175 176 @param numSamples the number of point samples taken 177 @param samples stores the taken point samples in a container 178 @param useOcclusionQueries if occlusion queries should be used or item buffer 179 @param threshold number of pixels / samples from where an object is considered visible. 180 */ 181 void SampleRenderCost(const int numSamples, 182 vector<RenderCostSample> &samples, 183 const bool useOcclusionQueries, 184 const int threshold = 0); 169 185 170 186 … … 234 250 Intersectable *sourceObject); 235 251 252 /** Evaluates query for one direction using item buffer. 253 */ 236 254 void EvalQueryWithItemBuffer(); 255 /** Evaluates query for one direction using occlusion queries. 256 */ 237 257 void EvalQueryWithOcclusionQueries(); 238 258 -
GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.cpp
r975 r1001 85 85 //mStream.open(myFileName, ios::binary); 86 86 mStream.open(myFileName); 87 88 delete [] myFileName; 87 89 } 88 90 … … 144 146 unsigned int result = mStream.gcount(); 145 147 mCurrentPos = mStream.tellg(); 146 //GtpVisibilityPreprocessor::Debug << " here1001 " << maxToRead << " haha" << toFill << " " << result << endl;148 //GtpVisibilityPreprocessor::Debug << "stream: " << maxToRead << " " << toFill << " " << result << endl; 147 149 148 150 return result; -
GTP/trunk/Lib/Vis/Preprocessing/src/Material.h
r860 r1001 33 33 RgbColor mAmbientColor; 34 34 35 Material() 35 Material(): mId(0) 36 36 { 37 37 } 38 38 39 Material(const int id): mId(id) 40 { 41 } 42 39 43 Material(const RgbColor &color):mDiffuseColor(color), 40 44 mAmbientColor(color), 41 mSpecularColor(0,0,0) 45 mSpecularColor(0,0,0), mId(0) 42 46 { 43 47 } … … 45 49 friend Material RandomMaterial(); 46 50 51 /** Returns unique material id. 52 */ 53 int GetId() const 54 { 55 return mId; 56 } 57 58 protected: 59 60 // unique material id 61 int mId; 47 62 }; 48 63 -
GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.h
r860 r1001 34 34 35 35 // Fundamental operations 36 int Invert(); // Invert the matrix .. returns 0 = regular 37 void Transpose(); // Transpose the matrix 36 /// Invert the matrix .. returns 0 = regular 37 int Invert(); 38 /// Transpose the matrix 39 void Transpose(); 38 40 39 41 void -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r991 r1001 3 3 #include "MeshKdTree.h" 4 4 #include "Triangle3.h" 5 #include "ResourceManager.h" 5 6 6 7 namespace GtpVisibilityPreprocessor { … … 432 433 int 433 434 Mesh::GetRandomVisibleSurfacePoint(Vector3 &point, 434 Vector3 &normal, 435 const Vector3 &viewpoint, 436 const int maxTries 437 ) 435 Vector3 &normal, 436 const Vector3 &viewpoint, 437 const int maxTries) 438 438 { 439 439 Plane3 plane; … … 463 463 464 464 465 int466 MeshInstance::CastRay(467 Ray &ray468 )469 {470 int res = mMesh->CastRay(ray, this);471 return res;472 }473 474 int475 MeshInstance::CastRay(476 Ray &ray,477 const vector<int> &faces478 )479 {480 return mMesh->CastRayToSelectedFaces(ray, faces, this);481 }482 483 484 485 int486 MeshInstance::GetRandomSurfacePoint(Vector3 &point, Vector3 &normal)487 {488 return mMesh->GetRandomSurfacePoint(point, normal);489 }490 491 int492 MeshInstance::GetRandomVisibleSurfacePoint(Vector3 &point,493 Vector3 &normal,494 const Vector3 &viewpoint,495 const int maxTries496 )497 {498 return mMesh->GetRandomVisibleSurfacePoint(point, normal, viewpoint, maxTries);499 }500 501 502 int503 TransformedMeshInstance::GetRandomSurfacePoint(Vector3 &point, Vector3 &normal)504 {505 int index = mMesh->GetRandomSurfacePoint(point, normal);506 point = mWorldTransform*point;507 normal = TransformNormal(mWorldTransform, normal);508 return index;509 }510 511 465 Plane3 512 466 Mesh::GetFacePlane(const int faceIndex) … … 554 508 } 555 509 556 int 557 TransformedMeshInstance::CastRay( 558 Ray &ray 559 ) 510 511 void 512 Mesh::AddTriangle(const Triangle3 &triangle) 513 { 514 int index = (int)mVertices.size(); 515 516 for (int i=0; i < 3; i++) { 517 mVertices.push_back(triangle.mVertices[i]); 518 } 519 520 AddFace(new Face(index + 0, index + 1, index + 2) ); 521 } 522 523 void 524 Mesh::AddRectangle(const Rectangle3 &rect) 525 { 526 int index = (int)mVertices.size(); 527 528 for (int i=0; i < 4; i++) { 529 mVertices.push_back(rect.mVertices[i]); 530 } 531 532 AddFace(new Face(index + 0, index + 1, index + 2, index + 3) ); 533 } 534 535 void 536 Mesh::AssignRandomMaterial() 537 { 538 mMaterial = MaterialManager::GetSingleton()->CreateResource(); 539 540 Material randMat = RandomMaterial(); 541 542 mMaterial->mDiffuseColor = randMat.mDiffuseColor; 543 mMaterial->mSpecularColor = randMat.mSpecularColor; 544 mMaterial->mAmbientColor = randMat.mAmbientColor; 545 } 546 547 548 Mesh *CreateMeshFromBox(const AxisAlignedBox3 &box) 549 { 550 Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 551 552 // add 8 vertices of the box 553 const int index = (int)mesh->mVertices.size(); 554 555 for (int i=0; i < 8; ++ i) 556 { 557 Vector3 v; 558 box.GetVertex(i, v); 559 mesh->mVertices.push_back(v); 560 } 561 562 mesh->AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 563 mesh->AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 564 mesh->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 565 566 mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 567 mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 568 mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 569 570 return mesh; 571 } 572 573 574 Mesh::Mesh(const int id, const int vertices, const int faces): 575 mFaces(), 576 mMaterial(NULL), 577 mKdTree(NULL), 578 mVertices(), 579 mIsConvex(false), 580 mIsWatertight(false), 581 mId(id) 582 { 583 mVertices.reserve(vertices); 584 mFaces.reserve(faces); 585 } 586 587 588 Mesh::Mesh(const int id): 589 mId(id), mVertices(), mFaces(), mMaterial(NULL), mKdTree(NULL) 590 {} 591 592 593 // apply transformation to each vertex 594 void Mesh::ApplyTransformation(const Matrix4x4 &m) 595 { 596 VertexContainer::iterator it, it_end = mVertices.end(); 597 598 for (it = mVertices.begin(); it != it_end; ++ it) 599 { 600 (*it) = m * (*it); 601 } 602 } 603 604 605 Mesh::Mesh(const Mesh &rhs) 606 { 607 mVertices = rhs.mVertices; 608 mFaces.reserve(rhs.mFaces.size()); 609 mId = rhs.mId; 610 611 FaceContainer::const_iterator it, it_end = rhs.mFaces.end(); 612 613 for (it = rhs.mFaces.begin(); it != it_end; ++ it) 614 { 615 Face *face = *it; 616 mFaces.push_back(new Face(*face)); 617 } 618 } 619 620 621 Mesh& Mesh::operator=(const Mesh& m) 622 { 623 if (this == &m) 624 return *this; 625 626 CLEAR_CONTAINER(mFaces); 627 628 mVertices = m.mVertices; 629 mFaces.reserve(m.mFaces.size()); 630 //mId = m.mId; 631 632 FaceContainer::const_iterator it, it_end = m.mFaces.end(); 633 634 for (it = m.mFaces.begin(); it != it_end; ++ it) 635 { 636 Face *face = *it; 637 mFaces.push_back(new Face(*face)); 638 } 639 640 return *this; 641 } 642 643 644 645 /********************************************************/ 646 /* MeshInstance implementation */ 647 /********************************************************/ 648 649 int 650 MeshInstance::CastRay( 651 Ray &ray 652 ) 653 { 654 int res = mMesh->CastRay(ray, this); 655 return res; 656 } 657 658 int 659 MeshInstance::CastRay( 660 Ray &ray, 661 const vector<int> &faces 662 ) 663 { 664 return mMesh->CastRayToSelectedFaces(ray, faces, this); 665 } 666 667 668 669 int 670 MeshInstance::GetRandomSurfacePoint(Vector3 &point, Vector3 &normal) 671 { 672 return mMesh->GetRandomSurfacePoint(point, normal); 673 } 674 675 int 676 MeshInstance::GetRandomVisibleSurfacePoint(Vector3 &point, 677 Vector3 &normal, 678 const Vector3 &viewpoint, 679 const int maxTries) 680 { 681 return mMesh->GetRandomVisibleSurfacePoint(point, normal, viewpoint, maxTries); 682 } 683 684 685 void MeshInstance::SetMaterial(Material *mat) 686 { 687 mMaterial = mat; 688 } 689 690 Material *MeshInstance::GetMaterial() const 691 { 692 return mMaterial; 693 } 694 695 696 /*************************************************************/ 697 /* TransformedMeshInstance implementation */ 698 /*************************************************************/ 699 700 TransformedMeshInstance::TransformedMeshInstance(Mesh *mesh): 701 MeshInstance(mesh) 702 { 703 mWorldTransform = IdentityMatrix(); 704 } 705 706 707 int TransformedMeshInstance::GetRandomSurfacePoint(Vector3 &point, Vector3 &normal) 708 { 709 int index = mMesh->GetRandomSurfacePoint(point, normal); 710 point = mWorldTransform*point; 711 normal = TransformNormal(mWorldTransform, normal); 712 return index; 713 } 714 715 716 int TransformedMeshInstance::CastRay(Ray &ray) 560 717 { 561 718 ray.ApplyTransform(Invert(mWorldTransform)); … … 567 724 568 725 569 void 570 Mesh::AddTriangle(const Triangle3 &triangle) 571 { 572 int index = (int)mVertices.size(); 573 574 for (int i=0; i < 3; i++) { 575 mVertices.push_back(triangle.mVertices[i]); 576 } 577 578 AddFace(new Face(index + 0, index + 1, index + 2) ); 579 } 580 581 void 582 Mesh::AddRectangle(const Rectangle3 &rect) 583 { 584 int index = (int)mVertices.size(); 585 586 for (int i=0; i < 4; i++) { 587 mVertices.push_back(rect.mVertices[i]); 588 } 589 590 AddFace(new Face(index + 0, index + 1, index + 2, index + 3) ); 591 } 592 593 void 594 Mesh::AssignRandomMaterial() 595 { 596 if (!mMaterial) 597 mMaterial = new Material; 598 *mMaterial = RandomMaterial(); 599 600 } 601 602 603 Mesh *CreateMeshFromBox(const AxisAlignedBox3 &box) 604 { 605 Mesh *mesh = new Mesh; 606 // add 8 vertices of the box 607 int index = (int)mesh->mVertices.size(); 608 for (int i=0; i < 8; i++) { 609 Vector3 v; 610 box.GetVertex(i, v); 611 mesh->mVertices.push_back(v); 612 } 613 614 mesh->AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 615 mesh->AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 616 mesh->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 617 618 mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 619 mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 620 mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 621 622 return mesh; 623 } 624 625 } 726 void TransformedMeshInstance::ApplyWorldTransform(const Matrix4x4 &m) 727 { 728 mWorldTransform = m * mWorldTransform; 729 } 730 731 732 void TransformedMeshInstance::LoadWorldTransform(const Matrix4x4 &m) 733 { 734 mWorldTransform = m; 735 } 736 737 738 void TransformedMeshInstance::GetWorldTransform(Matrix4x4 &m) 739 { 740 m = mWorldTransform; 741 } 742 743 744 AxisAlignedBox3 TransformedMeshInstance::GetBox() 745 { 746 return Transform(mMesh->mBox, mWorldTransform); 747 } 748 749 750 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h
r991 r1001 70 70 71 71 /// Default constructor 72 Mesh():mVertices(), mFaces(), mMaterial(NULL), mKdTree(NULL) {}73 72 Mesh():mVertices(), mFaces(), mMaterial(NULL), mKdTree(NULL), mId(0) {} 73 74 74 /// Constructor with container preallocation 75 Mesh(const int vertices, 76 const int faces): 75 Mesh(const int vertices, const int faces): 77 76 mFaces(), 78 77 mMaterial(NULL), … … 80 79 mVertices(), 81 80 mIsConvex(false), 82 mIsWatertight(false) 81 mIsWatertight(false), 82 mId(0) 83 83 { 84 84 mVertices.reserve(vertices); 85 85 mFaces.reserve(faces); 86 86 } 87 87 88 /** Constructor setting a unqiue mesh id. 89 */ 90 Mesh(const int id); 91 92 /** Setting unique mesh id and using preallocation. 93 */ 94 Mesh(const int id, const int vertices, const int faces); 95 96 /** Copy constructor making a deep copy of the faces. 97 */ 98 Mesh(const Mesh &rhs); 99 100 /** Assignement operator. 101 @note does not copy id 102 @note preprocess may be necessary 103 */ 104 Mesh& operator=(const Mesh& m); 105 88 106 ~Mesh() { 89 107 for (int i=0; i < mFaces.size(); i++) … … 113 131 114 132 void ComputeBoundingBox(); 133 134 /** This function must be called after creating the mesh 135 because it creates the local kd tree and the bounding box. 136 */ 115 137 void Preprocess(); 116 138 117 /** Axis aligned bounding box of the mesh in local mesh coordinates */ 139 /** Applies transformation to the mesh. 140 @note: meshkdtree will most likely be outdated after transformation, thus 141 another preprocess might be necessary. 142 */ 143 void ApplyTransformation(const Matrix4x4 &m); 144 145 /** Axis aligned bounding box of the mesh in local mesh coordinates. 146 */ 118 147 AxisAlignedBox3 mBox; 119 148 120 /** Vertices forming the mesh */ 149 /** Vertices forming the mesh. 150 */ 121 151 VertexContainer mVertices; 122 152 123 /** Patches forming the mesh */ 153 /** Patches forming the mesh. 154 */ 124 155 FaceContainer mFaces; 125 156 126 /** Global mesh material */ 157 /** Global mesh material. 158 */ 127 159 Material *mMaterial; 128 160 129 /** true if the mesh is a convex mesh */ 161 /** true if the mesh is a convex mesh. 162 */ 130 163 bool mIsConvex; 131 164 132 /** true if the mesh is a convex mesh */ 165 /** true if the mesh is a convex mesh. 166 */ 133 167 bool mIsWatertight; 134 168 135 169 MeshKdTree *mKdTree; 136 137 int 138 CastRay( 139 Ray &ray, 140 MeshInstance *instance 170 171 int 172 CastRay(Ray &ray, MeshInstance *instance); 173 174 int 175 CastRayToSelectedFaces( 176 Ray &ray, 177 const vector<int> &faces, 178 Intersectable *instance 179 ); 180 181 int 182 CastRayToFace( 183 const int faceIndex, 184 Ray &ray, 185 float &nearestT, 186 int &nearestFace, 187 Intersectable *instance 188 ); 189 190 191 int 192 RayFaceIntersection(const int faceIndex, 193 const Ray &ray, 194 float &t, 195 const float nearestT 141 196 ); 142 143 int144 CastRayToSelectedFaces(145 Ray &ray,146 const vector<int> &faces,147 Intersectable *instance148 );149 150 int151 CastRayToFace(152 const int faceIndex,153 Ray &ray,154 float &nearestT,155 int &nearestFace,156 Intersectable *instance157 );158 159 160 int161 RayFaceIntersection(const int faceIndex,162 const Ray &ray,163 float &t,164 const float nearestT165 );166 197 167 198 Plane3 GetFacePlane(const int faceIndex); … … 177 208 const int maxTries 178 209 ); 179 210 211 /** Returns unique mesh id. 212 */ 213 int GetId() const 214 { 215 return mId; 216 } 217 180 218 virtual ostream &Describe(ostream &s) { 181 219 return s<<"Mesh #vertices="<<(int)mVertices.size()<<" #faces="<<(int)mFaces.size(); 182 220 } 183 221 184 /** Creates a mesh from a axis aligned bounding box 222 /** Creates a mesh from a axis aligned bounding box. 223 The mesh is handled from the resource manager. 185 224 */ 186 225 friend Mesh *CreateMeshFromBox(const AxisAlignedBox3 &box); 226 227 228 protected: 229 230 /// Unique id of this mesh. 231 int mId; 187 232 }; 188 233 189 234 190 235 class MeshInstance : public Intersectable { 191 protected: 192 Mesh *mMesh; 193 236 194 237 public: 195 MeshInstance(Mesh *mesh):Intersectable(), mMesh(mesh) 238 MeshInstance(Mesh *mesh):Intersectable(), mMesh(mesh), mMaterial(NULL) 196 239 { 197 240 } … … 238 281 } 239 282 283 /** Sets the material. this overrides the material from 284 the mesh itself. 285 */ 286 void SetMaterial(Material *mat); 287 288 /** Returns the material of this mesh instance. 289 if not defined, returns the material of the mesh itself. 290 */ 291 Material *GetMaterial() const; 292 293 protected: 294 295 Mesh *mMesh; 296 /** This material overrides the mesh material; 297 */ 298 Material *mMaterial; 240 299 }; 241 300 242 301 302 /** This mesh instance includes a world transform. Use this 303 class if the same mesh should be instantiated on different places. 304 */ 243 305 class TransformedMeshInstance : public MeshInstance 244 306 { 245 307 public: 246 TransformedMeshInstance(Mesh *mesh):MeshInstance(mesh) 247 { 248 mWorldTransform = IdentityMatrix(); 249 } 250 251 virtual AxisAlignedBox3 GetBox() { 252 return Transform(mMesh->mBox, 253 mWorldTransform); 254 } 255 256 virtual int 257 CastRay( 258 Ray &ray 259 ); 308 TransformedMeshInstance(Mesh *mesh); 309 310 virtual AxisAlignedBox3 GetBox(); 311 312 313 virtual int CastRay(Ray &ray); 260 314 261 315 virtual int Type() const { return TRANSFORMED_MESH_INSTANCE; } … … 263 317 int GetRandomSurfacePoint(Vector3 &point, Vector3 &normal); 264 318 265 private: 266 Matrix4x4 mWorldTransform; 319 /** Transforms this mesh instance by m. 320 */ 321 void ApplyWorldTransform(const Matrix4x4 &m); 322 323 /** Loads the transformation matrix into this mesh instance. 324 */ 325 void LoadWorldTransform(const Matrix4x4 &m); 326 327 /** The transformation is returned in m. 328 */ 329 void GetWorldTransform(Matrix4x4 &m); 330 331 protected: 332 333 /// the transformation matrix 334 Matrix4x4 mWorldTransform; 267 335 268 336 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r997 r1001 20 20 21 21 22 // HACK 22 // HACK: Artificially modify scene to watch rendercost changes 23 23 static void AddGeometry(SceneGraph *scene) 24 24 { -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r860 r1001 248 248 { 249 249 mEntries.clear(); 250 251 252 250 } 253 251 -
GTP/trunk/Lib/Vis/Preprocessing/src/RenderSampler.cpp
r1000 r1001 19 19 int histoMaxVal = 0; 20 20 int histoIntervals = 0; 21 21 int threshold; 22 bool useOcclusionQueries; 23 22 24 environment->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 23 25 environment->GetIntValue("Preprocessor.histogram.intervals", histoIntervals); 26 environment->GetIntValue("RenderSampler.visibleThreshold", threshold); 27 environment->GetBoolValue("RenderSampler.useOcclusionQueries", useOcclusionQueries); 24 28 29 Debug << "************* render sampler ****************" << endl; 30 Debug << "threshold: " << threshold << endl; 25 31 const int intervals = histoIntervals; 26 32 … … 28 34 29 35 vector<RenderCostSample> samples; 30 36 while (1){cout <<"q";} 31 37 if (renderer) 32 38 { 33 renderer->SampleRenderCost(mSamples, samples );39 renderer->SampleRenderCost(mSamples, samples, useOcclusionQueries, threshold); 34 40 } 35 41 … … 45 51 vector<int> histogram(intervals); 46 52 53 47 54 // initialise histogram 48 55 for (int i = 0; i < intervals; ++ i) -
GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
r863 r1001 12 12 #include "Material.h" 13 13 #include "Environment.h" 14 #include "ResourceManager.h" 15 14 16 15 17 namespace GtpVisibilityPreprocessor { … … 60 62 61 63 SceneGraphNode *root = new SceneGraphNode; 62 Mesh *currentMesh = new Mesh;64 Mesh *currentMesh = MeshManager::GetSingleton()->CreateResource(); 63 65 64 66 int meshGrouping; … … 145 147 c = cht.find(str); 146 148 if (currentMesh->mMaterial == NULL) { 147 Material *mat = new Material;149 Material *mat = MaterialManager::GetSingleton()->CreateResource(); 148 150 if (c != cht.end()) { 149 151 mat->mDiffuseColor = RgbColor((*c).second.x, (*c).second.y, (*c).second.z); … … 151 153 } 152 154 else 153 *mat = RandomMaterial(); 154 currentMesh->mMaterial = mat; 155 currentMesh->AssignRandomMaterial(); 155 156 } 156 157 } -
GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h
r863 r1001 15 15 UnigraphicsParser(): Parser() {} 16 16 17 virtual bool ParseFile(const std::string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); 17 virtual bool ParseFile(const std::string filename, 18 SceneGraphNode **root, 19 const bool loadPolygonsAsMeshes = false); 18 20 19 21 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r882 r1001 647 647 for (int i = 0; i < limit; ++i) 648 648 { 649 Intersectable *object = objects[i];//*it; 649 Intersectable *object = objects[i]; 650 650 651 Mesh *mesh = NULL; 651 652 … … 658 659 mesh = dynamic_cast<ViewCell *>(object)->GetMesh(); 659 660 break; 660 // TODO: handle transformed mesh instances 661 case Intersectable::TRANSFORMED_MESH_INSTANCE: 662 { 663 TransformedMeshInstance *mi = 664 dynamic_cast<TransformedMeshInstance *>(object); 665 666 if (!mi->GetMesh()) 667 break; 668 669 mesh = new Mesh(*mi->GetMesh()); 670 671 Matrix4x4 m; 672 mi->GetWorldTransform(m); 673 mesh->ApplyTransformation(m); 674 675 break; 676 } 661 677 default: 662 678 Debug << "intersectable type not supported" << endl; … … 667 683 { 668 684 if (addToBbox) 669 {670 685 mBox.Include(object->GetBox()); // add to BSP tree aabb 671 } 672 686 673 687 AddMeshToPolygons(mesh, polys, mOutOfBoundsCell); 674 } 688 689 // cleanup 690 if (object->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 691 DEL_PTR(mesh); 692 } 675 693 } 676 694 … … 2851 2869 mPolys.reserve(rhs.mPolys.size()); 2852 2870 mPlanes.reserve(rhs.mPolys.size()); 2853 2854 2871 2855 2872 PolygonContainer::const_iterator it, it_end = rhs.mPolys.end(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r997 r1001 17 17 #include "BoundingBoxConverter.h" 18 18 #include "GlRenderer.h" 19 19 #include "ResourceManager.h" 20 20 21 21 … … 211 211 else 212 212 DEL_PTR(mViewCellsTree); 213 214 CLEAR_CONTAINER(mMeshContainer);215 213 } 216 214 … … 942 940 mEnvironment->GetIntValue("ViewCells.Evaluation.histoStepSize", histoStepSize); 943 941 944 Debug << "here21 " << histoStepSize << endl;945 942 const int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); 946 943 … … 1442 1439 viewCells.push_back(viewCell); 1443 1440 } 1444 //TODO: transformed meshes 1441 else if (object->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 1442 { 1443 TransformedMeshInstance *mi = dynamic_cast<TransformedMeshInstance *>(object); 1444 1445 Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 1446 1447 // copy mesh 1448 *mesh = *mi->GetMesh(); 1449 1450 // transform mesh 1451 Matrix4x4 m; 1452 mi->GetWorldTransform(m); 1453 mesh->ApplyTransformation(m); 1454 1455 // create bb + kd tree 1456 mesh->Preprocess(); 1457 1458 ViewCell *viewCell = GenerateViewCell(mi->GetMesh()); 1459 viewCells.push_back(viewCell); 1460 1461 break; 1462 } 1445 1463 } 1446 1464 } … … 1451 1469 { 1452 1470 // one mesh per view cell 1453 Mesh *mesh = new Mesh();1471 Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 1454 1472 1455 1473 //-- construct prism … … 1501 1519 // implemented in subclasses 1502 1520 } 1521 1503 1522 1504 1523 // fast way of merging 2 view cells … … 1964 1983 { 1965 1984 if (!(*it)->GetMesh()) 1985 { 1966 1986 CreateMesh(*it); 1987 } 1967 1988 } 1968 1989 } … … 2010 2031 } 2011 2032 2033 2012 2034 static const bool USE_ASCII = true; 2035 2013 2036 2014 2037 bool ViewCellsManager::ExportBoundingBoxes(const string filename, … … 2776 2799 mBspTree->ConstructGeometry(vc, geom); 2777 2800 2778 Mesh *mesh = new Mesh();2801 Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 2779 2802 2780 2803 IncludeNodeGeomInMesh(geom, *mesh); 2781 2804 vc->SetMesh(mesh); 2782 2783 // put mesh into mesh container so we can savely delete it2784 mMeshContainer.push_back(mesh);2785 2805 } 2786 2806 … … 4712 4732 cout << "starting sampling of render cost ... "; 4713 4733 4714 preprocessor->GetRenderer()->SampleRenderCost(numSamples, samples );4734 preprocessor->GetRenderer()->SampleRenderCost(numSamples, samples, true); 4715 4735 4716 4736 cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; … … 4725 4745 { 4726 4746 RenderCostSample sample = *rit; 4727 4747 4728 4748 ViewCell *vc = GetViewCell(sample.mPosition); 4729 4749 4730 4750 AxisAlignedBox3 box(sample.mPosition - Vector3(1, 1, 1), sample.mPosition + Vector3(1, 1, 1)); 4731 4732 4751 Mesh *hMesh = CreateMeshFromBox(box); 4733 4752 … … 4791 4810 { 4792 4811 // export mesh if available 4793 /* if (vc->GetMesh()) 4812 // TODO: some bug here? 4813 if (0 && vc->GetMesh()) 4794 4814 { 4795 4815 exporter->ExportMesh(vc->GetMesh()); 4796 4816 } 4797 4817 else 4798 { */4818 { 4799 4819 BspNodeGeometry geom; 4800 4820 mVspBspTree->ConstructGeometry(vc, geom); 4801 4821 exporter->ExportPolygons(geom.GetPolys()); 4802 //}4822 } 4803 4823 } 4804 4824 } … … 4814 4834 // compute max height difference 4815 4835 for (int i = 0; i < (int)leaves.size(); ++ i) 4836 { 4816 4837 for (int j = 0; j < (int)leaves.size(); ++ j) 4817 { 4818 BspLeaf *leaf = dynamic_cast<BspViewCell *>(leaves[i])->mLeaf; 4819 4820 if (i != j) 4821 { 4822 BspLeaf *leaf2 =dynamic_cast<BspViewCell *>(leaves[j])->mLeaf; 4823 int dist = mVspBspTree->TreeDistance(leaf, leaf2); 4824 if (dist > maxDist) 4825 maxDist = dist; 4838 { 4839 BspLeaf *leaf = dynamic_cast<BspViewCell *>(leaves[i])->mLeaf; 4840 4841 if (i != j) 4842 { 4843 4844 BspLeaf *leaf2 =dynamic_cast<BspViewCell *>(leaves[j])->mLeaf; 4845 4846 int dist = mVspBspTree->TreeDistance(leaf, leaf2); 4847 4848 if (dist > maxDist) 4849 maxDist = dist; 4850 } 4826 4851 } 4827 4852 } … … 4850 4875 mVspBspTree->ConstructGeometry(vc, geom); 4851 4876 4852 Mesh *mesh = new Mesh();4877 Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 4853 4878 IncludeNodeGeomInMesh(geom, *mesh); 4854 4879 4855 4880 vc->SetMesh(mesh); 4856 // put mesh into mesh container so we can savely delete it4857 mMeshContainer.push_back(mesh);4858 4881 } 4859 4882 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r991 r1001 170 170 void AddViewCell(ViewCell *viewCell); 171 171 172 /** Derive view cells from objects. 172 /** Derive view cells from objects. The view ells are created by taking the object 173 geometry into account. 173 174 */ 174 175 void DeriveViewCells(const ObjectContainer &objects, … … 597 598 /// the scene bounding box 598 599 AxisAlignedBox3 mViewSpaceBox; 599 /// holds the view cell meshes 600 MeshContainer mMeshContainer; 600 601 601 /// if view cells should be exported 602 602 bool mExportViewCells; -
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
r863 r1001 24 24 } 25 25 26 26 27 VrmlExporter::~VrmlExporter() 27 28 { … … 31 32 32 33 bool VrmlExporter::ExportRays(const RayContainer &rays, 33 const float length,34 const RgbColor &color)34 const float length, 35 const RgbColor &color) 35 36 { 36 37 RayContainer::const_iterator ri = rays.begin(); … … 115 116 for (; ri != rays.end(); ri++) { 116 117 const Vector3 a = (*ri)->GetOrigin(); 117 //const Vector3 b = (*ri)->mTerminationObject ? (*ri)->GetTermination() : a + 1000 * Normalize((*ri)->GetDir());118 const Vector3 b = (*ri)->GetTermination(); // matt: change again!!118 const Vector3 b = (*ri)->mTerminationObject ? (*ri)->GetTermination() : a + 1000 * Normalize((*ri)->GetDir()); 119 //const Vector3 b = (*ri)->GetTermination(); // matt: change back!! 119 120 120 121 stream<<a.x<<" "<<a.y<<" "<<a.z<<" ,"; … … 152 153 } 153 154 155 154 156 void VrmlExporter::ExportIntersectable(Intersectable *object) 155 157 { 156 158 switch (object->Type()) 157 159 { 158 159 160 case Intersectable::MESH_INSTANCE: 161 ExportMeshInstance((MeshInstance *)object); 162 break; 160 163 case Intersectable::TRANSFORMED_MESH_INSTANCE: 161 Export MeshInstance((MeshInstance *)object);164 ExportTransformedMeshInstance(dynamic_cast<TransformedMeshInstance *>(object)); 162 165 break; 163 166 case Intersectable::VIEW_CELL: … … 180 183 181 184 185 void VrmlExporter::ExportTransformedMeshInstance(TransformedMeshInstance *mi) 186 { 187 Mesh mesh(*mi->GetMesh()); 188 189 Matrix4x4 m; 190 mi->GetWorldTransform(m); 191 mesh.ApplyTransformation(m); 192 193 ExportMesh(&mesh); 194 } 195 196 182 197 void VrmlExporter::ExportViewCells(const ViewCellContainer &viewCells) 183 198 { … … 189 204 } 190 205 } 206 191 207 192 208 void VrmlExporter::ExportBspLeaves(const BspTree &tree, const int maxPvs) … … 290 306 stream << "}" << endl; // end material 291 307 stream << "}" << endl; // end apperance 292 //stream << "}" << endl; // end shape 293 308 294 309 295 310 // wireframe modes => set indexed lines … … 314 329 { 315 330 Face *face = *fi; 316 331 317 332 VertexIndexContainer::const_iterator vi = face->mVertexIndices.begin(); 318 319 for (; vi != face->mVertexIndices.end(); vi++)333 334 for (; vi != face->mVertexIndices.end(); ++ vi) 320 335 { 321 336 stream << *vi << " "; … … 331 346 332 347 stream << "]" << endl; // end coordIndex 333 348 334 349 335 350 stream << "coord Coordinate {" << endl; … … 385 400 stream << "}" << endl; // end material 386 401 stream << "}" << endl; // end apperance 387 //stream << "}" << endl; // end shape 388 402 389 403 390 404 // wireframe modes => set indexed lines -
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.h
r860 r1001 85 85 86 86 virtual void 87 ExportTransformedMeshInstance(TransformedMeshInstance *mi); 88 89 virtual void 87 90 ExportIntersectable(Intersectable *object); 88 91 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r978 r1001 313 313 mesh = dynamic_cast<ViewCell *>(object)->GetMesh(); 314 314 break; 315 // TODO: handle transformed mesh instances 315 case Intersectable::TRANSFORMED_MESH_INSTANCE: 316 { 317 TransformedMeshInstance *mi = dynamic_cast<TransformedMeshInstance *>(object); 318 319 if (!mi->GetMesh()) 320 break; 321 322 mesh = new Mesh(*mi->GetMesh()); 323 324 Matrix4x4 m; 325 mi->GetWorldTransform(m); 326 327 mesh->ApplyTransformation(m); 328 329 break; 330 } 316 331 default: 317 332 Debug << "intersectable type not supported" << endl; … … 323 338 mBox.Include(object->GetBox()); // add to BSP tree aabb 324 339 AddMeshToPolygons(mesh, polys, NULL); 340 341 // cleanup 342 if (object->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 343 DEL_PTR(mesh); 325 344 } 326 345 } -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp
r863 r1001 198 198 X3dExporter::ExportIntersectable(Intersectable *object) 199 199 { 200 switch (object->Type()) { 201 case Intersectable::MESH_INSTANCE: 202 case Intersectable::TRANSFORMED_MESH_INSTANCE: 203 ExportMeshInstance((MeshInstance *)object); 204 break; 205 case Intersectable::VIEW_CELL: 206 ExportViewCell((ViewCell *)object); 207 break; 208 default: 209 cerr<<"Sorry the export for object not yet defined"<<endl; 210 break; 211 } 200 switch (object->Type()) 201 { 202 case Intersectable::MESH_INSTANCE: 203 ExportMeshInstance((MeshInstance *)object); 204 break; 205 case Intersectable::TRANSFORMED_MESH_INSTANCE: 206 ExportTransformedMeshInstance(dynamic_cast<TransformedMeshInstance *>(object)); 207 break; 208 case Intersectable::VIEW_CELL: 209 ExportViewCell((ViewCell *)object); 210 break; 211 default: 212 cerr << "Sorry the export for object not yet defined" << endl; 213 break; 214 } 212 215 } 213 216 … … 223 226 224 227 228 void 229 X3dExporter::ExportTransformedMeshInstance(TransformedMeshInstance *mi) 230 { 231 Mesh mesh(*mi->GetMesh()); 232 233 Matrix4x4 m; 234 mi->GetWorldTransform(m); 235 mesh.ApplyTransformation(m); 236 237 ExportMesh(&mesh); 238 } 239 240 225 241 void 226 242 X3dExporter::ExportViewCells(const ViewCellContainer &viewCells) … … 231 247 ExportViewCell(*it); 232 248 } 249 233 250 234 251 void … … 321 338 b = RandomValue(0.5, 1.0); 322 339 } 340 323 341 stream<<"<Material diffuseColor=\""<<r<<" "<<g<<" "<<b<< 324 342 "\" specularColor=\"0.0 0.0 0.0\"/>"<<endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h
r863 r1001 85 85 86 86 virtual void 87 ExportTransformedMeshInstance(TransformedMeshInstance *mi); 88 89 virtual void 87 90 ExportIntersectable(Intersectable *object); 88 91 -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
r971 r1001 29 29 #include "Triangle3.h" 30 30 #include "ViewCellsManager.h" 31 #include "ResourceManager.h" 31 32 32 33 namespace GtpVisibilityPreprocessor { … … 60 61 #define ROTATE_SCENE 0 61 62 62 63 static void RotateMesh(Mesh *mesh) 63 static int sUniqueMeshIdx = 0; 64 65 // hack: rotate mesh by n degrees 66 static void RotateMesh(Mesh *mesh, const float angle) 64 67 { 65 68 VertexContainer::iterator it, it_end = mesh->mVertices.end(); 66 69 67 const float angle = 30.0f* PI / 180.0f;68 const Matrix4x4 rot = RotationYMatrix(angle );70 const float angleRad = angle * PI / 180.0f; 71 const Matrix4x4 rot = RotationYMatrix(angleRad); 69 72 70 73 for (it = mesh->mVertices.begin(); it != it_end; ++ it) … … 83 86 , mSpaceCount(0) 84 87 , mLoadPolygonsAsMeshes(loadPolygonsAsMeshes) 85 { 86 mCurrentNode = root; 87 // this matrix should never be removed from stack 88 //mTransformations.push(IdentityMatrix()); 88 , mCurrentMesh(NULL) 89 { 90 mCurrentNode = root; 91 92 // this matrix should never be removed from stack 93 //mTransformations.push(IdentityMatrix()); 89 94 } 90 95 … … 99 104 // StdInParseHandlers: Implementation of the SAX DocumentHandler interface 100 105 // --------------------------------------------------------------------------- 106 101 107 void X3dParseHandlers::endElement(const XMLCh* const name) 102 108 { 103 StrX lname(name); 104 string element(lname.LocalForm()); 105 106 // only create new mesh instance if define mechanism was not used 107 if (element == "Shape") 108 EndShape(); 109 110 if (element == "Transform") 111 EndTransform(); 112 } 113 114 115 116 117 void X3dParseHandlers::ApplyTransformation(Mesh *mesh, 118 const Matrix4x4 &m) const 119 { 120 VertexContainer::iterator it, it_end = mesh->mVertices.end(); 121 122 for (it = mesh->mVertices.begin(); it != it_end; ++ it) 123 { 124 (*it) = m * (*it); 125 } 109 StrX lname(name); 110 string element(lname.LocalForm()); 111 112 // only create new mesh instance if define mechanism was not used 113 if (element == "Shape") 114 EndShape(); 115 116 if (element == "Transform") 117 EndTransform(); 126 118 } 127 119 … … 134 126 trafos.pop(); 135 127 136 ApplyTransformation(mesh, m); 137 } 138 } 128 mesh->ApplyTransformation(m); 129 } 130 } 131 132 133 void X3dParseHandlers::ApplyTransformations(TrafoStack trafos, 134 TransformedMeshInstance *mi) const 135 { 136 while (!trafos.empty()) 137 { 138 const Matrix4x4 m = trafos.top(); 139 trafos.pop(); 140 141 mi->ApplyWorldTransform(m); 142 } 143 } 144 139 145 140 146 void X3dParseHandlers::StartTransform(AttributeList& attributes) … … 143 149 144 150 const int len = attributes.getLength(); 151 145 152 Matrix4x4 *rotm = NULL; 146 153 Matrix4x4 *scalem = NULL; … … 208 215 void X3dParseHandlers::EndShape() 209 216 { 210 // this shape is a definition => don't create mesh instance 211 if (mIsMeshDefinition) 212 { 213 mMeshDefinitions[mCurrentMeshName.c_str()] = mCurrentMesh; 214 //cout << "new definition: " << mCurrentMeshName << endl; 217 //-- if shape is merely a definition => don't create particular mesh instance 218 if (!mCurrentMesh || mIsMeshDefinition) 219 { 220 return; 221 } 222 223 //-- each polygon is one single mesh 224 if (mLoadPolygonsAsMeshes) 225 { 226 FaceContainer::const_iterator fit, fit_end = mCurrentMesh->mFaces.end(); 227 228 cout << "m"; 215 229 216 return; 217 } 218 219 // each polygon is one single mesh 220 if (mLoadPolygonsAsMeshes) 221 { 222 //if (mCurrentMesh->mFaces.empty()) cout << "error!" << endl; 223 224 FaceContainer::const_iterator fit, fit_end = mCurrentMesh->mFaces.end(); 225 226 cout << "m"; 227 //cout << "m: " << mCurrentMesh->mFaces.size() << endl; 228 for (fit = mCurrentMesh->mFaces.begin(); fit != fit_end; ++ fit) 229 { 230 cout << "f"; 231 232 Face *face = *fit; 233 // only one face per mesh 234 Mesh *mesh = new Mesh(); 235 VertexIndexContainer vc; 236 237 VertexIndexContainer::const_iterator vit, vit_end = face->mVertexIndices.end(); 230 for (fit = mCurrentMesh->mFaces.begin(); fit != fit_end; ++ fit) 231 { 232 cout << "f"; 233 234 Face *face = *fit; 235 236 // we create a new mesh for each face from the current mesh 237 Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 238 238 239 int i = 0; 240 for (vit = face->mVertexIndices.begin(); vit != vit_end; ++ vit, ++ i) 239 VertexIndexContainer::const_iterator vit, vit_end = face->mVertexIndices.end(); 240 241 int i = 0; 242 VertexIndexContainer vcIndices; 243 244 for (vit = face->mVertexIndices.begin(); vit != vit_end; ++ vit, ++ i) 245 { 246 cout << "i"; 247 const int index = (*vit); 248 249 // add vertices 250 mesh->mVertices.push_back(mCurrentMesh->mVertices[index]); 251 252 // indices don't make much sense if mesh = face, but 253 // we need them anyway ... 254 vcIndices.push_back(i); 255 } 256 257 mesh->mFaces.push_back(new Face(vcIndices)); 258 259 // NOTE: should rather be written into trafo of mesh instance 260 ApplyTransformations(mTransformations, mesh); 261 262 mesh->Preprocess(); 263 264 // make an instance of this mesh 265 MeshInstance *mi = new MeshInstance(mesh); 266 mCurrentNode->mGeometry.push_back(mi); 267 } 268 269 // this mesh is not needed, unless it is used as a definition 270 if (!mUsingMeshDefinition) 271 MeshManager::GetSingleton()->DestroyEntry(mCurrentMesh->GetId()); 272 } 273 else // default usage: create a mesh instance from the current mesh 274 { 275 MeshInstance *mi; 276 277 if (0 && !mUsingMeshDefinition) 278 { 279 // make an instance of this mesh 280 mi = new MeshInstance(mCurrentMesh); 281 282 // this mesh is used only once => write transformations directly into it 283 ApplyTransformations(mTransformations, mCurrentMesh); 284 } 285 else 286 { 287 // make an instance of this mesh 288 TransformedMeshInstance *tmi = new TransformedMeshInstance(mCurrentMesh); 289 290 // apply transformation on the instance of the mesh 291 ApplyTransformations(mTransformations, tmi); 292 293 mi = tmi; 294 } 295 296 if (mCurrentMaterial) 297 { 298 // HACK: add the material to the mesh directly if no material yet 299 if (mCurrentMesh->mMaterial) 241 300 { 242 cout << "i"; 243 int index = (*vit); 244 // add vertices 245 mesh->mVertices.push_back(mCurrentMesh->mVertices[index]); 246 vc.push_back(i); 301 mCurrentMesh->mMaterial = mCurrentMaterial; 247 302 } 248 249 mesh->mFaces.push_back(new Face(vc)); 250 251 // NOTE: should rather be written into trafo of mesh instance 252 ApplyTransformations(mTransformations, mesh); 253 254 mesh->Preprocess(); 255 256 // make an instance of this mesh 257 MeshInstance *mi = new MeshInstance(mesh); 258 mCurrentNode->mGeometry.push_back(mi); 259 } 260 261 // LEAK!! TODO: delete if not defd 262 if (!mUsingMeshDefinition) 263 delete mCurrentMesh; 264 265 //mCurrentVertices.clear(); 266 //mCurrentVertexIndices.clear(); 267 } 268 else 269 { 270 if (!mCurrentMesh->mFaces.empty()) 271 { 272 // should rather be written into the transformation 273 // of a mesh instance 274 ApplyTransformations(mTransformations, mCurrentMesh); 275 276 mCurrentMesh->Preprocess(); 277 // make an instance of this mesh 278 MeshInstance *mi = new MeshInstance(mCurrentMesh); 279 280 mCurrentNode->mGeometry.push_back(mi); 281 // set the object id to a unique value 282 //mi->SetId(mCurrentObjectId ++); 283 } 284 else 285 { 286 // empty mesh => discard 287 cout<<"X"; 288 289 delete mCurrentMesh; 290 } 291 303 else // add material to the instance 304 { 305 mi->SetMaterial(mCurrentMaterial); 306 } 307 } 308 309 // create local mesh kd tree 310 mCurrentMesh->Preprocess(); 311 // add to scene graph 312 mCurrentNode->mGeometry.push_back(mi); 313 314 // reset current mesh 292 315 mCurrentMesh = NULL; 293 316 } … … 297 320 void X3dParseHandlers::StartIndexedFaceSet(AttributeList& attributes) 298 321 { 299 int len = attributes.getLength(); 300 301 int i; 302 322 //-- indexedfaceset corresponds to Mesh in our implementation 323 const int len = attributes.getLength(); 324 325 VertexIndexContainer vertices; 303 326 304 327 mIsMeshDefinition = false; 305 328 mUsingMeshDefinition = false; 306 for (i = 0; i < len; ++ i) 329 330 for (int i = 0; i < len; ++ i) 307 331 { 308 string attrName(StrX(attributes.getName(i)).LocalForm()); 309 310 // this is a definition of a mesh 311 if (attrName == "DEF") 312 { 332 const string attrName(StrX(attributes.getName(i)).LocalForm()); 333 334 //-- we use an already defined mesh 335 if (attrName == "USE") 336 { 337 StrX attrValue(attributes.getValue(i)); 338 const char *meshName = attrValue.LocalForm(); 339 340 mUsingMeshDefinition = true; 341 342 // retrieve mesh from mesh container 343 const int meshIdx = mMeshDefinitions[meshName]; 344 345 mCurrentMesh = 346 MeshManager::GetSingleton()->FindEntry(meshIdx); 347 348 //Debug << "retrieving mesh definition: " << mCurrentMeshName << endl; 349 cout << "u"; 350 } 351 else if (attrName == "DEF") //-- a definition of a mesh 352 { 353 const StrX attrValue(attributes.getValue(i)); 354 const char *meshName = attrValue.LocalForm(); 355 356 // this is only a definition, don't create actual instance 313 357 mIsMeshDefinition = true; 358 359 //-- create new mesh definition 360 mCurrentMesh = MeshManager::GetSingleton()->CreateResource(); 361 362 // store the mesh defination in a lookup table 363 mMeshDefinitions[meshName] = mCurrentMesh->GetId(); 364 cout << "d"; 365 } 366 367 //-- read coordinate indices for current mesh 368 else if (attrName == "coordIndex") 369 { 314 370 StrX attrValue(attributes.getValue(i)); 315 371 const char *ptr = attrValue.LocalForm(); 316 mCurrentMeshName = ptr; 317 318 cout << "d"; 319 } 320 321 // we use an already defined mesh 322 if (attrName == "USE") 323 { 324 StrX attrValue(attributes.getValue(i)); 325 326 // discard new mesh and assign defined mesh 327 DEL_PTR(mCurrentMesh); 328 const char *ptr = attrValue.LocalForm(); 329 330 mCurrentMesh = mMeshDefinitions[ptr]; 331 mUsingMeshDefinition = true; 332 cout << "u"; 333 } 334 335 if (attrName == "coordIndex") 336 { 337 StrX attrValue(attributes.getValue(i)); 372 373 //-- immediate use: create a new mesh using a generic name 374 if (!mCurrentMesh) 375 { 376 mCurrentMesh = MeshManager::GetSingleton()->CreateResource(); 377 } 378 338 379 // handle coordIndex 339 380 vertices.clear(); 340 const char *ptr = attrValue.LocalForm();381 341 382 342 383 char *endptr; … … 372 413 373 414 void 374 X3dParseHandlers::StartMaterial( 375 AttributeList& attributes) 376 { 377 int len = attributes.getLength(); 378 int i; 379 if (!mCurrentMesh->mMaterial) 380 mCurrentMesh->mMaterial = new Material; 381 for (i=0; i < len; i++) { 382 string attrName(StrX(attributes.getName(i)).LocalForm()); 383 StrX attrValue(attributes.getValue(i)); 384 const char *ptr = attrValue.LocalForm(); 385 if (attrName == "diffuseColor") { 386 float r, g, b; 387 if (sscanf(ptr, "%f %f %f", &r, &g, &b) == 3) 388 mCurrentMesh->mMaterial->mDiffuseColor = RgbColor(r, g, b); 389 } 390 } 391 } 392 393 void 394 X3dParseHandlers::StartCoordinate( 395 AttributeList& attributes) 396 { 397 int len = attributes.getLength(); 415 X3dParseHandlers::StartMaterial(AttributeList& attributes) 416 { 417 const int len = attributes.getLength(); 418 419 mCurrentMaterial = MaterialManager::GetSingleton()->CreateResource(); 420 421 for (int i = 0; i < len; ++ i) 422 { 423 const string attrName(StrX(attributes.getName(i)).LocalForm()); 424 425 const StrX attrValue(attributes.getValue(i)); 426 const char *ptr = attrValue.LocalForm(); 427 428 429 //-- we use an already defined material 430 if (attrName == "USE") 431 { 432 //mUsingMaterialDefinition = true; 433 string matName(ptr); 434 435 // retrieve mesh from mesh container 436 const int matIdx = mMaterialDefinitions[matName]; 437 438 mCurrentMaterial = 439 MaterialManager::GetSingleton()->FindEntry(matIdx); 440 441 //Debug << "retrieving mesh definition: " << mCurrentMeshName << endl; 442 cout << "u"; 443 } 444 else if (attrName == "DEF") //-- a definition of a material 445 { 446 //mIsMaterialDefinition = true; 447 string matName(ptr); 448 449 //-- create new material definition 450 mCurrentMaterial = MaterialManager::GetSingleton()->CreateResource(); 451 // store the mesh defination in a lookup table 452 mMaterialDefinitions[matName] = mCurrentMaterial->GetId(); 453 cout << "d"; 454 } 455 // TODO: support not only diffuse material 456 else if (attrName == "diffuseColor") 457 { 458 float r, g, b; 459 460 if (sscanf(ptr, "%f %f %f", &r, &g, &b) == 3) 461 mCurrentMaterial->mDiffuseColor = RgbColor(r, g, b); 462 } 463 } 464 } 465 466 467 void 468 X3dParseHandlers::StartCoordinate(AttributeList& attributes) 469 { 470 const int len = attributes.getLength(); 398 471 399 472 int i; … … 402 475 for (i=0; i < len; i++) 403 476 { 404 string attrName(StrX(attributes.getName(i)).LocalForm());477 const string attrName(StrX(attributes.getName(i)).LocalForm()); 405 478 406 479 if (attrName == "point") … … 441 514 vertices.push_back(v); 442 515 } 443 516 517 // substitute vertices into current mesh 444 518 mCurrentMesh->mVertices = vertices; 445 519 } … … 456 530 457 531 if (element == "IndexedFaceSet") { 458 459 532 // create a new mesh node in the scene graph 533 StartIndexedFaceSet(attributes); 460 534 } 461 535 462 536 if (element == "Shape") { 463 cout << "+"; 464 mCurrentMesh = new Mesh; 537 cout << "+"; 538 539 // reset current shape values 540 mCurrentMesh = NULL; 541 mCurrentMaterial = NULL; 542 mCurrentVertexIndices.clear(); 543 //mCurrentVertices.clear(); 465 544 } 466 545 467 if (element == "Coordinate") 468 { 469 if (mCurrentMesh) 470 StartCoordinate(attributes); 546 if (element == "Coordinate") { 547 StartCoordinate(attributes); 471 548 } 472 473 if (element == "Material") { 474 StartMaterial(attributes); 549 550 // todo 551 if (0 && element == "Material") { 552 StartMaterial(attributes); 475 553 } 476 554 … … 479 557 } 480 558 481 mElementCount++;559 ++ mElementCount; 482 560 mAttrCount += attributes.getLength(); 483 561 } … … 485 563 void 486 564 X3dParseHandlers::characters(const XMLCh* const chars, 487 565 const unsigned int length) 488 566 { 489 567 mCharacterCount += length; … … 492 570 void 493 571 X3dParseHandlers::ignorableWhitespace(const XMLCh* const chars, 494 572 const unsigned int length) 495 573 { 496 574 mSpaceCount += length; … … 507 585 508 586 509 510 587 // --------------------------------------------------------------------------- 511 588 // StdInParseHandlers: Overrides of the SAX ErrorHandler interface 512 589 // --------------------------------------------------------------------------- 590 591 513 592 void 514 593 X3dParseHandlers::error(const SAXParseException& e) … … 600 679 const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis(); 601 680 parser->parse(filename.c_str()); 681 602 682 const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); 603 683 duration = endMillis - startMillis; … … 674 754 void X3dViewCellsParseHandlers::endElement(const XMLCh* const name) 675 755 { 676 StrX lname(name); 677 string element(lname.LocalForm()); 678 679 if (element == "Shape") 680 EndShape(); 756 StrX lname(name); 757 758 string element(lname.LocalForm()); 759 760 if (element == "Shape") 761 EndShape(); 681 762 } 682 763 … … 694 775 int i; 695 776 696 // clear previous vertex indices697 mCurrentVertexIndices.clear();698 699 700 777 for (i=0; i < len; i++) 701 778 { -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParserXerces.h
r971 r1001 22 22 23 23 24 struct ltstr25 {26 bool operator()(const string &s1, const string &s2) const27 {28 return s1 < s2;29 }30 };31 32 typedef map<string, Mesh *, ltstr> MeshDefinitions;33 typedef map<string, Material *, ltstr> MaterialDefinitions;34 24 35 25 class X3dParseHandlers : public HandlerBase 36 26 { 37 27 public: 28 29 // used for generating name / key pair 30 struct ltstr 31 { 32 bool operator()(const std::string &s1, const std::string &s2) const 33 { 34 return s1 < s2; 35 } 36 }; 37 38 typedef map<string, int, ltstr> ResourceDefinitions; 39 38 40 // ----------------------------------------------------------------------- 39 41 // Constructors and Destructor … … 77 79 78 80 SceneGraphNode *mCurrentNode; 79 Mesh *mCurrentMesh;81 80 82 vector<VertexIndexContainer> mCurrentVertexIndices; 81 83 VertexContainer mCurrentVertices; 82 string mCurrentMeshName; 84 85 //string mCurrentMeshName; 86 Mesh *mCurrentMesh; 83 87 84 88 Material *mCurrentMaterial; … … 89 93 90 94 bool mUsingMeshDefinition; 95 91 96 // stack of accumulated transformations 92 97 TrafoStack mTransformations; 93 98 94 MaterialDefinitions mMaterialDefinitions; 95 MeshDefinitions mMeshDefinitions; 96 97 // TODO: for storing meshes 98 MeshContainer *mMeshes; 99 ResourceDefinitions mMaterialDefinitions; 100 ResourceDefinitions mMeshDefinitions; 101 99 102 bool mIsMeshDefinition; 103 100 104 // Handlers for X3D 101 105 void … … 122 126 /// transforms mesh using the given transformations 123 127 void ApplyTransformations(TrafoStack trafos, Mesh *mesh) const; 124 128 void ApplyTransformations(TrafoStack trafos, TransformedMeshInstance *mi) const; 129 130 static int mUniqueMeshIdx; 125 131 126 132 // ----------------------------------------------------------------------- … … 200 206 201 207 VertexIndexContainer mCurrentVertexIndices; 202 208 VertexContainer mCurrentVertices; 209 203 210 // Handlers for X3D 204 211 void -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r997 r1001 15 15 #include "PreprocessorThread.h" 16 16 #include "RenderSampler.h" 17 #include "ResourceManager.h" 17 18 18 19 #include <QApplication> … … 143 144 144 145 146 int returnCode = 0; 147 145 148 if (app) 146 returnapp->exec();149 returnCode = app->exec(); 147 150 148 // clean up151 // clean up 149 152 DEL_PTR(p); 150 153 DEL_PTR(environment); 154 MeshManager::DelSingleton(); 155 MaterialManager::DelSingleton(); 151 156 152 return 0; 157 158 return returnCode; 153 159 } 154 160
Note: See TracChangeset
for help on using the changeset viewer.