From 5f735b4e5071878b5c840655ea2d20c6ec56c3cd Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Tue, 2 Jun 2015 19:34:19 -0700 Subject: [PATCH 001/203] Changes to makepanda to compile with Assimp This includes updating header files for Assimp 3. --- makepanda/makepanda.py | 14 +++++++++++++- pandatool/src/assimp/assimpLoader.cxx | 2 +- pandatool/src/assimp/assimpLoader.h | 3 ++- pandatool/src/assimp/config_assimp.h | 2 -- pandatool/src/assimp/p3assimp_composite1.cxx | 7 +++++++ pandatool/src/assimp/pandaIOStream.h | 2 +- pandatool/src/assimp/pandaIOSystem.h | 2 +- pandatool/src/assimp/pandaLogger.cxx | 2 +- pandatool/src/assimp/pandaLogger.h | 2 +- 9 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 pandatool/src/assimp/p3assimp_composite1.cxx diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 487d964d8f..6cec559b8a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -87,7 +87,7 @@ PkgListSet(["PYTHON", "DIRECT", # Python support "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics "SPEEDTREE", # SpeedTree "ZLIB", "PNG", "JPEG", "TIFF", "SQUISH", "FREETYPE", # 2D Formats support - ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", # 3D Formats support + ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", # 3D Formats support "VRPN", "OPENSSL", # Transport "FFTW", # Algorithm helpers "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality @@ -595,6 +595,7 @@ if (COMPILER == "MSVC"): if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib") if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib") if (PkgSkip("FCOLLADA")==0): LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib") + if (PkgSkip("ASSIMP")==0): PkgDisable("ASSIMP") # Not yet supported if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib") if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib") if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib") @@ -737,6 +738,7 @@ if (COMPILER=="GCC"): SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS') SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h") SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h")) + SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp") SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ffmpeg_libs) SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale", "libswscale/swscale.h"), target_pkg = "FFMPEG") SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample", "libswresample/swresample.h"), target_pkg = "FFMPEG") @@ -5207,6 +5209,16 @@ if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0): TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj') TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON']) +# +# DIRECTORY: pandatool/src/assimp +# +if (PkgSkip("PANDATOOL") == 0 and PkgSkip("ASSIMP")==0): + OPTS=['DIR:pandatool/src/assimp', 'ASSIMP', 'MODULE'] + TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx') + TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj') + TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS) + TargetAdd('libp3assimp.dll', opts=OPTS) + # # DIRECTORY: pandatool/src/daeprogs/ # diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index 2dcd3f36e8..384462fc77 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -36,7 +36,7 @@ #include "pandaIOSystem.h" #include "pandaLogger.h" -#include "aiPostProcess.h" +#include "assimp/postprocess.h" //////////////////////////////////////////////////////////////////// // Function: AssimpLoader::Constructor diff --git a/pandatool/src/assimp/assimpLoader.h b/pandatool/src/assimp/assimpLoader.h index 54597f9228..3c8391b324 100644 --- a/pandatool/src/assimp/assimpLoader.h +++ b/pandatool/src/assimp/assimpLoader.h @@ -20,7 +20,8 @@ #include "modelRoot.h" #include "texture.h" -#include "aiScene.h" +#include "assimp/scene.h" +#include "assimp/Importer.hpp" //////////////////////////////////////////////////////////////////// // Class : AssimpLoader diff --git a/pandatool/src/assimp/config_assimp.h b/pandatool/src/assimp/config_assimp.h index 43cd1ef87e..4c2da9d449 100644 --- a/pandatool/src/assimp/config_assimp.h +++ b/pandatool/src/assimp/config_assimp.h @@ -17,8 +17,6 @@ #include "pandatoolbase.h" -#include "assimp.hpp" - #include "dconfig.h" ConfigureDecl(config_assimp, EXPCL_ASSIMP, EXPTP_ASSIMP); diff --git a/pandatool/src/assimp/p3assimp_composite1.cxx b/pandatool/src/assimp/p3assimp_composite1.cxx new file mode 100644 index 0000000000..bc813b11ec --- /dev/null +++ b/pandatool/src/assimp/p3assimp_composite1.cxx @@ -0,0 +1,7 @@ + +#include "config_assimp.cxx" +#include "assimpLoader.cxx" +#include "loaderFileTypeAssimp.cxx" +#include "pandaIOStream.cxx" +#include "pandaIOSystem.cxx" +#include "pandaLogger.cxx" diff --git a/pandatool/src/assimp/pandaIOStream.h b/pandatool/src/assimp/pandaIOStream.h index be9b2d0548..c89f4a15bf 100644 --- a/pandatool/src/assimp/pandaIOStream.h +++ b/pandatool/src/assimp/pandaIOStream.h @@ -17,7 +17,7 @@ #include "config_assimp.h" -#include "IOStream.h" +#include "assimp/IOStream.hpp" class PandaIOSystem; diff --git a/pandatool/src/assimp/pandaIOSystem.h b/pandatool/src/assimp/pandaIOSystem.h index 04b2c1edaa..b86c1695a1 100644 --- a/pandatool/src/assimp/pandaIOSystem.h +++ b/pandatool/src/assimp/pandaIOSystem.h @@ -18,7 +18,7 @@ #include "config_assimp.h" #include "virtualFileSystem.h" -#include "IOSystem.h" +#include "assimp/IOSystem.hpp" //////////////////////////////////////////////////////////////////// // Class : PandaIOSystem diff --git a/pandatool/src/assimp/pandaLogger.cxx b/pandatool/src/assimp/pandaLogger.cxx index 138dae43b5..20de4497b7 100644 --- a/pandatool/src/assimp/pandaLogger.cxx +++ b/pandatool/src/assimp/pandaLogger.cxx @@ -14,7 +14,7 @@ #include "pandaLogger.h" -#include "DefaultLogger.h" +#include "assimp/DefaultLogger.hpp" PandaLogger *PandaLogger::_ptr = NULL; diff --git a/pandatool/src/assimp/pandaLogger.h b/pandatool/src/assimp/pandaLogger.h index 5930ef1248..8d0f39fc2a 100644 --- a/pandatool/src/assimp/pandaLogger.h +++ b/pandatool/src/assimp/pandaLogger.h @@ -17,7 +17,7 @@ #include "config_assimp.h" -#include "Logger.h" +#include "assimp/Logger.hpp" //////////////////////////////////////////////////////////////////// // Class : PandaLogger From cfcf91c1c1e99ea0bbc6d497b60efdfefd135094 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 6 Jun 2015 16:24:59 +0200 Subject: [PATCH 002/203] Support far clip distance of infinity --- panda/src/gobj/perspectiveLens.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/panda/src/gobj/perspectiveLens.cxx b/panda/src/gobj/perspectiveLens.cxx index b1fdb0ab6e..fcc8868662 100644 --- a/panda/src/gobj/perspectiveLens.cxx +++ b/panda/src/gobj/perspectiveLens.cxx @@ -82,12 +82,18 @@ do_compute_projection_mat(Lens::CData *lens_cdata) { PN_stdfloat fl = do_get_focal_length(lens_cdata); PN_stdfloat fFar = do_get_far(lens_cdata); PN_stdfloat fNear = do_get_near(lens_cdata); - PN_stdfloat far_minus_near = fFar-fNear; - PN_stdfloat a = (fFar + fNear); - PN_stdfloat b = -2.0f * fFar * fNear; + PN_stdfloat a, b; - a /= far_minus_near; - b /= far_minus_near; + if (cinf(fFar)) { + a = 1; + b = -2 * fNear; + } else { + PN_stdfloat far_minus_near = fFar-fNear; + a = (fFar + fNear); + b = -2 * fFar * fNear; + a /= far_minus_near; + b /= far_minus_near; + } LMatrix4 canonical; switch (cs) { From 3c380d9006758b8dfbeb8bcd28fb896d25c3d9b3 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 6 Jun 2015 16:46:43 +0200 Subject: [PATCH 003/203] Support collision sphere and plane solids in bam2egg --- panda/src/egg2pg/eggSaver.cxx | 70 +++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index 051c3b6f54..ba4ee35d7f 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -431,7 +431,6 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, apply_node_properties(egg_group, node, false); // turn it into a collision node - egg_group->set_cs_type(EggGroup::CST_polyset); egg_group->set_collide_flags(EggGroup::CF_descend); NodePath np = node_path.get_node_path(); @@ -451,6 +450,8 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, for (int i = 0; i < num_solids; i++) { CPT(CollisionSolid) child = node->get_solid(i); if (child->is_of_type(CollisionPolygon::get_class_type())) { + egg_group->set_cs_type(EggGroup::CST_polyset); + EggPolygon *egg_poly = new EggPolygon; egg_group->add_child(egg_poly); @@ -464,10 +465,71 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path, EggVertex *new_egg_vert = cvpool->create_unique_vertex(egg_vert); egg_poly->add_vertex(new_egg_vert); } - } else if (child->is_of_type(CollisionPlane::get_class_type())) { - nout << "Encountered unhandled collsion type: CollisionPlane" << "\n"; + } else if (child->is_of_type(CollisionSphere::get_class_type())) { - nout << "Encountered unhandled collsion type: CollisionSphere" << "\n"; + CPT(CollisionSphere) sphere = DCAST(CollisionSphere, child); + LPoint3 center = sphere->get_center(); + LVector3 offset(sphere->get_radius(), 0, 0); + + EggGroup *egg_sphere; + if (num_solids == 1) { + egg_sphere = egg_group; + } else { + egg_sphere = new EggGroup; + egg_sphere->set_collide_flags(EggGroup::CF_descend); + egg_group->add_child(egg_sphere); + } + egg_sphere->set_cs_type(EggGroup::CST_sphere); + + EggVertex ev1, ev2; + ev1.set_pos(LCAST(double, (center + offset) * net_mat)); + ev2.set_pos(LCAST(double, (center - offset) * net_mat)); + + EggPolygon *egg_poly = new EggPolygon; + egg_sphere->add_child(egg_poly); + + egg_poly->add_vertex(cvpool->create_unique_vertex(ev1)); + egg_poly->add_vertex(cvpool->create_unique_vertex(ev2)); + + } else if (child->is_of_type(CollisionPlane::get_class_type())) { + LPlane plane = DCAST(CollisionPlane, child)->get_plane(); + LPoint3 origin = plane.get_point(); + LVector3 normal = plane.get_normal(); + + // Get an arbitrary vector on the plane by taking the cross product + // with any vector, as long as it is different. + LVector3 vec1; + if (abs(normal[2]) > abs(normal[1])) { + vec1 = normal.cross(LVector3(0, 1, 0)); + } else { + vec1 = normal.cross(LVector3(0, 0, 1)); + } + + // Find a second vector perpendicular to the two. + LVector3 vec2 = normal.cross(vec1); + + EggGroup *egg_plane; + if (num_solids == 1) { + egg_plane = egg_group; + } else { + egg_plane = new EggGroup; + egg_plane->set_collide_flags(EggGroup::CF_descend); + egg_group->add_child(egg_plane); + } + egg_plane->set_cs_type(EggGroup::CST_plane); + + EggVertex ev0, ev1, ev2; + ev0.set_pos(LCAST(double, origin * net_mat)); + ev1.set_pos(LCAST(double, (origin + vec1) * net_mat)); + ev2.set_pos(LCAST(double, (origin + vec2) * net_mat)); + + EggPolygon *egg_poly = new EggPolygon; + egg_plane->add_child(egg_poly); + + egg_poly->add_vertex(cvpool->create_unique_vertex(ev0)); + egg_poly->add_vertex(cvpool->create_unique_vertex(ev1)); + egg_poly->add_vertex(cvpool->create_unique_vertex(ev2)); + } else if (child->is_of_type(CollisionBox::get_class_type())) { nout << "Encountered unhandled collsion type: CollisionBox" << "\n"; } else if (child->is_of_type(CollisionInvSphere::get_class_type())) { From 9edf75aa7bc4128ff2fc62e1b09e5a1b549d426c Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 6 Jun 2015 16:47:00 +0200 Subject: [PATCH 004/203] Release notes for 1.9.1 --- doc/ReleaseNotes | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 64513c39d3..3bb5d7f829 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -1,3 +1,34 @@ +------------------------ RELEASE 1.9.1 ------------------------ + +This minor release fixes some important regressions and bugs found +in 1.9.0, but also introduces a few minor features. + +It also reintroduces the deployment pipeline that was absent from +the previous release. + +* Textures were not being scaled to power-of-2 in some cases +* Fix various issues with shader inputs +* Bullet step function accidentally defaulted to step size of 0 +* Use model-path for finding libRocket assets +* Fix inconsistent behavior with non-power-of-2 textures in rocket +* Fix regression with memoryviews +* Fix symbol error when loading libp3ffmpeg on Mac OS X +* Fix issues running maya2egg on Mac OS X +* PStats now tracks memory residency of graphics buffers +* Support wireframe and point rendering modes in OpenGL ES +* Add missing keys to libRocket keymap +* Fix incorrect parsing of numbers with exponents in Config.prc +* Various performance optimizations +* Fix for reading URLs mounted via the virtual file system +* Improve GLSL error reporting +* Fix issue with model disappearing in rare cases with GLSL +* Fix shader generator memory leaks and runtime performance +* Add M_confined mouse mode that keeps cursor in window +* Expose _NET_WM_PID to window managers in X11 +* bam2egg supports collision sphere and plane solids +* Add sample program demonstrating mouse modes +* Add -L (lighting) and -P (graphics pipe) pview options + ------------------------ RELEASE 1.9.0 ------------------------ This is a major release with many exciting new features! From 4d46172fba98913d650e7e2e6f516e8e1131e2ec Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 6 Jun 2015 16:55:33 +0200 Subject: [PATCH 005/203] Revert non-Windows template export changes from 1.9.x, they're less stable than I thought --- dtool/src/dtoolbase/dtoolbase.h | 2 +- dtool/src/dtoolbase/dtoolbase_cc.h | 2 +- panda/src/display/displayRegion.h | 2 -- panda/src/egg/eggMorphList.h | 3 --- panda/src/gobj/shader.h | 2 -- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 50efeab52d..4c8b9b28cb 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -436,7 +436,7 @@ #define IMPORT_CLASS #endif /* "extern template" is now part of the C++11 standard. */ -#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) +#if defined(WIN32_VC) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) #define EXPORT_TEMPL #define IMPORT_TEMPL extern #else diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index efefd36e9e..cb6f1db130 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -174,7 +174,7 @@ typedef ios::seekdir ios_seekdir; # define MOVE(x) x #endif -#if !defined(LINK_ALL_STATIC) && defined(EXPORT_TEMPLATES) +#if defined(WIN32_VC) && !defined(LINK_ALL_STATIC) && defined(EXPORT_TEMPLATES) // This macro must be used to export an instantiated template class // from a DLL. If the template class name itself contains commas, it // may be necessary to first define a macro for the class name, to diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 3741dd395d..811b913e5c 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -360,8 +360,6 @@ private: static TypeHandle _type_handle; }; -EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_DISPLAY, EXPTP_PANDA_DISPLAY, epvector); - #include "displayRegion.I" #endif /* DISPLAYREGION_H */ diff --git a/panda/src/egg/eggMorphList.h b/panda/src/egg/eggMorphList.h index 6461a9278f..fb6013190e 100644 --- a/panda/src/egg/eggMorphList.h +++ b/panda/src/egg/eggMorphList.h @@ -65,9 +65,6 @@ private: Morphs _morphs; }; -EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorphList >); -EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorphList >); - typedef EggMorphList EggMorphVertexList; typedef EggMorphList EggMorphNormalList; typedef EggMorphList EggMorphTexCoordList; diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index debc5039ca..45bcab70f9 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -607,8 +607,6 @@ private: static TypeHandle _type_handle; }; -EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_GOBJ, EXPTP_PANDA_GOBJ, epvector); - #include "shader.I" #endif From 11ed8a4d8dc4d94a89a6d42e4674c18d6c57b6c2 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 6 Jun 2015 19:35:44 +0200 Subject: [PATCH 006/203] Use dynamic type lookup for interrogate to eliminate inter-module dependencies It is now no longer necessary to link to core.pyd Also includes a slight coercion optimization for trivial types --- doc/man/interrogate_module.1 | 5 +- dtool/src/cppparser/cppArrayType.cxx | 11 + dtool/src/cppparser/cppArrayType.h | 1 + dtool/src/cppparser/cppConstType.cxx | 11 + dtool/src/cppparser/cppConstType.h | 1 + dtool/src/cppparser/cppExtensionType.cxx | 11 + dtool/src/cppparser/cppExtensionType.h | 1 + dtool/src/cppparser/cppFunctionType.cxx | 11 + dtool/src/cppparser/cppFunctionType.h | 19 +- dtool/src/cppparser/cppInstance.cxx | 28 +- dtool/src/cppparser/cppInstanceIdentifier.cxx | 11 +- dtool/src/cppparser/cppPointerType.cxx | 11 + dtool/src/cppparser/cppPointerType.h | 1 + dtool/src/cppparser/cppReferenceType.cxx | 11 + dtool/src/cppparser/cppReferenceType.h | 4 +- dtool/src/cppparser/cppSimpleType.cxx | 11 + dtool/src/cppparser/cppSimpleType.h | 1 + dtool/src/cppparser/cppStructType.cxx | 91 ++++ dtool/src/cppparser/cppStructType.h | 1 + dtool/src/cppparser/cppType.cxx | 11 + dtool/src/cppparser/cppType.h | 1 + dtool/src/cppparser/cppTypedefType.cxx | 11 + dtool/src/cppparser/cppTypedefType.h | 1 + dtool/src/dtoolbase/typeHandle.I | 22 - dtool/src/dtoolbase/typeHandle.h | 6 +- dtool/src/interrogate/functionRemap.cxx | 17 +- .../interfaceMakerPythonNative.cxx | 495 ++++++++++++------ .../interrogate/interfaceMakerPythonNative.h | 2 +- dtool/src/interrogate/interrogateBuilder.cxx | 52 +- dtool/src/interrogate/interrogate_module.cxx | 55 +- dtool/src/interrogate/typeManager.cxx | 57 +- dtool/src/interrogate/typeManager.h | 2 +- dtool/src/interrogatedb/dtool_super_base.cxx | 21 +- dtool/src/interrogatedb/interrogateType.cxx | 20 - dtool/src/interrogatedb/interrogateType.h | 10 - dtool/src/interrogatedb/py_panda.cxx | 131 +++-- dtool/src/interrogatedb/py_panda.h | 51 +- dtool/src/parser-inc/iostream | 3 + makepanda/makepanda.py | 53 +- panda/src/bullet/bulletRigidBodyNode.h | 2 +- panda/src/egg/eggGroupNode.h | 2 +- panda/src/express/memoryUsagePointers_ext.cxx | 6 +- panda/src/express/namable.I | 13 + panda/src/express/namable.h | 6 +- panda/src/gobj/geom.h | 2 +- panda/src/gobj/geomVertexArrayData.h | 4 +- panda/src/gobj/geomVertexData.h | 10 +- panda/src/gobj/texture.h | 2 +- panda/src/gobj/textureStage.h | 2 +- panda/src/ode/odeGeom_ext.I | 8 +- panda/src/ode/odeSpace_ext.I | 8 +- panda/src/pgraph/camera.h | 2 +- panda/src/pgraph/nodePath.h | 4 +- panda/src/pgraph/pandaNode.h | 2 +- panda/src/pnmimage/pnmImage.h | 8 +- panda/src/pnmimage/pnmimage_base.h | 4 +- panda/src/pstatclient/pStatThread.h | 2 +- 57 files changed, 910 insertions(+), 439 deletions(-) diff --git a/doc/man/interrogate_module.1 b/doc/man/interrogate_module.1 index 289c65d691..039266094d 100644 --- a/doc/man/interrogate_module.1 +++ b/doc/man/interrogate_module.1 @@ -1,4 +1,4 @@ -.TH INTERROGATE_MODULE 1 "26 December 2014" "" Panda3D +.TH INTERROGATE_MODULE 1 "02 June 2015" "" Panda3D .SH NAME interrogate_module \- generate module-level code for interrogate .SH SYNOPSIS @@ -64,6 +64,9 @@ may be specified. If all are omitted, the default is \fB\-c\fP. Generate code within each wrapper function to adjust the global variable "in_interpreter" to indicated whether code is running within the Panda C++ environment or within the high-level language. +.TP +.BI "\-import " module_name +Used to import an external dependency module. .SH "SEE ALSO" .BR interrogate (1), .BR test_interrogate (1) diff --git a/dtool/src/cppparser/cppArrayType.cxx b/dtool/src/cppparser/cppArrayType.cxx index 44714cc9bd..4b044fb766 100644 --- a/dtool/src/cppparser/cppArrayType.cxx +++ b/dtool/src/cppparser/cppArrayType.cxx @@ -76,6 +76,17 @@ is_tbd() const { return _element_type->is_tbd(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPArrayType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPArrayType:: +is_trivial() const { + return _element_type->is_trivial(); +} + //////////////////////////////////////////////////////////////////// // Function: CPPArrayType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppArrayType.h b/dtool/src/cppparser/cppArrayType.h index 335759c105..82a369a90e 100644 --- a/dtool/src/cppparser/cppArrayType.h +++ b/dtool/src/cppparser/cppArrayType.h @@ -40,6 +40,7 @@ public: virtual CPPType *resolve_type(CPPScope *current_scope, CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppConstType.cxx b/dtool/src/cppparser/cppConstType.cxx index bf663b436c..503f1c0871 100644 --- a/dtool/src/cppparser/cppConstType.cxx +++ b/dtool/src/cppparser/cppConstType.cxx @@ -101,6 +101,17 @@ is_tbd() const { return _wrapped_around->is_tbd(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPConstType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPConstType:: +is_trivial() const { + return _wrapped_around->is_trivial(); +} + //////////////////////////////////////////////////////////////////// // Function: CPPConstType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppConstType.h b/dtool/src/cppparser/cppConstType.h index 2d6c552e1d..499b403a6e 100644 --- a/dtool/src/cppparser/cppConstType.h +++ b/dtool/src/cppparser/cppConstType.h @@ -38,6 +38,7 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppExtensionType.cxx b/dtool/src/cppparser/cppExtensionType.cxx index 26022cf8bf..3056b8b6d4 100644 --- a/dtool/src/cppparser/cppExtensionType.cxx +++ b/dtool/src/cppparser/cppExtensionType.cxx @@ -102,6 +102,17 @@ is_tbd() const { return false; } +//////////////////////////////////////////////////////////////////// +// Function: CPPExtensionType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPExtensionType:: +is_trivial() const { + return (_type == T_enum); +} + //////////////////////////////////////////////////////////////////// // Function: CPPExtensionType::substitute_decl // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppExtensionType.h b/dtool/src/cppparser/cppExtensionType.h index d1d810209c..d4201dc4e2 100644 --- a/dtool/src/cppparser/cppExtensionType.h +++ b/dtool/src/cppparser/cppExtensionType.h @@ -47,6 +47,7 @@ public: virtual bool is_incomplete() const; virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual CPPDeclaration *substitute_decl(SubstDecl &subst, CPPScope *current_scope, diff --git a/dtool/src/cppparser/cppFunctionType.cxx b/dtool/src/cppparser/cppFunctionType.cxx index 515729cf39..fa8cf3f291 100644 --- a/dtool/src/cppparser/cppFunctionType.cxx +++ b/dtool/src/cppparser/cppFunctionType.cxx @@ -159,6 +159,17 @@ is_tbd() const { return _parameters->is_tbd(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPFunctionType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPFunctionType:: +is_trivial() const { + return false; +} + //////////////////////////////////////////////////////////////////// // Function: CPPFunctionType::output // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppFunctionType.h b/dtool/src/cppparser/cppFunctionType.h index b728fa7b22..37360a80a7 100644 --- a/dtool/src/cppparser/cppFunctionType.h +++ b/dtool/src/cppparser/cppFunctionType.h @@ -29,14 +29,16 @@ class CPPIdentifier; class CPPFunctionType : public CPPType { public: enum Flags { - F_const_method = 0x01, - F_operator_typecast = 0x02, - F_constructor = 0x04, - F_destructor = 0x08, - F_method_pointer = 0x10, - F_unary_op = 0x20, - F_operator = 0x40, - F_noexcept = 0x80, + F_const_method = 0x001, + F_operator_typecast = 0x002, + F_constructor = 0x004, + F_destructor = 0x008, + F_method_pointer = 0x010, + F_unary_op = 0x020, + F_operator = 0x040, + F_noexcept = 0x080, + F_copy_constructor = 0x200, + F_move_constructor = 0x400, }; CPPFunctionType(CPPType *return_type, CPPParameterList *parameters, @@ -57,6 +59,7 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual void output(ostream &out, int indent_level, CPPScope *scope, bool complete) const; diff --git a/dtool/src/cppparser/cppInstance.cxx b/dtool/src/cppparser/cppInstance.cxx index 94b0924460..32790e0cde 100644 --- a/dtool/src/cppparser/cppInstance.cxx +++ b/dtool/src/cppparser/cppInstance.cxx @@ -347,9 +347,33 @@ check_for_constructor(CPPScope *current_scope, CPPScope *global_scope) { CPPType *void_type = CPPType::new_type (new CPPSimpleType(CPPSimpleType::T_void)); + int flags = func->_flags | CPPFunctionType::F_constructor; + + // Check if it might be a copy or move constructor. + CPPParameterList *params = func->_parameters; + if (params->_parameters.size() == 1 && !params->_includes_ellipsis) { + CPPType *param_type = params->_parameters[0]->_type; + CPPReferenceType *ref_type = param_type->as_reference_type(); + + if (ref_type != NULL) { + param_type = ref_type->_pointing_at; + + if (param_type->get_subtype() == CPPDeclaration::ST_const) { + param_type = param_type->as_const_type()->_wrapped_around; + } + + if (class_name == param_type->get_simple_name()) { + if (ref_type->_value_category == CPPReferenceType::VC_rvalue) { + flags |= CPPFunctionType::F_move_constructor; + } else { + flags |= CPPFunctionType::F_copy_constructor; + } + } + } + } + _type = CPPType::new_type - (new CPPFunctionType(void_type, func->_parameters, - func->_flags | CPPFunctionType::F_constructor)); + (new CPPFunctionType(void_type, func->_parameters, flags)); } else if (method_name == "~" + class_name) { CPPType *void_type = CPPType::new_type diff --git a/dtool/src/cppparser/cppInstanceIdentifier.cxx b/dtool/src/cppparser/cppInstanceIdentifier.cxx index 7cd3c67283..45379e5f70 100644 --- a/dtool/src/cppparser/cppInstanceIdentifier.cxx +++ b/dtool/src/cppparser/cppInstanceIdentifier.cxx @@ -166,7 +166,16 @@ add_scoped_pointer_modifier(CPPIdentifier *scoping) { //////////////////////////////////////////////////////////////////// void CPPInstanceIdentifier:: add_array_modifier(CPPExpression *expr) { - _modifiers.push_back(Modifier::array_type(expr)); + // Special case for operator new[] and delete[]. We're not really + // adding an array modifier to them, but appending [] to the + // identifier. This is to work around a parser ambiguity. + if (_ident != NULL && (_ident->get_simple_name() == "operator delete" || + _ident->get_simple_name() == "operator new")) { + + _ident->_names.back().append_name("[]"); + } else { + _modifiers.push_back(Modifier::array_type(expr)); + } } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/cppparser/cppPointerType.cxx b/dtool/src/cppparser/cppPointerType.cxx index 22dd91b268..baa8a62ff8 100644 --- a/dtool/src/cppparser/cppPointerType.cxx +++ b/dtool/src/cppparser/cppPointerType.cxx @@ -103,6 +103,17 @@ is_tbd() const { return _pointing_at->is_tbd(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPPointerType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPPointerType:: +is_trivial() const { + return true; +} + //////////////////////////////////////////////////////////////////// // Function: CPPPointerType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppPointerType.h b/dtool/src/cppparser/cppPointerType.h index 6a7349343f..6f9c2b1b75 100644 --- a/dtool/src/cppparser/cppPointerType.h +++ b/dtool/src/cppparser/cppPointerType.h @@ -38,6 +38,7 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppReferenceType.cxx b/dtool/src/cppparser/cppReferenceType.cxx index 40d6e987da..5b5d85fd3b 100644 --- a/dtool/src/cppparser/cppReferenceType.cxx +++ b/dtool/src/cppparser/cppReferenceType.cxx @@ -102,6 +102,17 @@ is_tbd() const { return _pointing_at->is_tbd(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPReferenceType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPReferenceType:: +is_trivial() const { + return false; +} + //////////////////////////////////////////////////////////////////// // Function: CPPReferenceType::is_equivalent // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppReferenceType.h b/dtool/src/cppparser/cppReferenceType.h index 3bf292841e..713a6abd6c 100644 --- a/dtool/src/cppparser/cppReferenceType.h +++ b/dtool/src/cppparser/cppReferenceType.h @@ -35,9 +35,6 @@ public: CPPType *_pointing_at; ValueCategory _value_category; - inline bool is_lvalue() const; - inline bool is_rvalue() const; - virtual bool is_fully_specified() const; virtual CPPDeclaration *substitute_decl(SubstDecl &subst, CPPScope *current_scope, @@ -47,6 +44,7 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, diff --git a/dtool/src/cppparser/cppSimpleType.cxx b/dtool/src/cppparser/cppSimpleType.cxx index 7ce7048848..ac4e633d6d 100644 --- a/dtool/src/cppparser/cppSimpleType.cxx +++ b/dtool/src/cppparser/cppSimpleType.cxx @@ -40,6 +40,17 @@ is_tbd() const { return (_type == T_unknown); } +//////////////////////////////////////////////////////////////////// +// Function: CPPSimpleType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPSimpleType:: +is_trivial() const { + return true; +} + //////////////////////////////////////////////////////////////////// // Function: CPPSimpleType::is_parameter_expr // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppSimpleType.h b/dtool/src/cppparser/cppSimpleType.h index 6ac032456b..27a1b89206 100644 --- a/dtool/src/cppparser/cppSimpleType.h +++ b/dtool/src/cppparser/cppSimpleType.h @@ -66,6 +66,7 @@ public: int _flags; virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual bool is_parameter_expr() const; virtual string get_preferred_name() const; diff --git a/dtool/src/cppparser/cppStructType.cxx b/dtool/src/cppparser/cppStructType.cxx index 0c138f586d..42dfed1d7b 100644 --- a/dtool/src/cppparser/cppStructType.cxx +++ b/dtool/src/cppparser/cppStructType.cxx @@ -131,6 +131,97 @@ is_abstract() const { return !funcs.empty(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPStructType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPStructType:: +is_trivial() const { + // Make sure all base classes are trivial. + Derivation::const_iterator di; + for (di = _derivation.begin(); di != _derivation.end(); ++di) { + CPPStructType *base = (*di)._base->as_struct_type(); + if (base != NULL && !base->is_trivial()) { + return false; + } + } + + assert(_scope != NULL); + + // Make sure all members are trivial. + CPPScope::Variables::const_iterator vi; + for (vi = _scope->_variables.begin(); vi != _scope->_variables.end(); ++vi) { + CPPInstance *instance = (*vi).second; + assert(instance != NULL); + + if (instance->_storage_class & CPPInstance::SC_static) { + // Static members don't count. + continue; + } + + if (instance->_initializer != NULL) { + // A member with an initializer means the default constructor would + // assign a value. This means the type can't be trivial. + return false; + } + + // Finally, check if the data member itself is non-trivial. + assert(instance->_type != NULL); + if (!instance->_type->is_trivial()) { + return false; + } + } + + // Now look for functions that are virtual or con/destructors. + bool is_default_constructible = true; + CPPScope::Functions::const_iterator fi; + for (fi = _scope->_functions.begin(); fi != _scope->_functions.end(); ++fi) { + CPPFunctionGroup *fgroup = (*fi).second; + + CPPFunctionGroup::Instances::const_iterator ii; + for (ii = fgroup->_instances.begin(); ii != fgroup->_instances.end(); ++ii) { + CPPInstance *inst = (*ii); + + if (inst->_storage_class & CPPInstance::SC_virtual) { + // Virtual functions are banned right off the bat. + return false; + } + + assert(inst->_type != (CPPType *)NULL); + CPPFunctionType *ftype = inst->_type->as_function_type(); + assert(ftype != (CPPFunctionType *)NULL); + + if (ftype->_flags & (CPPFunctionType::F_destructor | + CPPFunctionType::F_move_constructor | + CPPFunctionType::F_copy_constructor)) { + // User-provided destructors and copy/move constructors are not trivial. + return false; + } + + if ((ftype->_flags & CPPFunctionType::F_constructor) != 0) { + if (ftype->_parameters->_parameters.size() == 0 && + !ftype->_parameters->_includes_ellipsis) { + // Same for the default constructor. + return false; + } + // The presence of a non-default constructor makes the class not + // default-constructible. + is_default_constructible = false; + } + + if (fgroup->_name == "operator =") { + // Or assignment operators. + return false; + } + } + } + + // Finally, the class must be default-constructible. + return is_default_constructible; +} + //////////////////////////////////////////////////////////////////// // Function: CPPStructType::check_virtual // Access: Public diff --git a/dtool/src/cppparser/cppStructType.h b/dtool/src/cppparser/cppStructType.h index 1e0c74a02f..9a650320d2 100644 --- a/dtool/src/cppparser/cppStructType.h +++ b/dtool/src/cppparser/cppStructType.h @@ -47,6 +47,7 @@ public: bool check_virtual(); virtual bool is_fully_specified() const; virtual bool is_incomplete() const; + virtual bool is_trivial() const; CPPInstance *get_destructor() const; diff --git a/dtool/src/cppparser/cppType.cxx b/dtool/src/cppparser/cppType.cxx index bad935dba6..daceeb1d26 100644 --- a/dtool/src/cppparser/cppType.cxx +++ b/dtool/src/cppparser/cppType.cxx @@ -68,6 +68,17 @@ is_tbd() const { return false; } +//////////////////////////////////////////////////////////////////// +// Function: CPPType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPType:: +is_trivial() const { + return false; +} + //////////////////////////////////////////////////////////////////// // Function: CPPType::is_parameter_expr // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppType.h b/dtool/src/cppparser/cppType.h index 1d962e8d69..824a71e3c4 100644 --- a/dtool/src/cppparser/cppType.h +++ b/dtool/src/cppparser/cppType.h @@ -48,6 +48,7 @@ public: CPPScope *global_scope); virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual bool is_parameter_expr() const; bool has_typedef_name() const; diff --git a/dtool/src/cppparser/cppTypedefType.cxx b/dtool/src/cppparser/cppTypedefType.cxx index ceedd35f33..89924b3cc1 100644 --- a/dtool/src/cppparser/cppTypedefType.cxx +++ b/dtool/src/cppparser/cppTypedefType.cxx @@ -178,6 +178,17 @@ is_tbd() const { return _type->is_tbd(); } +//////////////////////////////////////////////////////////////////// +// Function: CPPTypedefType::is_trivial +// Access: Public, Virtual +// Description: Returns true if the type is considered a Plain Old +// Data (POD) type. +//////////////////////////////////////////////////////////////////// +bool CPPTypedefType:: +is_trivial() const { + return _type->is_trivial(); +} + //////////////////////////////////////////////////////////////////// // Function: CPPTypedefType::is_fully_specified // Access: Public, Virtual diff --git a/dtool/src/cppparser/cppTypedefType.h b/dtool/src/cppparser/cppTypedefType.h index ad6c33ffa2..030da91c18 100644 --- a/dtool/src/cppparser/cppTypedefType.h +++ b/dtool/src/cppparser/cppTypedefType.h @@ -42,6 +42,7 @@ public: virtual bool is_incomplete() const; virtual bool is_tbd() const; + virtual bool is_trivial() const; virtual bool is_fully_specified() const; diff --git a/dtool/src/dtoolbase/typeHandle.I b/dtool/src/dtoolbase/typeHandle.I index 482d0996db..e489fd4099 100644 --- a/dtool/src/dtoolbase/typeHandle.I +++ b/dtool/src/dtoolbase/typeHandle.I @@ -13,28 +13,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: TypeHandle::Constructor -// Access: Published -// Description: The default constructor must do nothing, because we -// can't guarantee ordering of static initializers. If -// the constructor tried to initialize its value, it -// might happen after the value had already been set -// previously by another static initializer! -//////////////////////////////////////////////////////////////////// -INLINE TypeHandle:: -TypeHandle() { -} - -//////////////////////////////////////////////////////////////////// -// Function: TypeHandle::Copy Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE TypeHandle:: -TypeHandle(const TypeHandle ©) : _index(copy._index) { -} - //////////////////////////////////////////////////////////////////// // Function: TypeHandle::Equality Operator // Access: Published diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index 9573cb2ffb..c669fa8084 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -94,8 +94,10 @@ PUBLISHED: // enum value. }; - INLINE TypeHandle(); - INLINE TypeHandle(const TypeHandle ©); + // The default constructor must do nothing, because we can't + // guarantee ordering of static initializers. If the constructor + // tried to initialize its value, it might happen after the value + // had already been set previously by another static initializer! EXTENSION(static TypeHandle make(PyTypeObject *classobj)); diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index b2f703c926..25a2848112 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -30,8 +30,6 @@ #include "interrogateType.h" #include "pnotify.h" -extern bool inside_python_native; - //////////////////////////////////////////////////////////////////// // Function: FunctionRemap::Constructor // Access: Public @@ -120,11 +118,7 @@ call_function(ostream &out, int indent_level, bool convert_result, InterfaceMaker::indent(out, indent_level) << "unref_delete(" << container << ");\n"; } else { - if (inside_python_native) { - InterfaceMaker::indent(out, indent_level) << "Dtool_Py_Delete(self);\n"; - } else { - InterfaceMaker::indent(out, indent_level) << "delete " << container << ";\n"; - } + InterfaceMaker::indent(out, indent_level) << "delete " << container << ";\n"; } } else if (_type == T_typecast_method) { @@ -866,13 +860,12 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak break; case T_constructor: - if (!_has_this && _parameters.size() == 1 && - TypeManager::unwrap(_parameters[0]._remap->get_orig_type()) == - TypeManager::unwrap(_return_type->get_orig_type())) { - // If this is the only parameter, and it's the same as the - // "this" type, this is a copy constructor. + if (_ftype->_flags & CPPFunctionType::F_copy_constructor) { + // It's a copy constructor. _flags |= F_copy_constructor; + } else if (_ftype->_flags & CPPFunctionType::F_move_constructor) { + } else if (!_has_this && _parameters.size() > 0 && (_cppfunc->_storage_class & CPPInstance::SC_explicit) == 0) { // A non-explicit non-copy constructor might be eligible for coercion. diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index db8a3e8e03..eda69928ff 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -40,7 +40,6 @@ #include #include -extern bool inside_python_native; extern InterrogateType dummy_type; extern std::string EXPORT_IMPORT_PREFIX; @@ -724,7 +723,7 @@ write_python_instance(ostream &out, int indent_level, const string &return_expr, out << boolalpha; if (!isExportThisRun(itype._cpptype)) { - _external_imports.insert(itype._cpptype); + _external_imports.insert(TypeManager::resolve_type(itype._cpptype)); } string class_name = itype.get_scoped_name(); @@ -743,7 +742,7 @@ write_python_instance(ostream &out, int indent_level, const string &return_expr, << "} else {\n"; indent(out, indent_level) << " return DTool_CreatePyInstanceTyped((void *)" << return_expr - << ", " << CLASS_PREFIX << make_safe_name(class_name) << ", " + << ", *Dtool_Ptr_" << make_safe_name(class_name) << ", " << owns_memory << ", " << is_const << ", " << return_expr << "->as_typed_object()->get_type_index());\n"; indent(out, indent_level) @@ -753,7 +752,7 @@ write_python_instance(ostream &out, int indent_level, const string &return_expr, indent(out, indent_level) << "return " << "DTool_CreatePyInstance((void *)" << return_expr << ", " - << CLASS_PREFIX << make_safe_name(class_name) << ", " + << "*Dtool_Ptr_" << make_safe_name(class_name) << ", " << owns_memory << ", " << is_const << ");\n"; } } @@ -787,8 +786,6 @@ InterfaceMakerPythonNative:: //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonNative:: write_prototypes(ostream &out_code, ostream *out_h) { - inside_python_native = true; - Functions::iterator fi; if (out_h != NULL) { @@ -817,7 +814,7 @@ write_prototypes(ostream &out_code, ostream *out_h) { write_prototypes_class(out_code, out_h, object); } else { //write_prototypes_class_external(out_code, object); - _external_imports.insert(object->_itype._cpptype); + //_external_imports.insert(object->_itype._cpptype); } } } @@ -832,28 +829,62 @@ write_prototypes(ostream &out_code, ostream *out_h) { string class_name = type->get_local_name(&parser); string safe_name = make_safe_name(class_name); - out_code << "IMPORT_THIS struct Dtool_PyTypedObject Dtool_" << safe_name << ";\n"; - out_code << "IMPORT_THIS void Dtool_PyModuleClassInit_" << safe_name << "(PyObject *module);\n"; + out_code << "// " << class_name << "\n"; + //out_code << "IMPORT_THIS struct Dtool_PyTypedObject Dtool_" << safe_name << ";\n"; + out_code << "static struct Dtool_PyTypedObject *Dtool_Ptr_" << safe_name << ";\n"; + //out_code << "#define Dtool_Ptr_" << safe_name << " &Dtool_" << safe_name << "\n"; + //out_code << "IMPORT_THIS void Dtool_PyModuleClassInit_" << safe_name << "(PyObject *module);\n"; + + // This is some really ugly code, because we have to store a pointer with a + // function of a signature that differs from class to class. If someone can + // think of an elegant way to do this without sacrificing perf, let me know. int has_coerce = has_coerce_constructor(type->as_struct_type()); - if (TypeManager::is_reference_count(type)) { - if (has_coerce > 0) { - out_code << "IMPORT_THIS bool Dtool_Coerce_" << safe_name << "(PyObject *args, CPT(" << class_name << ") &coerced);\n"; + if (has_coerce > 0) { + if (TypeManager::is_reference_count(type)) { + out_code + << "inline static bool Dtool_ConstCoerce_" << safe_name << "(PyObject *args, CPT(" << class_name << ") &coerced) {\n" + << " nassertr(Dtool_Ptr_" << safe_name << " != NULL, false);\n" + << " nassertr(Dtool_Ptr_" << safe_name << "->_Dtool_ConstCoerce != NULL, false);\n" + << " return ((bool (*)(PyObject *, CPT(" << class_name << ") &))Dtool_Ptr_" << safe_name << "->_Dtool_ConstCoerce)(args, coerced);\n" + << "}\n"; + if (has_coerce > 1) { - out_code << "IMPORT_THIS bool Dtool_Coerce_" << safe_name << "(PyObject *args, PT(" << class_name << ") &coerced);\n"; + out_code + << "inline static bool Dtool_Coerce_" << safe_name << "(PyObject *args, PT(" << class_name << ") &coerced) {\n" + << " nassertr(Dtool_Ptr_" << safe_name << " != NULL, false);\n" + << " nassertr(Dtool_Ptr_" << safe_name << "->_Dtool_Coerce != NULL, false);\n" + << " return ((bool (*)(PyObject *, PT(" << class_name << ") &))Dtool_Ptr_" << safe_name << "->_Dtool_Coerce)(args, coerced);\n" + << "}\n"; } - } - } else { - if (has_coerce > 0) { - out_code << "IMPORT_THIS bool Dtool_Coerce_" << safe_name << "(PyObject *args, " << class_name << " const *&coerced, bool &manage);\n"; + + } else if (TypeManager::is_trivial(type)) { + out_code + << "inline static " << class_name << " *Dtool_Coerce_" << safe_name << "(PyObject *args, " << class_name << " &coerced) {\n" + << " nassertr(Dtool_Ptr_" << safe_name << " != NULL, NULL);\n" + << " nassertr(Dtool_Ptr_" << safe_name << "->_Dtool_Coerce != NULL, NULL);\n" + << " return ((" << class_name << " *(*)(PyObject *, " << class_name << " &))Dtool_Ptr_" << safe_name << "->_Dtool_Coerce)(args, coerced);\n" + << "}\n"; + + } else { + out_code + << "inline static bool Dtool_ConstCoerce_" << safe_name << "(PyObject *args, " << class_name << " const *&coerced, bool &manage) {\n" + << " nassertr(Dtool_Ptr_" << safe_name << " != NULL, false);\n" + << " nassertr(Dtool_Ptr_" << safe_name << "->_Dtool_ConstCoerce != NULL, false);\n" + << " return ((bool (*)(PyObject *, " << class_name << " const *&, bool&))Dtool_Ptr_" << safe_name << "->_Dtool_ConstCoerce)(args, coerced, manage);\n" + << "}\n"; + if (has_coerce > 1) { - out_code << "IMPORT_THIS bool Dtool_Coerce_" << safe_name << "(PyObject *args, " << class_name << " *&coerced, bool &manage);\n"; + out_code + << "inline static bool Dtool_Coerce_" << safe_name << "(PyObject *args, " << class_name << " *&coerced, bool &manage) {\n" + << " nassertr(Dtool_Ptr_" << safe_name << " != NULL, false);\n" + << " nassertr(Dtool_Ptr_" << safe_name << "->_Dtool_Coerce != NULL, false);\n" + << " return ((bool (*)(PyObject *, " << class_name << " *&, bool&))Dtool_Ptr_" << safe_name << "->_Dtool_Coerce)(args, coerced, manage);\n" + << "}\n"; } } } } - - inside_python_native = false; } ///////////////////////////////////////////////////////////////////////////////////////////// @@ -919,8 +950,6 @@ write_prototypes_class(ostream &out_code, ostream *out_h, Object *obj) { //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonNative:: write_functions(ostream &out) { - inside_python_native = true; - out << "//********************************************************************\n"; out << "//*** Functions for .. Global\n" ; out << "//********************************************************************\n"; @@ -957,8 +986,6 @@ write_functions(ostream &out) { } } } - - inside_python_native = true; } //////////////////////////////////////////////////////////////////// @@ -1015,7 +1042,7 @@ write_class_details(ostream &out, Object *obj) { // Write the constructors. if (obj->_constructors.size() == 0) { // There is no constructor - write one that simply outputs an error. - out << "int Dtool_Init_" + ClassName + "(PyObject *, PyObject *, PyObject *) {\n" + out << "static int Dtool_Init_" + ClassName + "(PyObject *, PyObject *, PyObject *) {\n" << "#ifdef NDEBUG\n" << " Dtool_Raise_TypeError(\"cannot init constant class\");\n" << "#else\n" @@ -1027,7 +1054,7 @@ write_class_details(ostream &out, Object *obj) { } else { for (fi = obj->_constructors.begin(); fi != obj->_constructors.end(); ++fi) { Function *func = (*fi); - std::string fname = "int Dtool_Init_" + ClassName + "(PyObject *self, PyObject *args, PyObject *kwds)"; + std::string fname = "static int Dtool_Init_" + ClassName + "(PyObject *self, PyObject *args, PyObject *kwds)"; string expected_params; write_function_for_name(out, obj, func->_remaps, fname, expected_params, true, AT_keyword_args, RF_int); @@ -1040,7 +1067,7 @@ write_class_details(ostream &out, Object *obj) { int has_coerce = has_coerce_constructor(cpptype->as_struct_type()); if (has_coerce > 0) { write_coerce_constructor(out, obj, true); - if (has_coerce > 1) { + if (has_coerce > 1 && !TypeManager::is_trivial(obj->_itype._cpptype)) { write_coerce_constructor(out, obj, false); } } @@ -1059,28 +1086,28 @@ write_class_details(ostream &out, Object *obj) { for (di = details.begin(); di != details.end(); di++) { //InterrogateType ptype =idb->get_type(di->first); if (di->second._is_legal_py_class && !isExportThisRun(di->second._structType)) { - _external_imports.insert(di->second._structType); + _external_imports.insert(TypeManager::resolve_type(di->second._structType)); } //out << "IMPORT_THIS struct Dtool_PyTypedObject Dtool_" << make_safe_name(di->second._to_class_name) << ";\n"; } // Write support methods to cast from and to pointers of this type. { - out << "inline void *Dtool_UpcastInterface_" << ClassName << "(PyObject *self, Dtool_PyTypedObject *requested_type) {\n"; + out << "static void *Dtool_UpcastInterface_" << ClassName << "(PyObject *self, Dtool_PyTypedObject *requested_type) {\n"; out << " Dtool_PyTypedObject *SelfType = ((Dtool_PyInstDef *)self)->_My_Type;\n"; - out << " if (SelfType != &Dtool_" << ClassName << ") {\n"; + out << " if (SelfType != Dtool_Ptr_" << ClassName << ") {\n"; out << " printf(\"" << ClassName << " ** Bad Source Type-- Requesting Conversion from %s to %s\\n\", Py_TYPE(self)->tp_name, requested_type->_PyType.tp_name); fflush(NULL);\n";; out << " return NULL;\n"; out << " }\n"; out << "\n"; out << " " << cClassName << " *local_this = (" << cClassName << " *)((Dtool_PyInstDef *)self)->_ptr_to_object;\n"; - out << " if (requested_type == &Dtool_" << ClassName << ") {\n"; + out << " if (requested_type == Dtool_Ptr_" << ClassName << ") {\n"; out << " return local_this;\n"; out << " }\n"; for (di = details.begin(); di != details.end(); di++) { if (di->second._is_legal_py_class) { - out << " if (requested_type == &Dtool_" << make_safe_name(di->second._to_class_name) << ") {\n"; + out << " if (requested_type == Dtool_Ptr_" << make_safe_name(di->second._to_class_name) << ") {\n"; out << " return " << di->second._up_cast_string << " local_this;\n"; out << " }\n"; } @@ -1089,16 +1116,16 @@ write_class_details(ostream &out, Object *obj) { out << " return NULL;\n"; out << "}\n\n"; - out << "inline void *Dtool_DowncastInterface_" << ClassName << "(void *from_this, Dtool_PyTypedObject *from_type) {\n"; + out << "static void *Dtool_DowncastInterface_" << ClassName << "(void *from_this, Dtool_PyTypedObject *from_type) {\n"; out << " if (from_this == NULL || from_type == NULL) {\n"; out << " return NULL;\n"; out << " }\n"; - out << " if (from_type == &Dtool_" << ClassName << ") {\n"; + out << " if (from_type == Dtool_Ptr_" << ClassName << ") {\n"; out << " return from_this;\n"; out << " }\n"; for (di = details.begin(); di != details.end(); di++) { if (di->second._can_downcast && di->second._is_legal_py_class) { - out << " if (from_type == &Dtool_" << make_safe_name(di->second._to_class_name) << ") {\n"; + out << " if (from_type == Dtool_Ptr_" << make_safe_name(di->second._to_class_name) << ") {\n"; out << " " << di->second._to_class_name << "* other_this = (" << di->second._to_class_name << "*)from_this;\n" ; out << " return (" << cClassName << "*)other_this;\n"; out << " }\n"; @@ -1144,21 +1171,25 @@ write_class_declarations(ostream &out, ostream *out_h, Object *obj) { } out << "(" << _def->module_name << ", " << class_name << ", " << class_name << "_localtype, " << classNameFromCppName(preferred_name, false) << ");\n"; - out << "EXPORT_THIS void Dtool_PyModuleClassInit_" << class_name << "(PyObject *module);\n"; + out << "static struct Dtool_PyTypedObject *const Dtool_Ptr_" << class_name << " = &Dtool_" << class_name << ";\n"; + out << "static void Dtool_PyModuleClassInit_" << class_name << "(PyObject *module);\n"; int has_coerce = has_coerce_constructor(type->as_struct_type()); - if (TypeManager::is_reference_count(type)) { - if (has_coerce > 0) { - out << "EXPORT_THIS bool Dtool_Coerce_" << class_name << "(PyObject *args, CPT(" << c_class_name << ") &coerced);\n"; + if (has_coerce > 0) { + if (TypeManager::is_reference_count(type)) { + assert(!type->is_trivial()); + out << "bool Dtool_ConstCoerce_" << class_name << "(PyObject *args, CPT(" << c_class_name << ") &coerced);\n"; if (has_coerce > 1) { - out << "EXPORT_THIS bool Dtool_Coerce_" << class_name << "(PyObject *args, PT(" << c_class_name << ") &coerced);\n"; + out << "bool Dtool_Coerce_" << class_name << "(PyObject *args, PT(" << c_class_name << ") &coerced);\n"; } - } - } else { - if (has_coerce > 0) { - out << "EXPORT_THIS bool Dtool_Coerce_" << class_name << "(PyObject *args, " << c_class_name << " const *&coerced, bool &manage);\n"; + + } else if (TypeManager::is_trivial(type)) { + out << "" << c_class_name << " *Dtool_Coerce_" << class_name << "(PyObject *args, " << c_class_name << " &coerced);\n"; + + } else { + out << "bool Dtool_ConstCoerce_" << class_name << "(PyObject *args, " << c_class_name << " const *&coerced, bool &manage);\n"; if (has_coerce > 1) { - out << "EXPORT_THIS bool Dtool_Coerce_" << class_name << "(PyObject *args, " << c_class_name << " *&coerced, bool &manage);\n"; + out << "bool Dtool_Coerce_" << class_name << "(PyObject *args, " << c_class_name << " *&coerced, bool &manage);\n"; } } } @@ -1202,7 +1233,7 @@ write_sub_module(ostream &out, Object *obj) { << " " << *(obj->_itype._cpptype) << "\n"; if (!isExportThisRun(wrapped_itype._cpptype)) { - _external_imports.insert(wrapped_itype._cpptype); + _external_imports.insert(TypeManager::resolve_type(wrapped_itype._cpptype)); } } @@ -1210,9 +1241,9 @@ write_sub_module(ostream &out, Object *obj) { std::string export_class_name2 = classNameFromCppName(obj->_itype.get_name(), true); // out << " Py_INCREF(&Dtool_" << class_name << ".As_PyTypeObject());\n"; - out << " PyModule_AddObject(module, \"" << export_class_name << "\", (PyObject *)&Dtool_" << class_name << ".As_PyTypeObject());\n"; + out << " PyModule_AddObject(module, \"" << export_class_name << "\", (PyObject *)&Dtool_" << class_name << ");\n"; if (export_class_name != export_class_name2) { - out << " PyModule_AddObject(module, \"" << export_class_name2 << "\", (PyObject *)&Dtool_" << class_name << ".As_PyTypeObject());\n"; + out << " PyModule_AddObject(module, \"" << export_class_name2 << "\", (PyObject *)&Dtool_" << class_name << ");\n"; } } @@ -1225,19 +1256,62 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { out << "//*** Module Object Linker ..\n"; out << "//********************************************************************\n"; - out << "static void BuildInstants(PyObject *module) {\n"; - out << " (void) module; // Unused\n"; - Objects::iterator oi; + + out << "void Dtool_" << def->library_name << "_RegisterTypes() {\n"; + for (oi = _objects.begin(); oi != _objects.end(); ++oi) { Object *object = (*oi).second; - if (object->_itype.is_enum() && !object->_itype.is_nested()) { - int enum_count = object->_itype.number_of_enum_values(); - if (enum_count > 0) { - out << "//********************************************************************\n"; - out << "//*** Module Enums .." << object->_itype.get_scoped_name() << "\n"; - out << "//********************************************************************\n"; + if (object->_itype.is_class() || + object->_itype.is_struct()) { + if (is_cpp_type_legal(object->_itype._cpptype) && + isExportThisRun(object->_itype._cpptype)) { + string class_name = make_safe_name(object->_itype.get_scoped_name()); + bool is_typed = HasAGetClassTypeFunction(object->_itype._cpptype); + + if (is_typed) { + out << " Dtool_" << class_name << "._type = " + << object->_itype._cpptype->get_local_name(&parser) + << "::get_class_type();\n" + << " RegisterRuntimeTypedClass(Dtool_" << class_name << ");\n"; + + } else { + out << " RegisterNamedClass(\"" << object->_itype.get_scoped_name() + << "\", Dtool_" << class_name << ");\n"; + + if (IsPandaTypedObject(object->_itype._cpptype->as_struct_type())) { + nout << object->_itype.get_scoped_name() << " derives from TypedObject, " + << "but does not define a get_class_type() function.\n"; + } + } } + } + } + out << "}\n\n"; + + out << "void Dtool_" << def->library_name << "_ResolveExternals() {\n"; + out << " // Resolve externally imported types.\n"; + + for (std::set::iterator ii = _external_imports.begin(); ii != _external_imports.end(); ++ii) { + string class_name = (*ii)->get_local_name(&parser); + string safe_name = make_safe_name(class_name); + + if (HasAGetClassTypeFunction(*ii)) { + out << " Dtool_Ptr_" << safe_name << " = LookupRuntimeTypedClass(" << class_name << "::get_class_type());\n"; + } else { + out << " Dtool_Ptr_" << safe_name << " = LookupNamedClass(\"" << class_name << "\");\n"; + } + } + out << "}\n\n"; + + out << "void Dtool_" << def->library_name << "_BuildInstants(PyObject *module) {\n"; + out << " (void) module;\n"; + + for (oi = _objects.begin(); oi != _objects.end(); ++oi) { + Object *object = (*oi).second; + if (object->_itype.is_enum() && !object->_itype.is_nested() && + isExportThisRun(object->_itype._cpptype)) { + int enum_count = object->_itype.number_of_enum_values(); for (int xx = 0; xx < enum_count; xx++) { string name1 = classNameFromCppName(object->_itype.get_enum_value_name(xx), false); string name2 = classNameFromCppName(object->_itype.get_enum_value_name(xx), true); @@ -1334,10 +1408,10 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { // Note: we shouldn't add METH_STATIC here, since both METH_STATIC // and METH_CLASS are illegal for module-level functions. - out << " { \"" << name1 << "\", (PyCFunction) &" + out << " {\"" << name1 << "\", (PyCFunction) &" << func->_name << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; if (name1 != name2) { - out << " { \"" << name2 << "\", (PyCFunction) &" + out << " {\"" << name2 << "\", (PyCFunction) &" << func->_name << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; } } @@ -1351,7 +1425,7 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { out << " {NULL, NULL, 0, NULL}\n" << "};\n\n"; - out << "EXPORT_THIS struct LibraryDef " << def->library_name << "_moddef = {python_simple_funcs, BuildInstants};\n"; + out << "struct LibraryDef " << def->library_name << "_moddef = {python_simple_funcs};\n"; if (out_h != NULL) { *out_h << "extern struct LibraryDef " << def->library_name << "_moddef;\n"; } @@ -1440,6 +1514,11 @@ write_module_class(ostream &out, Object *obj) { std::string cClassName = obj->_itype.get_true_name(); std::string export_class_name = classNameFromCppName(obj->_itype.get_name(), false); + bool is_runtime_typed = IsPandaTypedObject(obj->_itype._cpptype->as_struct_type()); + if (!is_runtime_typed && HasAGetClassTypeFunction(obj->_itype._cpptype)) { + is_runtime_typed = true; + } + Functions::iterator fi; out << "//********************************************************************\n"; out << "//*** Py Init Code For .. " << ClassName << " | " << export_class_name << "\n" ; @@ -1555,10 +1634,10 @@ write_module_class(ostream &out, Object *obj) { } // This method has non-slotted remaps, so write it out into the function table. - out << " { \"" << name1 << "\", (PyCFunction) &" + out << " {\"" << name1 << "\", (PyCFunction) &" << func->_name << ", " << flags << ", (char *) " << func->_name << "_comment},\n"; if (name1 != name2) { - out << " { \"" << name2 << "\", (PyCFunction) &" + out << " {\"" << name2 << "\", (PyCFunction) &" << func->_name << ", " << flags << ", (char *) " << func->_name << "_comment},\n"; } } @@ -1566,37 +1645,43 @@ write_module_class(ostream &out, Object *obj) { if (obj->_protocol_types & Object::PT_make_copy) { if (!got_copy) { - out << " { \"__copy__\", (PyCFunction) ©_from_make_copy, METH_NOARGS, NULL},\n"; + out << " {\"__copy__\", (PyCFunction) ©_from_make_copy, METH_NOARGS, NULL},\n"; got_copy = true; } } else if (obj->_protocol_types & Object::PT_copy_constructor) { if (!got_copy) { - out << " { \"__copy__\", (PyCFunction) ©_from_copy_constructor, METH_NOARGS, NULL},\n"; + out << " {\"__copy__\", (PyCFunction) ©_from_copy_constructor, METH_NOARGS, NULL},\n"; got_copy = true; } } if (got_copy && !got_deepcopy) { - out << " { \"__deepcopy__\", (PyCFunction) &map_deepcopy_to_copy, METH_VARARGS, NULL},\n"; + out << " {\"__deepcopy__\", (PyCFunction) &map_deepcopy_to_copy, METH_VARARGS, NULL},\n"; } MakeSeqs::iterator msi; for (msi = obj->_make_seqs.begin(); msi != obj->_make_seqs.end(); ++msi) { - string flags = "METH_NOARGS"; - if (obj->is_static_method((*msi)->_element_name)) { - flags += " | METH_CLASS"; - } - string name1 = methodNameFromCppName((*msi)->_seq_name, export_class_name, false); - string name2 = methodNameFromCppName((*msi)->_seq_name, export_class_name, true); - out << " { \"" << name1 - << "\", (PyCFunction) &" << (*msi)->_name << ", " << flags << ", NULL},\n"; - if (name1 != name2) { - out << " { \"" << name2 + const string &seq_name = (*msi)->_seq_name; + + if ((seq_name.size() > 4 && seq_name.substr(0, 4) == "get_") || + (seq_name.size() > 7 && seq_name.substr(0, 7) == "modify_")) { + + string flags = "METH_NOARGS"; + if (obj->is_static_method((*msi)->_element_name)) { + flags += " | METH_CLASS"; + } + string name1 = methodNameFromCppName((*msi)->_seq_name, export_class_name, false); + string name2 = methodNameFromCppName((*msi)->_seq_name, export_class_name, true); + out << " {\"" << name1 << "\", (PyCFunction) &" << (*msi)->_name << ", " << flags << ", NULL},\n"; + if (name1 != name2) { + out << " { \"" << name2 + << "\", (PyCFunction) &" << (*msi)->_name << ", " << flags << ", NULL},\n"; + } } } - out << " { NULL, NULL, 0, NULL }\n" + out << " {NULL, NULL, 0, NULL}\n" << "};\n\n"; int num_derivations = obj->_itype.number_of_derivations(); @@ -1607,7 +1692,7 @@ write_module_class(ostream &out, Object *obj) { const InterrogateType &d_itype = idb->get_type(d_type_Index); if (is_cpp_type_legal(d_itype._cpptype)) { if (!isExportThisRun(d_itype._cpptype)) { - _external_imports.insert(d_itype._cpptype); + _external_imports.insert(TypeManager::resolve_type(d_itype._cpptype)); //out << "IMPORT_THIS struct Dtool_PyTypedObject Dtool_" << make_safe_name(d_itype.get_scoped_name().c_str()) << ";\n"; } @@ -2649,7 +2734,7 @@ write_module_class(ostream &out, Object *obj) { } // Output the actual PyTypeObject definition. - out << "EXPORT_THIS Dtool_PyTypedObject Dtool_" << ClassName << " = {\n"; + out << "struct Dtool_PyTypedObject Dtool_" << ClassName << " = {\n"; out << " {\n"; out << " PyVarObject_HEAD_INIT(NULL, 0)\n"; // const char *tp_name; @@ -2848,12 +2933,36 @@ write_module_class(ostream &out, Object *obj) { out << " 0, // tp_version_tag\n"; out << "#endif\n"; out << " },\n"; + + // It's tempting to initialize the type handle here, but this causes static + // init ordering issues; this may run before init_type is called. + out << " TypeHandle::none(),\n"; + out << " Dtool_PyModuleClassInit_" << ClassName << ",\n"; out << " Dtool_UpcastInterface_" << ClassName << ",\n"; out << " Dtool_DowncastInterface_" << ClassName << ",\n"; - out << " TypeHandle::none(),\n"; + + int has_coerce = has_coerce_constructor(obj->_itype._cpptype->as_struct_type()); + if (has_coerce > 0) { + if (TypeManager::is_reference_count(obj->_itype._cpptype) || + !TypeManager::is_trivial(obj->_itype._cpptype)) { + out << " (CoerceFunction)Dtool_ConstCoerce_" << ClassName << ",\n"; + if (has_coerce > 1) { + out << " (CoerceFunction)Dtool_Coerce_" << ClassName << ",\n"; + } else { + out << " (CoerceFunction)0,\n"; + } + } else { + out << " (CoerceFunction)0,\n"; + out << " (CoerceFunction)Dtool_Coerce_" << ClassName << ",\n"; + } + } else { + out << " (CoerceFunction)0,\n"; + out << " (CoerceFunction)0,\n"; + } + out << "};\n\n"; - out << "void Dtool_PyModuleClassInit_" << ClassName << "(PyObject *module) {\n"; + out << "static void Dtool_PyModuleClassInit_" << ClassName << "(PyObject *module) {\n"; out << " (void) module; // Unused\n"; out << " static bool initdone = false;\n"; out << " if (!initdone) {\n"; @@ -2864,11 +2973,14 @@ write_module_class(ostream &out, Object *obj) { out << " // Dependent objects\n"; string baseargs; for (vector::iterator bi = bases.begin(); bi != bases.end(); ++bi) { - baseargs += ", &Dtool_" + *bi + ".As_PyTypeObject()"; - out << " Dtool_PyModuleClassInit_" << make_safe_name(*bi) << "(NULL);\n"; + baseargs += ", (PyTypeObject *)Dtool_Ptr_" + *bi; + string safe_name = make_safe_name(*bi); + + out << " assert(Dtool_Ptr_" << safe_name << " != NULL);\n" + << " Dtool_Ptr_" << safe_name << "->_Dtool_ModuleClassInit(NULL);\n"; } - out << " Dtool_" << ClassName << ".As_PyTypeObject().tp_bases = PyTuple_Pack(" << bases.size() << baseargs << ");\n"; + out << " Dtool_" << ClassName << "._PyType.tp_bases = PyTuple_Pack(" << bases.size() << baseargs << ");\n"; } int num_nested = obj->_itype.number_of_nested_types(); @@ -2901,7 +3013,7 @@ write_module_class(ostream &out, Object *obj) { } else { out << " PyObject *dict = PyDict_New();\n"; } - out << " Dtool_" << ClassName << ".As_PyTypeObject().tp_dict = dict;\n"; + out << " Dtool_" << ClassName << "._PyType.tp_dict = dict;\n"; out << " PyDict_SetItemString(dict, \"DtoolClassDict\", dict);\n"; // Now go through the nested types again to actually add the dict items. @@ -2922,9 +3034,9 @@ write_module_class(ostream &out, Object *obj) { out << " Dtool_PyModuleClassInit_" << ClassName1 << "(NULL);\n"; string name1 = classNameFromCppName(ClassName2, false); string name2 = classNameFromCppName(ClassName2, true); - out << " PyDict_SetItemString(dict, \"" << name1 << "\", (PyObject *)&Dtool_" << ClassName1 << ".As_PyTypeObject());\n"; + out << " PyDict_SetItemString(dict, \"" << name1 << "\", (PyObject *)&Dtool_" << ClassName1 << ");\n"; if (name1 != name2) { - out << " PyDict_SetItemString(dict, \"" << name2 << "\", (PyObject *)&Dtool_" << ClassName1 << ".As_PyTypeObject());\n"; + out << " PyDict_SetItemString(dict, \"" << name2 << "\", (PyObject *)&Dtool_" << ClassName1 << ");\n"; } } else if (nested_obj->_itype.is_typedef()) { @@ -2943,7 +3055,7 @@ write_module_class(ostream &out, Object *obj) { string ClassName2 = make_safe_name(interrogate_type_name(wrapped)); string name1 = classNameFromCppName(ClassName2, false); - out << " PyDict_SetItemString(dict, \"" << name1 << "\", (PyObject *)&Dtool_" << ClassName1 << ".As_PyTypeObject());\n"; + out << " PyDict_SetItemString(dict, \"" << name1 << "\", (PyObject *)&Dtool_" << ClassName1 << ");\n"; // No need to support mangled names for nested typedefs; we only added support recently. } else if (nested_obj->_itype.is_enum()) { @@ -2969,28 +3081,12 @@ write_module_class(ostream &out, Object *obj) { } } - out << " if (PyType_Ready(&Dtool_" << ClassName << ".As_PyTypeObject()) < 0) {\n"; - out << " Dtool_Raise_TypeError(\"PyType_Ready(" << ClassName << ")\");\n"; - out << " return;\n"; - out << " }\n"; - - out << " Py_INCREF(&Dtool_" << ClassName << ".As_PyTypeObject());\n"; - - // Why make the class a member of itself? - //out << " PyDict_SetItemString(Dtool_" <_itype._cpptype->as_struct_type()); - if (HasAGetClassTypeFunction(obj->_itype)) { - is_runtime_typed = true; - } - - if (is_runtime_typed) { - out << " RegisterRuntimeClass(&Dtool_" << ClassName << ", " << cClassName << "::get_class_type().get_index());\n"; - } else { - out << " RegisterRuntimeClass(&Dtool_" << ClassName << ", -1);\n"; - } - - out << " }\n"; + out << " if (PyType_Ready((PyTypeObject *)&Dtool_" << ClassName << ") < 0) {\n" + " Dtool_Raise_TypeError(\"PyType_Ready(" << ClassName << ")\");\n" + " return;\n" + " }\n" + " Py_INCREF((PyTypeObject *)&Dtool_" << ClassName << ");\n" + " }\n"; // Also write out the explicit alternate names. //int num_alt_names = obj->_itype.get_num_alt_names(); @@ -3625,12 +3721,14 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { std::string ClassName = make_safe_name(obj->_itype.get_scoped_name()); std::string cClassName = obj->_itype.get_true_name(); + int return_flags = RF_coerced; + if (TypeManager::is_reference_count(obj->_itype._cpptype)) { // The coercion works slightly different for reference counted types, since // we can handle those a bit more nicely by taking advantage of the refcount // instead of having to use a boolean to indicate that it should be managed. if (is_const) { - out << "bool Dtool_Coerce_" << ClassName << "(PyObject *args, CPT(" << cClassName << ") &coerced) {\n"; + out << "bool Dtool_ConstCoerce_" << ClassName << "(PyObject *args, CPT(" << cClassName << ") &coerced) {\n"; } else { out << "bool Dtool_Coerce_" << ClassName << "(PyObject *args, PT(" << cClassName << ") &coerced) {\n"; } @@ -3650,9 +3748,26 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { out << " coerced->ref();\n"; out << " return true;\n"; } + return_flags |= RF_err_false; + + } else if (TypeManager::is_trivial(obj->_itype._cpptype)) { + out << cClassName << " *Dtool_Coerce_" << ClassName << "(PyObject *args, " << cClassName << " &coerced) {\n"; + + out << " " << cClassName << " *local_this;\n"; + out << " DTOOL_Call_ExtractThisPointerForType(args, &Dtool_" << ClassName << ", (void**)&local_this);\n"; + out << " if (local_this != NULL) {\n"; + out << " if (((Dtool_PyInstDef *)args)->_is_const) {\n"; + out << " // This is a const object. Make a copy.\n"; + out << " coerced = *(const " << cClassName << " *)local_this;\n"; + out << " return &coerced;\n"; + out << " }\n"; + out << " return local_this;\n"; + + return_flags |= RF_err_null; + } else { if (is_const) { - out << "bool Dtool_Coerce_" << ClassName << "(PyObject *args, " << cClassName << " const *&coerced, bool &manage) {\n"; + out << "bool Dtool_ConstCoerce_" << ClassName << "(PyObject *args, " << cClassName << " const *&coerced, bool &manage) {\n"; } else { out << "bool Dtool_Coerce_" << ClassName << "(PyObject *args, " << cClassName << " *&coerced, bool &manage) {\n"; } @@ -3667,12 +3782,14 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { } else { out << " return true;\n"; } + + return_flags |= RF_err_false; } out << " }\n\n"; if (map_sets.empty()) { - error_return(out, 2, RF_coerced | RF_err_false); + error_return(out, 2, return_flags); out << "}\n\n"; return; } @@ -3687,12 +3804,12 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { out << " PyObject *arg = args;\n"; write_function_forset(out, mii->second, mii->first, mii->first, expected_params, 4, false, false, - AT_single_arg, RF_coerced | RF_err_false, true, false); + AT_single_arg, return_flags, true, false); if (map_sets.size() == 1) { out << " }\n"; //out << " PyErr_Clear();\n"; - error_return(out, 2, RF_coerced | RF_err_false); + error_return(out, 2, return_flags); out << "}\n\n"; return; } @@ -3730,7 +3847,7 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { indent(out, 6) << "case " << max_args << ": {\n"; write_function_forset(out, mii->second, min_args, max_args, expected_params, 8, false, false, - AT_varargs, RF_coerced | RF_err_false, true, false); + AT_varargs, return_flags, true, false); indent(out, 8) << "break;\n"; indent(out, 6) << "}\n"; @@ -3760,13 +3877,13 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { } write_function_forset(out, mii->second, min_args, max_args, expected_params, 6, false, false, - AT_varargs, RF_coerced | RF_err_false, true, false); + AT_varargs, return_flags, true, false); indent(out, 4) << "}\n"; } out << " }\n\n"; //out << " PyErr_Clear();\n"; - error_return(out, 2, RF_coerced | RF_err_false); + error_return(out, 2, return_flags); out << "}\n\n"; } @@ -5163,7 +5280,7 @@ write_function_instance(ostream &out, FunctionRemap *remap, // need to a forward scope for this class.. if (!isExportThisRun(obj_type)) { - _external_imports.insert(obj_type); + _external_imports.insert(TypeManager::resolve_type(obj_type)); } string this_class_name; @@ -5183,19 +5300,50 @@ write_function_instance(ostream &out, FunctionRemap *remap, // We use a PointerTo to handle the management here. It's cleaner // that way. if (TypeManager::is_const_pointer_to_anything(type)) { - extra_convert << 'C'; - } - extra_convert - << "PT(" << class_name << ") " << param_name << "_this" - << default_expr << ";\n"; + extra_convert + << "CPT(" << class_name << ") " << param_name << "_this" + << default_expr << ";\n"; - coerce_call = "Dtool_Coerce_" + make_safe_name(class_name) + - "(" + param_name + ", " + param_name + "_this)"; + coerce_call = "Dtool_ConstCoerce_" + make_safe_name(class_name) + + "(" + param_name + ", " + param_name + "_this)"; + } else { + extra_convert + << "PT(" << class_name << ") " << param_name << "_this" + << default_expr << ";\n"; + + coerce_call = "Dtool_Coerce_" + make_safe_name(class_name) + + "(" + param_name + ", " + param_name + "_this)"; + } // Use move constructor when available for functions that take // an actual PointerTo. This eliminates an unref()/ref() pair. pexpr_string = "MOVE(" + param_name + "_this)"; + } else if (TypeManager::is_trivial(obj_type)) { + // This is a trivial type, such as TypeHandle or LVecBase4. + obj_type->output_instance(extra_convert, param_name + "_local", &parser); + extra_convert << ";\n"; + + type->output_instance(extra_convert, param_name + "_this", &parser); + + if (is_optional) { + extra_convert + << default_expr << ";\n" + << "if (" << param_name << " != NULL) {\n" + << " " << param_name << "_this"; + } + + extra_convert << " = Dtool_Coerce_" + make_safe_name(class_name) + + "(" + param_name + ", " + param_name + "_local);\n"; + + if (is_optional) { + extra_convert << "}\n"; + } + + coerce_call = "(" + param_name + "_this != NULL)"; + + pexpr_string = param_name + "_this"; + } else { // This is a bit less elegant: we use a bool to store whether // we're supposed to clean up the reference afterward. @@ -5204,8 +5352,13 @@ write_function_instance(ostream &out, FunctionRemap *remap, << default_expr << ";\n" << "bool " << param_name << "_manage = false;\n"; - coerce_call = "Dtool_Coerce_" + make_safe_name(class_name) + - "(" + param_name + ", " + param_name + "_this, " + param_name + "_manage)"; + if (TypeManager::is_const_pointer_or_ref(orig_type)) { + coerce_call = "Dtool_ConstCoerce_" + make_safe_name(class_name) + + "(" + param_name + ", " + param_name + "_this, " + param_name + "_manage)"; + } else { + coerce_call = "Dtool_Coerce_" + make_safe_name(class_name) + + "(" + param_name + ", " + param_name + "_this, " + param_name + "_manage)"; + } extra_cleanup << "if (" << param_name << "_manage) {\n" @@ -5266,13 +5419,13 @@ write_function_instance(ostream &out, FunctionRemap *remap, } extra_convert << "DTOOL_Call_ExtractThisPointerForType(" << param_name - << ", &Dtool_" << make_safe_name(class_name) + << ", Dtool_Ptr_" << make_safe_name(class_name) << ", (void **)&" << param_name << "_this);\n"; } else { extra_convert << boolalpha << " = (" << class_name << " *)" << "DTOOL_Call_GetPointerThisClass(" << param_name - << ", &Dtool_" << make_safe_name(class_name) + << ", Dtool_Ptr_" << make_safe_name(class_name) << ", " << pn << ", \"" << method_prefix << methodNameFromCppName(remap, this_class_name, false) << "\", " << const_ok << ", " << report_errors << ");\n"; @@ -5462,6 +5615,20 @@ write_function_instance(ostream &out, FunctionRemap *remap, manage_return = remap->_return_value_needs_management; return_expr = "return_value"; + } else if ((return_flags & RF_coerced) != 0 && TypeManager::is_trivial(remap->_cpptype)) { + // Another special case is the coerce constructor for a trivial type. + // We don't want to invoke "operator new" unnecessarily. + if (is_constructor && remap->_extension) { + // Extension constructors are a special case, as usual. + indent(out, indent_level) + << remap->get_call_str("&coerced", pexprs) << ";\n"; + + } else { + indent(out, indent_level) + << "coerced = " << remap->get_call_str(container, pexprs) << ";\n"; + } + return_expr = "&coerced"; + } else { // The general case; an ordinary constructor or function. return_expr = remap->call_function(out, indent_level, true, container, pexprs); @@ -5626,7 +5793,10 @@ write_function_instance(ostream &out, FunctionRemap *remap, // the C++ code was executing, and report this failure back to Python. // Don't do this for coercion constructors since they are called by // other wrapper functions which already check this on their own. - if (watch_asserts && (return_flags & RF_coerced) == 0) { + // Generated getters obviously can't raise asserts. + if (watch_asserts && (return_flags & RF_coerced) == 0 && + remap->_type != FunctionRemap::T_getter && + remap->_type != FunctionRemap::T_setter) { out << "#ifndef NDEBUG\n"; indent(out, indent_level) << "Notify *notify = Notify::ptr();\n"; @@ -5663,7 +5833,7 @@ write_function_instance(ostream &out, FunctionRemap *remap, TypeIndex type_index = builder.get_type(TypeManager::unwrap(TypeManager::resolve_type(orig_type)), false); const InterrogateType &itype = idb->get_type(type_index); indent(out, indent_level) - << "return DTool_PyInit_Finalize(self, " << return_expr << ", &" << CLASS_PREFIX << make_safe_name(itype.get_scoped_name()) << ", true, false);\n"; + << "return DTool_PyInit_Finalize(self, (void *)" << return_expr << ", &" << CLASS_PREFIX << make_safe_name(itype.get_scoped_name()) << ", true, false);\n"; } else if (TypeManager::is_integer(orig_type)) { if (return_flags & RF_compare) { @@ -5678,7 +5848,7 @@ write_function_instance(ostream &out, FunctionRemap *remap, indent(out, indent_level) << "return 0;\n"; } else { - cerr << "Warning: function has return type " << *orig_type + nout << "Warning: function has return type " << *orig_type << ", expected int or void:\n" << expected_params << "\n"; indent(out, indent_level) << "// Don't know what to do with return type " << *orig_type << ".\n"; @@ -5728,16 +5898,20 @@ write_function_instance(ostream &out, FunctionRemap *remap, if (return_expr == "coerced") { // We already did this earlier... + indent(out, indent_level) << "return true;\n"; } else if (TypeManager::is_reference_count(remap->_cpptype)) { indent(out, indent_level) << "coerced = MOVE(" << return_expr << ");\n"; + indent(out, indent_level) << "return true;\n"; + + } else if (TypeManager::is_trivial(remap->_cpptype)) { + indent(out, indent_level) << "return &coerced;\n"; } else { indent(out, indent_level) << "coerced = " << return_expr << ";\n"; indent(out, indent_level) << "manage = true;\n"; + indent(out, indent_level) << "return true;\n"; } - - indent(out, indent_level) << "return true;\n"; } // Close the extra braces opened earlier. @@ -5827,7 +6001,8 @@ error_raise_return(ostream &out, int indent_level, int return_flags, out << ");\n"; } - } else if ((return_flags & RF_err_null) != 0) { + } else if ((return_flags & RF_err_null) != 0 && + (return_flags & RF_pyobject) != 0) { // PyErr_Format always returns NULL. Passing it on directly allows // the compiler to make a tiny optimization, so why not. indent(out, indent_level) << "return PyErr_Format(PyExc_" << exc_type << ",\n"; @@ -6265,7 +6440,6 @@ record_object(TypeIndex type_index) { //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonNative:: generate_wrappers() { - inside_python_native = true; InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); // We use a while loop rather than a simple for loop, because we @@ -6314,7 +6488,6 @@ generate_wrappers() { record_function(dummy_type, func_index); } } - inside_python_native = false; } ////////////////////////////////////////////// @@ -6490,9 +6663,9 @@ has_coerce_constructor(CPPStructType *type) { } if (ftype->_flags & CPPFunctionType::F_constructor) { - if (params.size() == 1 && - TypeManager::unwrap(params[0]->_type) == type) { - // Skip a copy constructor. + if (ftype->_flags & (CPPFunctionType::F_copy_constructor | + CPPFunctionType::F_move_constructor)) { + // Skip a copy and move constructor. continue; } else { return 2; @@ -6626,37 +6799,19 @@ DoesInheritFromIsClass(const CPPStructType *inclass, const std::string &name) { // does the class have a supportable GetClassType which returns a TypeHandle. ////////////////////////////////////////////////////////////////////////////////////////// bool InterfaceMakerPythonNative:: -HasAGetClassTypeFunction(const InterrogateType &itype_class) { - InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); - - int num_methods = itype_class.number_of_methods(); - int mi; - - for (mi = 0; mi < num_methods; mi++) { - FunctionIndex func_index = itype_class.get_method(mi); - const InterrogateFunction &ifunc = idb->get_function(func_index); - if (ifunc.get_name() == "get_class_type") { - if (ifunc._instances != (InterrogateFunction::Instances *)NULL) { - InterrogateFunction::Instances::const_iterator ii; - for (ii = ifunc._instances->begin();ii != ifunc._instances->end();++ii) { - CPPInstance *cppinst = (*ii).second; - CPPFunctionType *cppfunc = cppinst->_type->as_function_type(); - - if (cppfunc != NULL && cppfunc->_return_type != NULL && - cppfunc->_parameters != NULL) { - CPPType *ret_type = TypeManager::unwrap(cppfunc->_return_type); - if (TypeManager::is_struct(ret_type) && - ret_type->get_simple_name() == "TypeHandle") { - if (cppfunc->_parameters->_parameters.size() == 0) { - return true; - } - } - } - } - } - } +HasAGetClassTypeFunction(CPPType *type) { + while (type->get_subtype() == CPPDeclaration::ST_typedef) { + type = type->as_typedef_type()->_type; } - return false; + + CPPStructType *struct_type = type->as_struct_type(); + if (struct_type == NULL) { + return false; + } + + CPPScope *scope = struct_type->get_scope(); + + return scope->_functions.find("get_class_type") != scope->_functions.end(); } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.h b/dtool/src/interrogate/interfaceMakerPythonNative.h index 2eb7e64b5e..ae62cfc72b 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.h +++ b/dtool/src/interrogate/interfaceMakerPythonNative.h @@ -199,7 +199,7 @@ public: bool DoesInheritFromIsClass(const CPPStructType * inclass, const std::string &name); bool IsPandaTypedObject(CPPStructType * inclass) { return DoesInheritFromIsClass(inclass,"TypedObject"); }; void write_python_instance(ostream &out, int indent_level, const std::string &return_expr, bool owns_memory, const InterrogateType &itype, bool is_const); - bool HasAGetClassTypeFunction(const InterrogateType &itype_class); + bool HasAGetClassTypeFunction(CPPType *type); int NeedsAStrFunction(const InterrogateType &itype_class); int NeedsAReprFunction(const InterrogateType &itype_class); bool NeedsARichCompareFunction(const InterrogateType &itype_class); diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 6e874462f8..6563132bf4 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -53,7 +53,6 @@ InterrogateBuilder builder; std::string EXPORT_IMPORT_PREFIX; -bool inside_python_native = false; //////////////////////////////////////////////////////////////////// // Function: InterrogateBuilder::add_source_file @@ -1912,27 +1911,29 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { CPPType *return_type = NULL; CPPFunctionGroup *fgroup = make_property->_getter; - CPPFunctionGroup::Instances::const_iterator fi; - for (fi = fgroup->_instances.begin(); fi != fgroup->_instances.end(); ++fi) { - CPPInstance *function = (*fi); - CPPFunctionType *ftype = - function->_type->as_function_type(); - if (ftype != NULL && ftype->_parameters->_parameters.size() == 0) { - getter = function; - return_type = ftype->_return_type; + if (fgroup != NULL) { + CPPFunctionGroup::Instances::const_iterator fi; + for (fi = fgroup->_instances.begin(); fi != fgroup->_instances.end(); ++fi) { + CPPInstance *function = (*fi); + CPPFunctionType *ftype = + function->_type->as_function_type(); + if (ftype != NULL && ftype->_parameters->_parameters.size() == 0) { + getter = function; + return_type = ftype->_return_type; - // The return type of the non-const method probably better represents - // the type of the property we are creating. - if ((ftype->_flags & CPPFunctionType::F_const_method) == 0) { - break; + // The return type of the non-const method probably better represents + // the type of the property we are creating. + if ((ftype->_flags & CPPFunctionType::F_const_method) == 0) { + break; + } } } - } - if (getter == NULL || return_type == NULL) { - cerr << "No instance of getter '" - << make_property->_getter->_name << "' is suitable!\n"; - return 0; + if (getter == NULL || return_type == NULL) { + cerr << "No instance of getter '" + << fgroup->_name << "' is suitable!\n"; + return 0; + } } InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); @@ -1944,11 +1945,17 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { iproperty._name = make_property->get_simple_name(); iproperty._scoped_name = descope(make_property->get_local_name(&parser)); - iproperty._type = get_type(return_type, false); + if (return_type != NULL) { + iproperty._type = get_type(return_type, false); + } else { + iproperty._type = 0; + } - iproperty._flags |= InterrogateElement::F_has_getter; - iproperty._getter = get_function(getter, "", struct_type, - struct_type->get_scope(), 0); + if (getter != NULL) { + iproperty._flags |= InterrogateElement::F_has_getter; + iproperty._getter = get_function(getter, "", struct_type, + struct_type->get_scope(), 0); + } // See if there happens to be a comment before the MAKE_PROPERTY macro. if (make_property->_leading_comment != (CPPCommentBlock *)NULL) { @@ -1958,6 +1965,7 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type) { // Now look for setters. fgroup = make_property->_setter; if (fgroup != NULL) { + CPPFunctionGroup::Instances::const_iterator fi; for (fi = fgroup->_instances.begin(); fi != fgroup->_instances.end(); ++fi) { CPPInstance *function = (*fi); iproperty._flags |= InterrogateElement::F_has_setter; diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 9292f04b02..9653654629 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -25,6 +25,7 @@ #include "panda_getopt_long.h" #include "preprocess_argv.h" #include "pset.h" +#include "vector_string.h" Filename output_code_filename; string module_name; @@ -33,6 +34,7 @@ bool build_c_wrappers = false; bool build_python_wrappers = false; bool build_python_native_wrappers = false; bool track_interpreter = false; +vector_string imports; // Short command-line options. static const char *short_options = ""; @@ -46,6 +48,7 @@ enum CommandOptions { CO_python, CO_python_native, CO_track_interpreter, + CO_import, }; static struct option long_options[] = { @@ -56,6 +59,7 @@ static struct option long_options[] = { { "python", no_argument, NULL, CO_python }, { "python-native", no_argument, NULL, CO_python_native }, { "track-interpreter", no_argument, NULL, CO_track_interpreter }, + { "import", required_argument, NULL, CO_import }, { NULL } }; @@ -113,6 +117,9 @@ int write_python_table_native(ostream &out) { for(ii = libraries.begin(); ii != libraries.end(); ii++) { printf("Referencing Library %s\n", (*ii).c_str()); out << "extern LibraryDef " << *ii << "_moddef;\n"; + out << "extern void Dtool_" << *ii << "_RegisterTypes();\n"; + out << "extern void Dtool_" << *ii << "_ResolveExternals();\n"; + out << "extern void Dtool_" << *ii << "_BuildInstants(PyObject *module);\n"; } out << "\n" @@ -138,6 +145,19 @@ int write_python_table_native(ostream &out) { out << " in_interpreter = 1;\n"; } + vector_string::const_iterator si; + for (si = imports.begin(); si != imports.end(); ++si) { + out << " PyImport_Import(PyUnicode_FromString(\"" << *si << "\"));\n"; + } + + for (ii = libraries.begin(); ii != libraries.end(); ii++) { + out << " Dtool_" << *ii << "_RegisterTypes();\n"; + } + for (ii = libraries.begin(); ii != libraries.end(); ii++) { + out << " Dtool_" << *ii << "_ResolveExternals();\n"; + } + out << "\n"; + out << " LibraryDef *defs[] = {"; for(ii = libraries.begin(); ii != libraries.end(); ii++) { out << "&" << *ii << "_moddef, "; @@ -145,7 +165,15 @@ int write_python_table_native(ostream &out) { out << "NULL};\n" << "\n" - << " return Dtool_PyModuleInitHelper(defs, &py_" << library_name << "_module);\n" + << " PyObject *module = Dtool_PyModuleInitHelper(defs, &py_" << library_name << "_module);\n" + << " if (module != NULL) {\n"; + + for (ii = libraries.begin(); ii != libraries.end(); ii++) { + out << " Dtool_" << *ii << "_BuildInstants(module);\n"; + } + + out << " }\n" + << " return module;\n" << "}\n" << "\n" << "#else // Python 2 case\n" @@ -162,6 +190,18 @@ int write_python_table_native(ostream &out) { out << " in_interpreter = 1;\n"; } + for (si = imports.begin(); si != imports.end(); ++si) { + out << " PyImport_Import(PyUnicode_FromString(\"" << *si << "\"));\n"; + } + + for (ii = libraries.begin(); ii != libraries.end(); ii++) { + out << " Dtool_" << *ii << "_RegisterTypes();\n"; + } + for (ii = libraries.begin(); ii != libraries.end(); ii++) { + out << " Dtool_" << *ii << "_ResolveExternals();\n"; + } + out << "\n"; + out << " LibraryDef *defs[] = {"; for(ii = libraries.begin(); ii != libraries.end(); ii++) { out << "&" << *ii << "_moddef, "; @@ -169,7 +209,14 @@ int write_python_table_native(ostream &out) { out << "NULL};\n" << "\n" - << " Dtool_PyModuleInitHelper(defs, \"" << library_name << "\");\n" + << " PyObject *module = Dtool_PyModuleInitHelper(defs, \"" << library_name << "\");\n" + << " if (module != NULL) {\n"; + + for (ii = libraries.begin(); ii != libraries.end(); ii++) { + out << " Dtool_" << *ii << "_BuildInstants(module);\n"; + } + + out << " }\n" << "}\n" << "#endif\n" << "\n"; @@ -335,6 +382,10 @@ int main(int argc, char *argv[]) { track_interpreter = true; break; + case CO_import: + imports.push_back(optarg); + break; + default: exit(1); } diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index fa78d89664..05372ab30c 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -2570,4 +2570,59 @@ is_local(CPPType *source_type) { return false; */ -}; +} + +//////////////////////////////////////////////////////////////////// +// Function: TypeManager::is_trivial +// Access: Public, Static +// Description: Returns true if the type is trivial (or trivial +// enough for our purposes). +//////////////////////////////////////////////////////////////////// +bool TypeManager:: +is_trivial(CPPType *source_type) { + switch (source_type->get_subtype()) { + case CPPDeclaration::ST_const: + return is_trivial(source_type->as_const_type()->_wrapped_around); + + case CPPDeclaration::ST_reference: + return false; + + case CPPDeclaration::ST_pointer: + return true; + + case CPPDeclaration::ST_simple: + return true; + + case CPPDeclaration::ST_typedef: + return is_trivial(source_type->as_typedef_type()->_type); + + default: + if (source_type->is_trivial()) { + return true; + } else { + // This is a bit of a hack. is_trivial() returns false for types that + // have an empty constructor (since we can't use =default yet). + // For the other classes, it's just convenient to consider them trivial + // even if they aren't, since they are simple enough. + string name = source_type->get_simple_name(); + return (name == "ButtonHandle" || name == "DatagramIterator" || + name == "BitMask" || name == "Filename" || name == "pixel" || + name == "NodePath" || name == "LoaderOptions" || + name == "PointerToArray" || name == "ConstPointerToArray" || + name == "PStatThread" || + (name.size() >= 6 && name.substr(0, 6) == "LPlane") || + (name.size() > 6 && name.substr(0, 6) == "LPoint") || + (name.size() > 7 && name.substr(0, 7) == "LVector") || + (name.size() > 7 && name.substr(0, 7) == "LMatrix") || + (name.size() > 8 && name.substr(0, 8) == "LVecBase") || + (name.size() >= 9 && name.substr(0, 9) == "LParabola") || + (name.size() >= 9 && name.substr(0, 9) == "LRotation") || + (name.size() >= 11 && name.substr(0, 11) == "LQuaternion") || + (name.size() >= 12 && name.substr(0, 12) == "LOrientation") || + (name.size() > 16 && name.substr(0, 16) == "UnalignedLMatrix") || + (name.size() > 17 && name.substr(0, 17) == "UnalignedLVecBase")); + } + } + + return false; +} diff --git a/dtool/src/interrogate/typeManager.h b/dtool/src/interrogate/typeManager.h index 16b9dfda22..848f3907ca 100644 --- a/dtool/src/interrogate/typeManager.h +++ b/dtool/src/interrogate/typeManager.h @@ -146,7 +146,7 @@ public: static bool is_exported(CPPType *type); static bool is_local(CPPType *type); - + static bool is_trivial(CPPType *type); }; #endif diff --git a/dtool/src/interrogatedb/dtool_super_base.cxx b/dtool/src/interrogatedb/dtool_super_base.cxx index d695fb5ef5..84334cf4c8 100644 --- a/dtool/src/interrogatedb/dtool_super_base.cxx +++ b/dtool/src/interrogatedb/dtool_super_base.cxx @@ -21,7 +21,7 @@ class EmptyClass { Define_Module_Class_Private(dtoolconfig, DTOOL_SUPER_BASE, EmptyClass, DTOOL_SUPER_BASE111); static PyObject *GetSuperBase(PyObject *self) { - Py_INCREF(&(Dtool_DTOOL_SUPER_BASE.As_PyTypeObject())); // order is important .. this is used for static functions + Py_INCREF((PyTypeObject *)&Dtool_DTOOL_SUPER_BASE); // order is important .. this is used for static functions return (PyObject *) &Dtool_DTOOL_SUPER_BASE; }; @@ -35,21 +35,21 @@ EXPCL_DTOOLCONFIG void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module if (!initdone) { initdone = true; - Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict = PyDict_New(); - PyDict_SetItemString(Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict, "DtoolClassDict", Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict); + Dtool_DTOOL_SUPER_BASE._PyType.tp_dict = PyDict_New(); + PyDict_SetItemString(Dtool_DTOOL_SUPER_BASE._PyType.tp_dict, "DtoolClassDict", Dtool_DTOOL_SUPER_BASE._PyType.tp_dict); - if (PyType_Ready(&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject()) < 0) { + if (PyType_Ready((PyTypeObject *)&Dtool_DTOOL_SUPER_BASE) < 0) { PyErr_SetString(PyExc_TypeError, "PyType_Ready(Dtool_DTOOL_SUPER_BASE)"); return; } - Py_INCREF(&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject()); + Py_INCREF((PyTypeObject *)&Dtool_DTOOL_SUPER_BASE); - PyDict_SetItemString(Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict, "DtoolGetSuperBase", PyCFunction_New(&Dtool_Methods_DTOOL_SUPER_BASE[0], &Dtool_DTOOL_SUPER_BASE.As_PyObject())); + PyDict_SetItemString(Dtool_DTOOL_SUPER_BASE._PyType.tp_dict, "DtoolGetSuperBase", PyCFunction_New(&Dtool_Methods_DTOOL_SUPER_BASE[0], (PyObject *)&Dtool_DTOOL_SUPER_BASE)); } if (module != NULL) { - Py_INCREF(&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject()); - PyModule_AddObject(module, "DTOOL_SUPER_BASE", (PyObject *)&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject()); + Py_INCREF((PyTypeObject *)&Dtool_DTOOL_SUPER_BASE); + PyModule_AddObject(module, "DTOOL_SUPER_BASE", (PyObject *)&Dtool_DTOOL_SUPER_BASE); } } @@ -123,9 +123,12 @@ EXPORT_THIS Dtool_PyTypedObject Dtool_DTOOL_SUPER_BASE = { 0, 0, }, + TypeHandle::none(), + Dtool_PyModuleClassInit_DTOOL_SUPER_BASE, Dtool_UpcastInterface_DTOOL_SUPER_BASE, Dtool_DowncastInterface_DTOOL_SUPER_BASE, - TypeHandle::none(), + NULL, + NULL, }; #endif // HAVE_PYTHON diff --git a/dtool/src/interrogatedb/interrogateType.cxx b/dtool/src/interrogatedb/interrogateType.cxx index 3c69995c99..d0ce756fa4 100644 --- a/dtool/src/interrogatedb/interrogateType.cxx +++ b/dtool/src/interrogatedb/interrogateType.cxx @@ -269,23 +269,3 @@ remap_indices(const IndexRemapper &remap) { } } - - -//////////////////////////////////////////////////////////////////// -// Function: GetRunTimeDictionary -//////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG RunTimeTypeDictionary & GetRunTimeDictionary() -{ - static RunTimeTypeDictionary dict; - return dict; -}; - -//////////////////////////////////////////////////////////////////// -// Function: GetRunTimeTypeList -//////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG RunTimeTypeList & GetRunTimeTypeList() -{ - static RunTimeTypeList list; - return list; -}; - diff --git a/dtool/src/interrogatedb/interrogateType.h b/dtool/src/interrogatedb/interrogateType.h index 8abf807f02..365c2a2d40 100644 --- a/dtool/src/interrogatedb/interrogateType.h +++ b/dtool/src/interrogatedb/interrogateType.h @@ -231,14 +231,4 @@ INLINE istream &operator >> (istream &in, InterrogateType::EnumValue &d); #include "interrogateType.I" -#include -#include -struct Dtool_PyTypedObject; -typedef std::map< int , Dtool_PyTypedObject *> RunTimeTypeDictionary; -typedef std::set RunTimeTypeList; - -EXPCL_DTOOLCONFIG RunTimeTypeDictionary & GetRunTimeDictionary(); -EXPCL_DTOOLCONFIG RunTimeTypeList & GetRunTimeTypeList(); - - #endif diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 11af0c1ace..91b0dd9f1a 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -26,6 +26,10 @@ PyMemberDef standard_type_members[] = { {NULL} /* Sentinel */ }; +static RuntimeTypeMap runtime_type_map; +static RuntimeTypeSet runtime_type_set; +static NamedTypeMap named_type_map; + //////////////////////////////////////////////////////////////////// // Function: DtoolCanThisBeAPandaInstance // Description: Given a valid (non-NULL) PyObject, does a simple @@ -360,7 +364,7 @@ PyObject *DTool_CreatePyInstanceTyped(void *local_this_in, Dtool_PyTypedObject & ///////////////////////////////////////////// // ask class to allocate an instance.. ///////////////////////////////////////////// - Dtool_PyInstDef *self = (Dtool_PyInstDef *) target_class->As_PyTypeObject().tp_new(&target_class->As_PyTypeObject(), NULL, NULL); + Dtool_PyInstDef *self = (Dtool_PyInstDef *) target_class->_PyType.tp_new(&target_class->_PyType, NULL, NULL); if (self != NULL) { self->_ptr_to_object = new_local_this; self->_memory_rules = memory_rules; @@ -377,7 +381,7 @@ PyObject *DTool_CreatePyInstanceTyped(void *local_this_in, Dtool_PyTypedObject & // if we get this far .. just wrap the thing in the known type ?? // better than aborting...I guess.... ///////////////////////////////////////////////////// - Dtool_PyInstDef *self = (Dtool_PyInstDef *) known_class_type.As_PyTypeObject().tp_new(&known_class_type.As_PyTypeObject(), NULL, NULL); + Dtool_PyInstDef *self = (Dtool_PyInstDef *) known_class_type._PyType.tp_new(&known_class_type._PyType, NULL, NULL); if (self != NULL) { self->_ptr_to_object = local_this_in; self->_memory_rules = memory_rules; @@ -401,7 +405,7 @@ PyObject *DTool_CreatePyInstance(void *local_this, Dtool_PyTypedObject &in_class } Dtool_PyTypedObject *classdef = &in_classdef; - Dtool_PyInstDef *self = (Dtool_PyInstDef *) classdef->As_PyTypeObject().tp_new(&classdef->As_PyTypeObject(), NULL, NULL); + Dtool_PyInstDef *self = (Dtool_PyInstDef *) classdef->_PyType.tp_new(&classdef->_PyType, NULL, NULL); if (self != NULL) { self->_ptr_to_object = local_this; self->_memory_rules = memory_rules; @@ -446,42 +450,97 @@ void Dtool_Accum_MethDefs(PyMethodDef in[], MethodDefmap &themap) { // /////////////////////////////////////////////////////////////////////////////// void -RegisterRuntimeClass(Dtool_PyTypedObject *otype, int class_id) { - if (class_id == 0) { +RegisterNamedClass(const string &name, Dtool_PyTypedObject &otype) { + pair result = + named_type_map.insert(NamedTypeMap::value_type(name, &otype)); + + if (!result.second) { + // There was already a class with this name in the dictionary. interrogatedb_cat.warning() - << "Class " << otype->_PyType.tp_name + << "Double definition for class " << name << "\n"; + } +} + +void +RegisterRuntimeTypedClass(Dtool_PyTypedObject &otype) { + int type_index = otype._type.get_index(); + + if (type_index == 0) { + interrogatedb_cat.warning() + << "Class " << otype._PyType.tp_name << " has a zero TypeHandle value; check that init_type() is called.\n"; - } else if (class_id > 0) { - RunTimeTypeDictionary &dict = GetRunTimeDictionary(); - pair result = - dict.insert(RunTimeTypeDictionary::value_type(class_id, otype)); + } else if (type_index < 0 || type_index >= TypeRegistry::ptr()->get_num_typehandles()) { + interrogatedb_cat.warning() + << "Class " << otype._PyType.tp_name + << " has an illegal TypeHandle value; check that init_type() is called.\n"; + + } else { + pair result = + runtime_type_map.insert(RuntimeTypeMap::value_type(type_index, &otype)); if (!result.second) { - // There was already an entry in the dictionary for class_id. + // There was already an entry in the dictionary for type_index. Dtool_PyTypedObject *other_type = (*result.first).second; interrogatedb_cat.warning() - << "Classes " << otype->_PyType.tp_name + << "Classes " << otype._PyType.tp_name << " and " << other_type->_PyType.tp_name - << " share the same TypeHandle value (" << class_id + << " share the same TypeHandle value (" << type_index << "); check class definitions.\n"; } else { - GetRunTimeTypeList().insert(class_id); - otype->_type = TypeRegistry::ptr()->find_type_by_id(class_id); + runtime_type_set.insert(type_index); } } } +Dtool_PyTypedObject * +LookupNamedClass(const string &name) { + NamedTypeMap::const_iterator it; + it = named_type_map.find(name); + + if (it == named_type_map.end()) { + // Find a type named like this in the type registry. + TypeHandle handle = TypeRegistry::ptr()->find_type(name); + if (handle.get_index() > 0) { + RuntimeTypeMap::const_iterator it2; + it2 = runtime_type_map.find(handle.get_index()); + if (it2 != runtime_type_map.end()) { + return it2->second; + } + } + + interrogatedb_cat.error() + << "Attempt to use type " << name << " which has not yet been defined!\n"; + return NULL; + } else { + return it->second; + } +} + +Dtool_PyTypedObject * +LookupRuntimeTypedClass(TypeHandle handle) { + RuntimeTypeMap::const_iterator it; + it = runtime_type_map.find(handle.get_index()); + + if (it == runtime_type_map.end()) { + interrogatedb_cat.error() + << "Attempt to use type " << handle << " which has not yet been defined!\n"; + return NULL; + } else { + return it->second; + } +} + /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// Dtool_PyTypedObject *Dtool_RuntimeTypeDtoolType(int type) { - RunTimeTypeDictionary::iterator di = GetRunTimeDictionary().find(type); - if (di != GetRunTimeDictionary().end()) { + RuntimeTypeMap::iterator di = runtime_type_map.find(type); + if (di != runtime_type_map.end()) { return di->second; } else { - int type2 = get_best_parent_from_Set(type, GetRunTimeTypeList()); - di = GetRunTimeDictionary().find(type2); - if (di != GetRunTimeDictionary().end()) { + int type2 = get_best_parent_from_Set(type, runtime_type_set); + di = runtime_type_map.find(type2); + if (di != runtime_type_map.end()) { return di->second; } } @@ -526,11 +585,6 @@ PyObject *Dtool_PyModuleInitHelper(LibraryDef *defs[], const char *modulename) { #endif } - // the constant inits... enums, classes ... - for (int y = 0; defs[y] != NULL; y++) { - defs[y]->_constants(module); - } - PyModule_AddIntConstant(module, "Dtool_PyNativeInterface", 1); return module; } @@ -710,33 +764,6 @@ PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op) { return PyBool_FromLong(result); } -PyObject *make_list_for_item(PyObject *self, const char *num_name, - const char *element_name) { - PyObject *num_result = PyObject_CallMethod(self, (char *)num_name, (char *)"()"); - if (num_result == NULL) { - return NULL; - } - - Py_ssize_t num_elements; -#if PY_MAJOR_VERSION >= 3 - num_elements = PyLong_AsSsize_t(num_result); -#else - num_elements = PyInt_AsSsize_t(num_result); -#endif - Py_DECREF(num_result); - - PyObject *list = PyList_New(num_elements); - for (int i = 0; i < num_elements; ++i) { - PyObject *element = PyObject_CallMethod(self, (char *)element_name, (char *)"(i)", i); - if (element == NULL) { - Py_DECREF(list); - return NULL; - } - PyList_SET_ITEM(list, i, element); - } - return list; -} - //////////////////////////////////////////////////////////////////// // Function: copy_from_make_copy // Description: This is a support function for a synthesized diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index e6847359c3..ad58b775b5 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -143,17 +143,17 @@ using namespace std; /////////////////////////////////////////////////////////////////////////////////// struct Dtool_PyTypedObject; -typedef std::map RunTimeTypeDictionary; -typedef std::set RunTimeTypeList; - -EXPCL_DTOOLCONFIG RunTimeTypeDictionary &GetRunTimeDictionary(); -EXPCL_DTOOLCONFIG RunTimeTypeList &GetRunTimeTypeList(); +typedef std::map RuntimeTypeMap; +typedef std::set RuntimeTypeSet; +typedef std::map NamedTypeMap; ////////////////////////////////////////////////////////// // used to stamp dtool instance.. #define PY_PANDA_SIGNATURE 0xbeaf typedef void *(*UpcastFunction)(PyObject *,Dtool_PyTypedObject *); typedef void *(*DowncastFunction)(void *, Dtool_PyTypedObject *); +typedef void *(*CoerceFunction)(PyObject *, void *); +typedef void (*ModuleClassInitFunction)(PyObject *module); //inline Dtool_PyTypedObject * Dtool_RuntimeTypeDtoolType(int type); //inline void Dtool_Deallocate_General(PyObject * self); @@ -196,16 +196,16 @@ struct Dtool_PyTypedObject { // Standard Python Features.. PyTypeObject _PyType; - // My Class Level Features.. - UpcastFunction _Dtool_UpcastInterface; // The Upcast Function By Slot - DowncastFunction _Dtool_DowncastInterface; // The Downcast Function By Slot - // May be TypeHandle::none() to indicate a non-TypedObject class. TypeHandle _type; - // some convenience functions.. - inline PyTypeObject &As_PyTypeObject() { return _PyType; }; - inline PyObject &As_PyObject() { return (PyObject &)_PyType; }; + ModuleClassInitFunction _Dtool_ModuleClassInit; + + UpcastFunction _Dtool_UpcastInterface; // The Upcast Function By Slot + DowncastFunction _Dtool_DowncastInterface; // The Downcast Function By Slot + + CoerceFunction _Dtool_ConstCoerce; + CoerceFunction _Dtool_Coerce; }; // This is now simply a forward declaration. The actual definition is created @@ -217,7 +217,7 @@ struct Dtool_PyTypedObject { // More Macro(s) to Implement class functions.. Usually used if C++ needs type information //////////////////////////////////////////////////////////////////////// #define Define_Dtool_new(CLASS_NAME,CNAME)\ -PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds) {\ +static PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds) {\ (void) args; (void) kwds;\ PyObject *self = type->tp_alloc(type, 0);\ ((Dtool_PyInstDef *)self)->_signature = PY_PANDA_SIGNATURE;\ @@ -291,7 +291,11 @@ EXPCL_DTOOLCONFIG bool DtoolCanThisBeAPandaInstance(PyObject *self); // /////////////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG void RegisterRuntimeClass(Dtool_PyTypedObject *otype, int class_id); +EXPCL_DTOOLCONFIG void RegisterNamedClass(const string &name, Dtool_PyTypedObject &otype); +EXPCL_DTOOLCONFIG void RegisterRuntimeTypedClass(Dtool_PyTypedObject &otype); + +EXPCL_DTOOLCONFIG Dtool_PyTypedObject *LookupNamedClass(const string &name); +EXPCL_DTOOLCONFIG Dtool_PyTypedObject *LookupRuntimeTypedClass(TypeHandle handle); /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -305,7 +309,7 @@ EXPCL_DTOOLCONFIG Dtool_PyTypedObject *Dtool_RuntimeTypeDtoolType(int type); // with these as the generated code depends on how this is set // up.. //////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject * classdef, void ** answer); +EXPCL_DTOOLCONFIG void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject *classdef, void **answer); EXPCL_DTOOLCONFIG void *DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, int param, const string &function_name, bool const_ok, bool report_errors); @@ -407,11 +411,9 @@ template INLINE PyObject *DTool_CreatePyInstanceTyped(T *obj, bool memo //struct Dtool_PyTypedObject Dtool_##CLASS_NAME; #define Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)\ -extern EXPORT_THIS Dtool_PyTypedObject Dtool_##CLASS_NAME;\ -int Dtool_Init_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\ -PyObject * Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds);\ -void * Dtool_UpcastInterface_##CLASS_NAME(PyObject *self, Dtool_PyTypedObject *requested_type);\ -void * Dtool_DowncastInterface_##CLASS_NAME(void *self, Dtool_PyTypedObject *requested_type); +extern struct Dtool_PyTypedObject Dtool_##CLASS_NAME;\ +static int Dtool_Init_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\ +static PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds); /////////////////////////////////////////////////////////////////////////////// #define Define_Module_Class(MODULE_NAME,CLASS_NAME,CNAME,PUBLIC_NAME)\ @@ -460,10 +462,7 @@ EXPCL_DTOOLCONFIG void Dtool_Accum_MethDefs(PyMethodDef in[], MethodDefmap &them /// fallowing structors and code.. along with the support of interigate_module /////////////////////////////////////////////////////////////////////////////// struct LibraryDef { - typedef void (*ConstantFunction)(PyObject *); - PyMethodDef *_methods; - ConstantFunction _constants; }; /////////////////////////////////////////////////////////////////////////////// @@ -505,10 +504,6 @@ EXPCL_DTOOLCONFIG int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2); EXPCL_DTOOLCONFIG PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op); -EXPCL_DTOOLCONFIG PyObject * -make_list_for_item(PyObject *self, const char *num_name, - const char *element_name); - EXPCL_DTOOLCONFIG PyObject * copy_from_make_copy(PyObject *self); @@ -527,6 +522,8 @@ PyLongOrInt_FromUnsignedLong(unsigned long value); EXPCL_DTOOLCONFIG extern struct Dtool_PyTypedObject Dtool_DTOOL_SUPER_BASE; EXPCL_DTOOLCONFIG extern void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module); +#define Dtool_Ptr_DTOOL_SUPER_BASE (&Dtool_DTOOL_SUPER_BASE) + #endif // HAVE_PYTHON && !CPPPARSER #endif // PY_PANDA_H_ diff --git a/dtool/src/parser-inc/iostream b/dtool/src/parser-inc/iostream index 87fd92ebcd..5cd485d04d 100644 --- a/dtool/src/parser-inc/iostream +++ b/dtool/src/parser-inc/iostream @@ -43,6 +43,9 @@ __published: static const openmode in; static const openmode out; static const openmode trunc; +protected: + // Force this to be a non-trivial type. + ios_base() {}; }; class ios : public ios_base { __published: diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 5aff172e2a..8d081ebf5f 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1411,7 +1411,10 @@ def CompileImod(wobj, wsrc, opts): # Assume that interrogate_module is on the PATH somewhere. cmd = 'interrogate_module' - cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native ' + cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native' + importmod = GetValueOption(opts, "IMPORT:") + if importmod: + cmd += ' -import ' + importmod for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x) oscmd(cmd) CompileCxx(wobj,woutc,opts) @@ -1592,20 +1595,13 @@ def CompileLink(dll, obj, opts): cmd = cxx + ' -undefined dynamic_lookup' if ("BUNDLE" in opts): cmd += ' -bundle ' else: - if GetOrigExt(dll) == ".pyd": - install_name = '@loader_path/../panda3d/' + os.path.basename(dll) - else: - install_name = os.path.basename(dll) + install_name = os.path.basename(dll) cmd += ' -dynamiclib -install_name ' + install_name cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp' else: cmd = cxx + ' -shared' if ("MODULE" not in opts): cmd += " -Wl,-soname=" + os.path.basename(dll) - if GetOrigExt(dll) == ".pyd" and not os.path.basename(dll).startswith('core'): - # Tell the other libraries where to find core.so. - # Not sure if this is the best way to do that, but it works. - cmd += " -Wl,-rpath '-Wl,$ORIGIN'" cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp' for x in obj: @@ -3856,12 +3852,11 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME): TargetAdd('vision_module.obj', input='libp3vision.in') TargetAdd('vision_module.obj', opts=OPTS) - TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision']) + TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core']) TargetAdd('vision.pyd', input='vision_module.obj') TargetAdd('vision.pyd', input='libp3vision_igate.obj') TargetAdd('vision.pyd', input='libp3vision.dll') - TargetAdd('vision.pyd', input='core.pyd') TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS) TargetAdd('vision.pyd', opts=['PYTHON']) @@ -3887,13 +3882,12 @@ if (PkgSkip("ROCKET") == 0) and (not RUNTIME): TargetAdd('rocket_module.obj', input='libp3rocket.in') TargetAdd('rocket_module.obj', opts=OPTS) - TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket']) + TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core']) TargetAdd('rocket.pyd', input='rocket_module.obj') TargetAdd('rocket.pyd', input='libp3rocket_igate.obj') TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj') TargetAdd('rocket.pyd', input='libp3rocket.dll') - TargetAdd('rocket.pyd', input='core.pyd') TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS) TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET']) @@ -3915,12 +3909,11 @@ if PkgSkip("AWESOMIUM") == 0 and not RUNTIME: TargetAdd('awesomium_module.obj', input='libp3awesomium.in') TargetAdd('awesomium_module.obj', opts=OPTS) - TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium']) + TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core']) TargetAdd('awesomium.pyd', input='awesomium_module.obj') TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj') TargetAdd('awesomium.pyd', input='libp3awesomium.dll') - TargetAdd('awesomium.pyd', input='core.pyd') TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS) TargetAdd('awesomium.pyd', opts=['PYTHON']) @@ -3949,12 +3942,11 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME): TargetAdd('libpandaskel.dll', opts=OPTS) TargetAdd('skel_module.obj', input='libp3skel.in') - TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel']) + TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core']) TargetAdd('skel.pyd', input='skel_module.obj') TargetAdd('skel.pyd', input='libp3skel_igate.obj') TargetAdd('skel.pyd', input='libpandaskel.dll') - TargetAdd('skel.pyd', input='core.pyd') TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS) TargetAdd('skel.pyd', opts=['PYTHON']) @@ -3988,12 +3980,11 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME): OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG'] TargetAdd('fx_module.obj', input='libp3distort.in') TargetAdd('fx_module.obj', opts=OPTS) - TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx']) + TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core']) TargetAdd('fx.pyd', input='fx_module.obj') TargetAdd('fx.pyd', input='libp3distort_igate.obj') TargetAdd('fx.pyd', input='libpandafx.dll') - TargetAdd('fx.pyd', input='core.pyd') TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS) TargetAdd('fx.pyd', opts=['PYTHON']) @@ -4016,12 +4007,11 @@ if (PkgSkip("VRPN")==0 and not RUNTIME): TargetAdd('vrpn_module.obj', input='libp3vrpn.in') TargetAdd('vrpn_module.obj', opts=OPTS) - TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn']) + TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core']) TargetAdd('vrpn.pyd', input='vrpn_module.obj') TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj') TargetAdd('vrpn.pyd', input='libp3vrpn.dll') - TargetAdd('vrpn.pyd', input='core.pyd') TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS) TargetAdd('vrpn.pyd', opts=['PYTHON']) @@ -4249,14 +4239,13 @@ if (not RUNTIME): TargetAdd('egg_module.obj', input='libp3egg2pg.in') TargetAdd('egg_module.obj', input='libp3egg.in') TargetAdd('egg_module.obj', opts=OPTS) - TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg']) + TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core']) TargetAdd('egg.pyd', input='egg_module.obj') TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj') TargetAdd('egg.pyd', input='libp3egg_igate.obj') TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj') TargetAdd('egg.pyd', input='libpandaegg.dll') - TargetAdd('egg.pyd', input='core.pyd') TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS) TargetAdd('egg.pyd', opts=['PYTHON']) @@ -4416,13 +4405,12 @@ if (PkgSkip("ODE")==0 and not RUNTIME): OPTS=['DIR:panda/metalibs/pandaode', 'ODE'] TargetAdd('ode_module.obj', input='libpandaode.in') TargetAdd('ode_module.obj', opts=OPTS) - TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode']) + TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core']) TargetAdd('ode.pyd', input='ode_module.obj') TargetAdd('ode.pyd', input='libpandaode_igate.obj') TargetAdd('ode.pyd', input='p3ode_ext_composite.obj') TargetAdd('ode.pyd', input='libpandaode.dll') - TargetAdd('ode.pyd', input='core.pyd') TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS) TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE']) @@ -4454,12 +4442,11 @@ if (PkgSkip("BULLET")==0 and not RUNTIME): OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET'] TargetAdd('bullet_module.obj', input='libpandabullet.in') TargetAdd('bullet_module.obj', opts=OPTS) - TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet']) + TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core']) TargetAdd('bullet.pyd', input='bullet_module.obj') TargetAdd('bullet.pyd', input='libpandabullet_igate.obj') TargetAdd('bullet.pyd', input='libpandabullet.dll') - TargetAdd('bullet.pyd', input='core.pyd') TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS) TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET']) @@ -4493,12 +4480,11 @@ if (PkgSkip("PHYSX")==0): OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC'] TargetAdd('physx_module.obj', input='libpandaphysx.in') TargetAdd('physx_module.obj', opts=OPTS) - TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx']) + TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core']) TargetAdd('physx.pyd', input='physx_module.obj') TargetAdd('physx.pyd', input='libpandaphysx_igate.obj') TargetAdd('physx.pyd', input='libpandaphysx.dll') - TargetAdd('physx.pyd', input='core.pyd') TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS) TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC']) @@ -4559,14 +4545,13 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): if (PkgSkip("PANDAPARTICLESYSTEM")==0): TargetAdd('physics_module.obj', input='libp3particlesystem.in') TargetAdd('physics_module.obj', opts=OPTS) - TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics']) + TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core']) TargetAdd('physics.pyd', input='physics_module.obj') TargetAdd('physics.pyd', input='libp3physics_igate.obj') if (PkgSkip("PANDAPARTICLESYSTEM")==0): TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj') TargetAdd('physics.pyd', input='libpandaphysics.dll') - TargetAdd('physics.pyd', input='core.pyd') TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS) TargetAdd('physics.pyd', opts=['PYTHON']) @@ -4816,7 +4801,7 @@ if (PkgSkip("DIRECT")==0): TargetAdd('direct_module.obj', input='libp3interval.in') TargetAdd('direct_module.obj', input='libp3distributed.in') TargetAdd('direct_module.obj', opts=OPTS) - TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct']) + TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core']) TargetAdd('direct.pyd', input='libp3dcparser_igate.obj') TargetAdd('direct.pyd', input='libp3showbase_igate.obj') @@ -4826,7 +4811,6 @@ if (PkgSkip("DIRECT")==0): TargetAdd('direct.pyd', input='direct_module.obj') TargetAdd('direct.pyd', input='libp3direct.dll') - TargetAdd('direct.pyd', input='core.pyd') TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS) TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI']) @@ -6026,12 +6010,11 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME): TargetAdd('ai_module.obj', input='libpandaai.in') TargetAdd('ai_module.obj', opts=OPTS) - TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai']) + TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core']) TargetAdd('ai.pyd', input='ai_module.obj') TargetAdd('ai.pyd', input='libpandaai_igate.obj') TargetAdd('ai.pyd', input='libpandaai.dll') - TargetAdd('ai.pyd', input='core.pyd') TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS) TargetAdd('ai.pyd', opts=['PYTHON']) diff --git a/panda/src/bullet/bulletRigidBodyNode.h b/panda/src/bullet/bulletRigidBodyNode.h index 73ba5568a3..309e2386a1 100644 --- a/panda/src/bullet/bulletRigidBodyNode.h +++ b/panda/src/bullet/bulletRigidBodyNode.h @@ -33,7 +33,7 @@ class BulletShape; class EXPCL_PANDABULLET BulletRigidBodyNode : public BulletBodyNode { PUBLISHED: - BulletRigidBodyNode(const char *name="rigid"); + explicit BulletRigidBodyNode(const char *name="rigid"); INLINE ~BulletRigidBodyNode(); // Mass & inertia diff --git a/panda/src/egg/eggGroupNode.h b/panda/src/egg/eggGroupNode.h index ffdfcb304c..b7c318941b 100644 --- a/panda/src/egg/eggGroupNode.h +++ b/panda/src/egg/eggGroupNode.h @@ -26,6 +26,7 @@ #include "luse.h" #include "globPattern.h" #include "plist.h" +#include "bamCacheRecord.h" class EggTextureCollection; class EggMaterialCollection; @@ -33,7 +34,6 @@ class EggPolygon; class EggVertex; class EggVertexPool; class DSearchPath; -class BamCacheRecord; //////////////////////////////////////////////////////////////////// // Class : EggGroupNode diff --git a/panda/src/express/memoryUsagePointers_ext.cxx b/panda/src/express/memoryUsagePointers_ext.cxx index eee3b5d0e6..63713cc907 100644 --- a/panda/src/express/memoryUsagePointers_ext.cxx +++ b/panda/src/express/memoryUsagePointers_ext.cxx @@ -17,9 +17,9 @@ #if defined(HAVE_PYTHON) && defined(DO_MEMORY_USAGE) #ifndef CPPPARSER -extern EXPCL_PANDAEXPRESS Dtool_PyTypedObject Dtool_TypedObject; -extern EXPCL_PANDAEXPRESS Dtool_PyTypedObject Dtool_TypedReferenceCount; -extern EXPCL_PANDAEXPRESS Dtool_PyTypedObject Dtool_ReferenceCount; +extern Dtool_PyTypedObject Dtool_TypedObject; +extern Dtool_PyTypedObject Dtool_TypedReferenceCount; +extern Dtool_PyTypedObject Dtool_ReferenceCount; #endif // CPPPARSER //////////////////////////////////////////////////////////////////// diff --git a/panda/src/express/namable.I b/panda/src/express/namable.I index adad9ec1e9..8d3e0b438d 100644 --- a/panda/src/express/namable.I +++ b/panda/src/express/namable.I @@ -45,6 +45,19 @@ operator = (const Namable &other) { return *this; } +#ifdef USE_MOVE_SEMANTICS +//////////////////////////////////////////////////////////////////// +// Function: Namable::Copy Assignment Operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE Namable &Namable:: +operator = (Namable &&other) NOEXCEPT { + _name = MOVE(other._name); + return *this; +} +#endif + //////////////////////////////////////////////////////////////////// // Function: Namable::set_name // Access: Public diff --git a/panda/src/express/namable.h b/panda/src/express/namable.h index 9c756827d2..84e01b0919 100644 --- a/panda/src/express/namable.h +++ b/panda/src/express/namable.h @@ -28,10 +28,14 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Namable : public MemoryBase { PUBLISHED: - INLINE Namable(const string &initial_name = ""); + INLINE explicit Namable(const string &initial_name = ""); INLINE Namable(const Namable ©); INLINE Namable &operator = (const Namable &other); +#ifdef USE_MOVE_SEMANTICS + INLINE Namable &operator = (Namable &&other) NOEXCEPT; +#endif + INLINE void set_name(const string &name); INLINE void clear_name(); INLINE bool has_name() const; diff --git a/panda/src/gobj/geom.h b/panda/src/gobj/geom.h index 35337bbfcc..5e5b269f10 100644 --- a/panda/src/gobj/geom.h +++ b/panda/src/gobj/geom.h @@ -60,7 +60,7 @@ protected: virtual PT(CopyOnWriteObject) make_cow_copy(); PUBLISHED: - Geom(const GeomVertexData *data); + explicit Geom(const GeomVertexData *data); protected: Geom(const Geom ©); diff --git a/panda/src/gobj/geomVertexArrayData.h b/panda/src/gobj/geomVertexArrayData.h index e0aebb95e5..58ffbb6b46 100644 --- a/panda/src/gobj/geomVertexArrayData.h +++ b/panda/src/gobj/geomVertexArrayData.h @@ -68,8 +68,8 @@ protected: virtual PT(CopyOnWriteObject) make_cow_copy(); PUBLISHED: - GeomVertexArrayData(const GeomVertexArrayFormat *array_format, - UsageHint usage_hint); + explicit GeomVertexArrayData(const GeomVertexArrayFormat *array_format, + UsageHint usage_hint); GeomVertexArrayData(const GeomVertexArrayData ©); void operator = (const GeomVertexArrayData ©); virtual ~GeomVertexArrayData(); diff --git a/panda/src/gobj/geomVertexData.h b/panda/src/gobj/geomVertexData.h index 034018430a..4c91761d52 100644 --- a/panda/src/gobj/geomVertexData.h +++ b/panda/src/gobj/geomVertexData.h @@ -80,12 +80,12 @@ protected: virtual PT(CopyOnWriteObject) make_cow_copy(); PUBLISHED: - GeomVertexData(const string &name, - const GeomVertexFormat *format, - UsageHint usage_hint); + explicit GeomVertexData(const string &name, + const GeomVertexFormat *format, + UsageHint usage_hint); GeomVertexData(const GeomVertexData ©); - GeomVertexData(const GeomVertexData ©, - const GeomVertexFormat *format); + explicit GeomVertexData(const GeomVertexData ©, + const GeomVertexFormat *format); void operator = (const GeomVertexData ©); virtual ~GeomVertexData(); ALLOC_DELETED_CHAIN(GeomVertexData); diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index 5381e5af26..d3fc0c4bb8 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -43,6 +43,7 @@ #include "pnmImage.h" #include "colorSpace.h" #include "geomEnums.h" +#include "bamCacheRecord.h" class PNMImage; class PfmFile; @@ -51,7 +52,6 @@ class FactoryParams; class PreparedGraphicsObjects; class CullTraverser; class CullTraverserData; -class BamCacheRecord; class TexturePeeker; struct DDSHeader; diff --git a/panda/src/gobj/textureStage.h b/panda/src/gobj/textureStage.h index 9831124864..9623f141a8 100644 --- a/panda/src/gobj/textureStage.h +++ b/panda/src/gobj/textureStage.h @@ -37,7 +37,7 @@ class FactoryParams; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_GOBJ TextureStage : public TypedWritableReferenceCount { PUBLISHED: - TextureStage(const string &name); + explicit TextureStage(const string &name); INLINE TextureStage(TextureStage ©); void operator = (const TextureStage ©); diff --git a/panda/src/ode/odeGeom_ext.I b/panda/src/ode/odeGeom_ext.I index 6d1cf2bebd..e7508da018 100644 --- a/panda/src/ode/odeGeom_ext.I +++ b/panda/src/ode/odeGeom_ext.I @@ -15,10 +15,6 @@ #include "odeSpace_ext.h" #include "lpoint3.h" -#ifndef CPPPARSER -IMPORT_THIS struct Dtool_PyTypedObject Dtool_LPoint3f; -#endif - //////////////////////////////////////////////////////////////////// // Function: OdeGeom::get_AA_bounds // Access: Published @@ -30,8 +26,8 @@ get_AA_bounds() const { LPoint3f *max_point = new LPoint3f; _this->get_AABB(*min_point, *max_point); - PyObject *min_inst = DTool_CreatePyInstance((void*) min_point, Dtool_LPoint3f, true, false); - PyObject *max_inst = DTool_CreatePyInstance((void*) max_point, Dtool_LPoint3f, true, false); + PyObject *min_inst = DTool_CreatePyInstance(min_point, true); + PyObject *max_inst = DTool_CreatePyInstance(max_point, true); return Py_BuildValue("NN", min_inst, max_inst); } diff --git a/panda/src/ode/odeSpace_ext.I b/panda/src/ode/odeSpace_ext.I index 78e9aeb7c3..8cbccc773e 100644 --- a/panda/src/ode/odeSpace_ext.I +++ b/panda/src/ode/odeSpace_ext.I @@ -15,10 +15,6 @@ /* okcircular */ #include "odeGeom_ext.h" -#ifndef CPPPARSER -IMPORT_THIS struct Dtool_PyTypedObject Dtool_LPoint3f; -#endif - //////////////////////////////////////////////////////////////////// // Function: OdeSpace::get_AA_bounds // Access: Published @@ -30,8 +26,8 @@ get_AA_bounds() const { LPoint3f *max_point = new LPoint3f; _this->get_AABB(*min_point, *max_point); - PyObject *min_inst = DTool_CreatePyInstance((void*) min_point, Dtool_LPoint3f, true, false); - PyObject *max_inst = DTool_CreatePyInstance((void*) max_point, Dtool_LPoint3f, true, false); + PyObject *min_inst = DTool_CreatePyInstance(min_point, true); + PyObject *max_inst = DTool_CreatePyInstance(max_point, true); return Py_BuildValue("NN", min_inst, max_inst); } diff --git a/panda/src/pgraph/camera.h b/panda/src/pgraph/camera.h index 54c0eeb945..c02c60da00 100644 --- a/panda/src/pgraph/camera.h +++ b/panda/src/pgraph/camera.h @@ -36,7 +36,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_PGRAPH Camera : public LensNode { PUBLISHED: - Camera(const string &name, Lens *lens = new PerspectiveLens()); + explicit Camera(const string &name, Lens *lens = new PerspectiveLens()); Camera(const Camera ©); public: diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 74ce52c3a8..68a5196550 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -177,8 +177,8 @@ PUBLISHED: INLINE explicit NodePath(const string &top_node_name, Thread *current_thread = Thread::get_current_thread()); INLINE explicit NodePath(PandaNode *node, Thread *current_thread = Thread::get_current_thread()); INLINE static NodePath any_path(PandaNode *node, Thread *current_thread = Thread::get_current_thread()); - NodePath(const NodePath &parent, PandaNode *child_node, - Thread *current_thread = Thread::get_current_thread()); + explicit NodePath(const NodePath &parent, PandaNode *child_node, + Thread *current_thread = Thread::get_current_thread()); INLINE NodePath(const NodePath ©); INLINE void operator = (const NodePath ©); diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index c1719a7658..dda7244acb 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -72,7 +72,7 @@ class GraphicsStateGuardianBase; class EXPCL_PANDA_PGRAPH PandaNode : public TypedWritableReferenceCount, public Namable, public LinkedListNode { PUBLISHED: - PandaNode(const string &name); + explicit PandaNode(const string &name); virtual ~PandaNode(); //published so that characters can be combined. virtual PandaNode *combine_with(PandaNode *other); diff --git a/panda/src/pnmimage/pnmImage.h b/panda/src/pnmimage/pnmImage.h index 4fba969690..10e3377635 100644 --- a/panda/src/pnmimage/pnmImage.h +++ b/panda/src/pnmimage/pnmImage.h @@ -68,10 +68,10 @@ class PNMFileType; class EXPCL_PANDA_PNMIMAGE PNMImage : public PNMImageHeader { PUBLISHED: INLINE PNMImage(); - PNMImage(const Filename &filename, PNMFileType *type = NULL); - INLINE PNMImage(int x_size, int y_size, int num_channels = 3, - xelval maxval = 255, PNMFileType *type = NULL, - ColorSpace color_space = CS_linear); + explicit PNMImage(const Filename &filename, PNMFileType *type = NULL); + INLINE explicit PNMImage(int x_size, int y_size, int num_channels = 3, + xelval maxval = 255, PNMFileType *type = NULL, + ColorSpace color_space = CS_linear); INLINE PNMImage(const PNMImage ©); INLINE void operator = (const PNMImage ©); diff --git a/panda/src/pnmimage/pnmimage_base.h b/panda/src/pnmimage/pnmimage_base.h index b75e6b0b74..ad5cf47555 100644 --- a/panda/src/pnmimage/pnmimage_base.h +++ b/panda/src/pnmimage/pnmimage_base.h @@ -42,8 +42,9 @@ typedef unsigned char gray; struct pixel { PUBLISHED: pixel() { } + pixel(gray fill) : r(fill), g(fill), b(fill) { } pixel(gray r, gray g, gray b) : r(r), g(g), b(b) { } - static int size() { return 3; } + gray operator [](int i) const { nassertr(i >= 0 && i < 3, 0); return *(&r + i); } gray &operator [](int i) { nassertr(i >= 0 && i < 3, r); return *(&r + i); } pixel operator + (const pixel &other) const @@ -60,6 +61,7 @@ PUBLISHED: { r *= mult; g *= mult; b *= mult; } #ifdef HAVE_PYTHON + static int size() { return 3; } void output(ostream &out) { out << "pixel(r=" << r << ", g=" << g << ", b=" << b << ")"; } diff --git a/panda/src/pstatclient/pStatThread.h b/panda/src/pstatclient/pStatThread.h index df0435585b..36a091faeb 100644 --- a/panda/src/pstatclient/pStatThread.h +++ b/panda/src/pstatclient/pStatThread.h @@ -29,7 +29,7 @@ class Thread; // with Panda's Thread instance. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_PSTATCLIENT PStatThread { -private: +public: INLINE PStatThread(); PUBLISHED: From 6fff37a294c8bb7ce7b5fea59059b48c932619b1 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Sat, 6 Jun 2015 13:39:30 -0500 Subject: [PATCH 007/203] Allow passing custom lens to #saveCubeMap/#saveSphereMap --- direct/src/showbase/ShowBase.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 35b60ce271..9ab3184d6a 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -2466,7 +2466,8 @@ class ShowBase(DirectObject.DirectObject): def saveCubeMap(self, namePrefix = 'cube_map_#.png', defaultFilename = 0, source = None, camera = None, size = 128, - cameraMask = PandaNode.getAllCameraMask()): + cameraMask = PandaNode.getAllCameraMask(), + sourceLens = None): """ Similar to screenshot(), this sets up a temporary cube map @@ -2494,6 +2495,9 @@ class ShowBase(DirectObject.DirectObject): if camera == None: camera = base.camera + if sourceLens == None: + sourceLens = base.camLens + if hasattr(source, "getWindow"): source = source.getWindow() @@ -2504,7 +2508,8 @@ class ShowBase(DirectObject.DirectObject): # Set the near and far planes from the default lens. lens = rig.find('**/+Camera').node().getLens() - lens.setNearFar(base.camLens.getNear(), base.camLens.getFar()) + + lens.setNearFar(sourceLens.getNear(), sourceLens.getFar()) # Now render a frame to fill up the texture. rig.reparentTo(camera) @@ -2525,7 +2530,7 @@ class ShowBase(DirectObject.DirectObject): defaultFilename = 0, source = None, camera = None, size = 256, cameraMask = PandaNode.getAllCameraMask(), - numVertices = 1000): + numVertices = 1000, sourceLens = None): """ This works much like saveCubeMap(), and uses the graphics API's hardware cube-mapping ability to get a 360-degree view @@ -2550,6 +2555,9 @@ class ShowBase(DirectObject.DirectObject): if camera == None: camera = base.camera + if sourceLens == None: + sourceLens = base.camLens + if hasattr(source, "getWindow"): source = source.getWindow() @@ -2568,7 +2576,7 @@ class ShowBase(DirectObject.DirectObject): # Set the near and far planes from the default lens. lens = rig.find('**/+Camera').node().getLens() - lens.setNearFar(base.camLens.getNear(), base.camLens.getFar()) + lens.setNearFar(sourceLens.getNear(), sourceLens.getFar()) # Set up the scene to convert the cube map. It's just a # simple scene, with only the FisheyeMaker object in it. From 48208b0f27fb1b26170a7e43b2cfd87fa0c0e38c Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 13 Jun 2015 13:33:11 +0200 Subject: [PATCH 008/203] Support #pragma once in interrogate --- dtool/src/cppparser/cppFile.cxx | 7 ++++-- dtool/src/cppparser/cppFile.h | 1 + dtool/src/cppparser/cppPreprocessor.cxx | 29 +++++++++++++++++++++++-- dtool/src/cppparser/cppPreprocessor.h | 2 ++ 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/dtool/src/cppparser/cppFile.cxx b/dtool/src/cppparser/cppFile.cxx index 231c6dd104..4e8e8fba95 100644 --- a/dtool/src/cppparser/cppFile.cxx +++ b/dtool/src/cppparser/cppFile.cxx @@ -26,7 +26,8 @@ CPPFile:: CPPFile(const Filename &filename, const Filename &filename_as_referenced, Source source) : _filename(filename), _filename_as_referenced(filename_as_referenced), - _source(source) + _source(source), + _pragma_once(false) { _filename.set_text(); _filename_as_referenced.set_text(); @@ -42,7 +43,8 @@ CPPFile:: CPPFile(const CPPFile ©) : _filename(copy._filename), _filename_as_referenced(copy._filename_as_referenced), - _source(copy._source) + _source(copy._source), + _pragma_once(copy._pragma_once) { } @@ -56,6 +58,7 @@ operator = (const CPPFile ©) { _filename = copy._filename; _filename_as_referenced = copy._filename_as_referenced; _source = copy._source; + _pragma_once = copy._pragma_once; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/cppparser/cppFile.h b/dtool/src/cppparser/cppFile.h index f46d19f167..fde2209465 100644 --- a/dtool/src/cppparser/cppFile.h +++ b/dtool/src/cppparser/cppFile.h @@ -59,6 +59,7 @@ public: Filename _filename; Filename _filename_as_referenced; Source _source; + mutable bool _pragma_once; }; inline ostream &operator << (ostream &out, const CPPFile &file) { diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 482a8cbabe..52c758acd6 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -620,6 +620,7 @@ push_file(const CPPFile &file) { indent(cerr, _files.size() * 2) << "Reading " << file << "\n"; } + _files.push_back(InputFile()); InputFile &infile = _files.back(); @@ -1158,7 +1159,7 @@ process_directive(int c) { } else if (command == "include") { handle_include_directive(args, first_line, first_col, first_file); } else if (command == "pragma") { - // Quietly ignore pragmas. + handle_pragma_directive(args, first_line, first_col, first_file); } else if (command == "ident") { // Quietly ignore idents. } else if (command == "error") { @@ -1462,7 +1463,16 @@ handle_include_directive(const string &args, int first_line, first_line, first_col, first_file); } else { _last_c = '\0'; - if (!push_file(CPPFile(filename, filename_as_referenced, source))) { + + CPPFile file(filename, filename_as_referenced, source); + + // Don't include it if we included it before and it had #pragma once. + ParsedFiles::const_iterator it = _parsed_files.find(file); + if (it->_pragma_once) { + return; + } + + if (!push_file(file)) { warning("Unable to read " + filename.get_fullpath(), first_line, first_col, first_file); } @@ -1473,6 +1483,21 @@ handle_include_directive(const string &args, int first_line, } } +//////////////////////////////////////////////////////////////////// +// Function: CPPPreprocessor::handle_pragma_directive +// Access: Private +// Description: +//////////////////////////////////////////////////////////////////// +void CPPPreprocessor:: +handle_pragma_directive(const string &args, int first_line, + int first_col, const CPPFile &first_file) { + if (args == "once") { + ParsedFiles::iterator it = _parsed_files.find(first_file); + assert(it != _parsed_files.end()); + it->_pragma_once = true; + } +} + //////////////////////////////////////////////////////////////////// // Function: CPPPreprocessor::handle_error_directive // Access: Private diff --git a/dtool/src/cppparser/cppPreprocessor.h b/dtool/src/cppparser/cppPreprocessor.h index 6d86a06846..571ef0598b 100644 --- a/dtool/src/cppparser/cppPreprocessor.h +++ b/dtool/src/cppparser/cppPreprocessor.h @@ -133,6 +133,8 @@ private: int first_col, const CPPFile &first_file); void handle_include_directive(const string &args, int first_line, int first_col, const CPPFile &first_file); + void handle_pragma_directive(const string &args, int first_line, + int first_col, const CPPFile &first_file); void handle_error_directive(const string &args, int first_line, int first_col, const CPPFile &first_file); From c85a92d378f37c023bdddd40b525cbcf49b15a95 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 13 Jun 2015 13:34:03 +0200 Subject: [PATCH 009/203] Add assertion to GeoMipTerrain::get_block_node_path --- panda/src/grutil/geoMipTerrain.I | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/grutil/geoMipTerrain.I b/panda/src/grutil/geoMipTerrain.I index 3d972cb7bf..a80703c9e3 100644 --- a/panda/src/grutil/geoMipTerrain.I +++ b/panda/src/grutil/geoMipTerrain.I @@ -385,8 +385,11 @@ get_flatten_mode() { //////////////////////////////////////////////////////////////////// INLINE const NodePath GeoMipTerrain:: get_block_node_path(unsigned short mx, unsigned short my) { + nassertr(mx < _blocks.size(), NodePath::fail()); + nassertr(my < _blocks[mx].size(), NodePath::fail()); return _blocks[mx][my]; } + //////////////////////////////////////////////////////////////////// // Function: GeoMipTerrain::get_block_from_pos // Access: Published From 82e098e57878a561300ef1873aed0e5395e3a6bd Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 13 Jun 2015 18:20:18 +0200 Subject: [PATCH 010/203] Move auto-rescale-normal handling out of GSG, support normalizing normals in shader generator --- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 37 ++------- panda/src/dxgsg9/dxGraphicsStateGuardian9.h | 3 - .../glstuff/glGraphicsStateGuardian_src.cxx | 76 ++----------------- .../src/glstuff/glGraphicsStateGuardian_src.h | 2 - panda/src/pgraph/cullResult.cxx | 25 +++++- panda/src/pgraph/rescaleNormalAttrib.cxx | 15 ++++ panda/src/pgraph/rescaleNormalAttrib.h | 1 + panda/src/pgraphnodes/shaderGenerator.cxx | 14 +++- panda/src/pgraphnodes/shaderGenerator.h | 1 + 9 files changed, 61 insertions(+), 113 deletions(-) diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index cafc199a95..c8d7833b4f 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -2316,8 +2316,6 @@ reset() { Geom::GR_triangle_strip | Geom::GR_triangle_fan | Geom::GR_flat_first_vertex; - _auto_rescale_normal = false; - // overwrite gsg defaults with these values HRESULT hr; @@ -2864,10 +2862,6 @@ do_issue_transform() { } _transform_stale = false; - - if (_auto_rescale_normal) { - do_auto_rescale_normal(); - } } //////////////////////////////////////////////////////////////////// @@ -3001,10 +2995,12 @@ do_issue_render_mode() { //////////////////////////////////////////////////////////////////// void DXGraphicsStateGuardian9:: do_issue_rescale_normal() { - const RescaleNormalAttrib *target_rescale_normal = DCAST(RescaleNormalAttrib, _target_rs->get_attrib_def(RescaleNormalAttrib::get_class_slot())); - RescaleNormalAttrib::Mode mode = target_rescale_normal->get_mode(); + RescaleNormalAttrib::Mode mode = RescaleNormalAttrib::M_none; - _auto_rescale_normal = false; + const RescaleNormalAttrib *target_rescale_normal; + if (_target_rs->get_attrib(target_rescale_normal)) { + mode = target_rescale_normal->get_mode(); + } switch (mode) { case RescaleNormalAttrib::M_none: @@ -3016,11 +3012,6 @@ do_issue_rescale_normal() { set_render_state(D3DRS_NORMALIZENORMALS, true); break; - case RescaleNormalAttrib::M_auto: - _auto_rescale_normal = true; - do_auto_rescale_normal(); - break; - default: dxgsg9_cat.error() << "Unknown rescale_normal mode " << (int)mode << endl; @@ -4234,24 +4225,6 @@ set_read_buffer(const RenderBuffer &rb) { return; } -//////////////////////////////////////////////////////////////////// -// Function: DXGraphicsStateGuardian9::do_auto_rescale_normal -// Access: Protected -// Description: Issues the appropriate DX commands to either rescale -// or normalize the normals according to the current -// transform. -//////////////////////////////////////////////////////////////////// -void DXGraphicsStateGuardian9:: -do_auto_rescale_normal() { - if (_internal_transform->has_identity_scale()) { - // If there's no scale, don't normalize anything. - set_render_state(D3DRS_NORMALIZENORMALS, false); - } else { - // If there is a scale, turn on normalization. - set_render_state(D3DRS_NORMALIZENORMALS, true); - } -} - //////////////////////////////////////////////////////////////////// // Function: DXGraphicsStateGuardian9::get_light_color // Access: Public diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.h b/panda/src/dxgsg9/dxGraphicsStateGuardian9.h index 6bc8af012d..b31e1940f4 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.h +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.h @@ -208,8 +208,6 @@ protected: void set_draw_buffer(const RenderBuffer &rb); void set_read_buffer(const RenderBuffer &rb); - void do_auto_rescale_normal(); - void disable_standard_vertex_arrays(); bool update_standard_vertex_arrays(bool force); void disable_standard_texture_bindings(); @@ -277,7 +275,6 @@ protected: bool _supports_render_texture; RenderBuffer::Type _cur_read_pixel_buffer; // source for copy_pixel_buffer operation - bool _auto_rescale_normal; PN_stdfloat _material_ambient; PN_stdfloat _material_diffuse; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 6de2521d3a..9c6be3444c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -2280,8 +2280,6 @@ reset() { } #endif - _auto_rescale_normal = false; - // Ensure the initial state is what we say it should be (in some // cases, we don't want the GL default settings; in others, we have // to force the point with some drivers that aren't strictly @@ -5932,10 +5930,6 @@ do_issue_transform() { DO_PSTATS_STUFF(_transform_state_pcollector.add_level(1)); glMatrixMode(GL_MODELVIEW); GLPf(LoadMatrix)(transform->get_mat().get_data()); - - if (_auto_rescale_normal) { - do_auto_rescale_normal(); - } #endif _transform_stale = false; @@ -6155,12 +6149,12 @@ do_issue_antialias() { //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: do_issue_rescale_normal() { + RescaleNormalAttrib::Mode mode = RescaleNormalAttrib::M_none; + const RescaleNormalAttrib *target_rescale_normal; - _target_rs->get_attrib_def(target_rescale_normal); - - RescaleNormalAttrib::Mode mode = target_rescale_normal->get_mode(); - - _auto_rescale_normal = false; + if (_target_rs->get_attrib(target_rescale_normal)) { + mode = target_rescale_normal->get_mode(); + } switch (mode) { case RescaleNormalAttrib::M_none: @@ -6186,11 +6180,6 @@ do_issue_rescale_normal() { } break; - case RescaleNormalAttrib::M_auto: - _auto_rescale_normal = true; - do_auto_rescale_normal(); - break; - default: GLCAT.error() << "Unknown rescale_normal mode " << (int)mode << endl; @@ -9463,61 +9452,6 @@ free_pointers() { #endif } -//////////////////////////////////////////////////////////////////// -// Function: GLGraphicsStateGuardian::do_auto_rescale_normal -// Access: Protected -// Description: Issues the appropriate GL commands to either rescale -// or normalize the normals according to the current -// transform. -//////////////////////////////////////////////////////////////////// -void CLP(GraphicsStateGuardian):: -do_auto_rescale_normal() { -#ifndef OPENGLES_2 - if (_internal_transform->has_identity_scale()) { - // If there's no scale at all, don't do anything. - glDisable(GL_NORMALIZE); - if (GLCAT.is_spam()) { - GLCAT.spam() << "glDisable(GL_NORMALIZE)\n"; - } - if (_supports_rescale_normal && support_rescale_normal) { - glDisable(GL_RESCALE_NORMAL); - if (GLCAT.is_spam()) { - GLCAT.spam() << "glDisable(GL_RESCALE_NORMAL)\n"; - } - } - - } else if (_internal_transform->has_uniform_scale()) { - // There's a uniform scale; use the rescale feature if available. - if (_supports_rescale_normal && support_rescale_normal) { - glEnable(GL_RESCALE_NORMAL); - glDisable(GL_NORMALIZE); - if (GLCAT.is_spam()) { - GLCAT.spam() << "glEnable(GL_RESCALE_NORMAL)\n"; - GLCAT.spam() << "glDisable(GL_NORMALIZE)\n"; - } - } else { - glEnable(GL_NORMALIZE); - if (GLCAT.is_spam()) { - GLCAT.spam() << "glEnable(GL_NORMALIZE)\n"; - } - } - - } else { - // If there's a non-uniform scale, normalize everything. - glEnable(GL_NORMALIZE); - if (GLCAT.is_spam()) { - GLCAT.spam() << "glEnable(GL_NORMALIZE)\n"; - } - if (_supports_rescale_normal && support_rescale_normal) { - glDisable(GL_RESCALE_NORMAL); - if (GLCAT.is_spam()) { - GLCAT.spam() << "glDisable(GL_RESCALE_NORMAL)\n"; - } - } - } -#endif -} - //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_texture // Access: Protected, Virtual diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 7d1b8f2fe8..d65c6477af 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -525,7 +525,6 @@ protected: void upload_usage_texture(int width, int height); #endif // NDEBUG - void do_auto_rescale_normal(); bool specify_texture(CLP(TextureContext) *gtc, const SamplerState &sampler); bool apply_texture(TextureContext *tc); bool apply_sampler(GLuint unit, const SamplerState &sampler, TextureContext *tc); @@ -625,7 +624,6 @@ protected: DirectionalLights _dlights; int _pass_number; - bool _auto_rescale_normal; GLuint _geom_display_list; GLuint _current_vbuffer_index; GLuint _current_ibuffer_index; diff --git a/panda/src/pgraph/cullResult.cxx b/panda/src/pgraph/cullResult.cxx index a7cab23a8b..67a80b4c43 100644 --- a/panda/src/pgraph/cullResult.cxx +++ b/panda/src/pgraph/cullResult.cxx @@ -24,6 +24,7 @@ #include "fogAttrib.h" #include "transparencyAttrib.h" #include "renderState.h" +#include "rescaleNormalAttrib.h" #include "clockObject.h" #include "config_pgraph.h" #include "depthOffsetAttrib.h" @@ -122,14 +123,30 @@ add_object(CullableObject *object, const CullTraverser *traverser) { Thread *current_thread = traverser->get_current_thread(); CullBinManager *bin_manager = CullBinManager::get_global_ptr(); - // Check to see if there's a special transparency setting. const RenderState *state = object->_state; nassertv(state != (const RenderState *)NULL); - const TransparencyAttrib *trans = (const TransparencyAttrib *) - state->get_attrib(TransparencyAttrib::get_class_slot()); + // This is probably a good time to check for an auto rescale setting. + const RescaleNormalAttrib *rescale; + state->get_attrib_def(rescale); + if (rescale->get_mode() == RescaleNormalAttrib::M_auto) { + RescaleNormalAttrib::Mode mode; - if (trans != (const TransparencyAttrib *)NULL) { + if (object->_internal_transform->has_identity_scale()) { + mode = RescaleNormalAttrib::M_none; + } else if (object->_internal_transform->has_uniform_scale()) { + mode = RescaleNormalAttrib::M_rescale; + } else { + mode = RescaleNormalAttrib::M_normalize; + } + + state = state->set_attrib(RescaleNormalAttrib::make(mode)); + object->_state = state; + } + + // Check to see if there's a special transparency setting. + const TransparencyAttrib *trans; + if (state->get_attrib(trans)) { switch (trans->get_mode()) { case TransparencyAttrib::M_alpha: // M_alpha implies an alpha-write test, so we don't waste time diff --git a/panda/src/pgraph/rescaleNormalAttrib.cxx b/panda/src/pgraph/rescaleNormalAttrib.cxx index 3f061975f8..7c20896810 100644 --- a/panda/src/pgraph/rescaleNormalAttrib.cxx +++ b/panda/src/pgraph/rescaleNormalAttrib.cxx @@ -114,6 +114,21 @@ get_hash_impl() const { return hash; } +//////////////////////////////////////////////////////////////////// +// Function: RescaleNormalAttrib::get_auto_shader_attrib_impl +// Access: Protected, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +CPT(RenderAttrib) RescaleNormalAttrib:: +get_auto_shader_attrib_impl(const RenderState *state) const { + // We currently only support M_normalize in the ShaderGenerator. + if (_mode == M_none || _mode == M_normalize) { + return this; + } else { + return RescaleNormalAttrib::make(M_normalize); + } +} + //////////////////////////////////////////////////////////////////// // Function: RescaleNormalAttrib::register_with_read_factory // Access: Public, Static diff --git a/panda/src/pgraph/rescaleNormalAttrib.h b/panda/src/pgraph/rescaleNormalAttrib.h index 4b165881ec..04f5575614 100644 --- a/panda/src/pgraph/rescaleNormalAttrib.h +++ b/panda/src/pgraph/rescaleNormalAttrib.h @@ -59,6 +59,7 @@ public: protected: virtual int compare_to_impl(const RenderAttrib *other) const; virtual size_t get_hash_impl() const; + virtual CPT(RenderAttrib) get_auto_shader_attrib_impl(const RenderState *state) const; private: Mode _mode; diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 84a2fa6bd0..b90e1e0b80 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -37,6 +37,7 @@ #include "texture.h" #include "ambientLight.h" #include "directionalLight.h" +#include "rescaleNormalAttrib.h" #include "pointLight.h" #include "spotlight.h" #include "lightLensNode.h" @@ -326,6 +327,12 @@ analyze_renderstate(const RenderState *rs) { _need_eye_normal = true; } + // Determine whether we should normalize the normals. + const RescaleNormalAttrib *rescale; + rs->get_attrib_def(rescale); + + _normalize_normals = (rescale->get_mode() != RescaleNormalAttrib::M_none); + // Find the material. const MaterialAttrib *material = DCAST(MaterialAttrib, rs->get_attrib_def(MaterialAttrib::get_class_slot())); @@ -487,6 +494,7 @@ clear_analysis() { _need_world_normal = false; _need_eye_position = false; _need_eye_normal = false; + _normalize_normals = false; _auto_normal_on = false; _auto_glow_on = false; _auto_gloss_on = false; @@ -774,7 +782,11 @@ synthesize_shader(const RenderState *rs) { text << "\t l_eye_position = mul(trans_model_to_view, vtx_position);\n"; } if (_need_eye_normal) { - text << "\t l_eye_normal.xyz = mul((float3x3)tpose_view_to_model, vtx_normal);\n"; + if (_normalize_normals) { + text << "\t l_eye_normal.xyz = normalize(mul((float3x3)tpose_view_to_model, vtx_normal));\n"; + } else { + text << "\t l_eye_normal.xyz = mul((float3x3)tpose_view_to_model, vtx_normal);\n"; + } text << "\t l_eye_normal.w = 0;\n"; } pmap::const_iterator it; diff --git a/panda/src/pgraphnodes/shaderGenerator.h b/panda/src/pgraphnodes/shaderGenerator.h index 1e1daa581d..8d414812de 100644 --- a/panda/src/pgraphnodes/shaderGenerator.h +++ b/panda/src/pgraphnodes/shaderGenerator.h @@ -146,6 +146,7 @@ protected: bool _need_world_normal; bool _need_eye_position; bool _need_eye_normal; + bool _normalize_normals; bool _auto_normal_on; bool _auto_glow_on; bool _auto_gloss_on; From bac400543aa2da3ba08b8942126530726fa88d32 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 14 Jun 2015 23:14:56 +0200 Subject: [PATCH 011/203] Correct scaling of normals during flatten operations --- panda/src/dxgsg9/dxGeomMunger9.cxx | 4 +- panda/src/egg2pg/eggLoader.cxx | 2 +- panda/src/gobj/geomEnums.cxx | 3 + panda/src/gobj/geomEnums.h | 6 +- panda/src/gobj/geomVertexArrayFormat.cxx | 7 ++- panda/src/gobj/geomVertexColumn.cxx | 5 ++ panda/src/gobj/geomVertexData.cxx | 71 +++++++++++++++++++++--- panda/src/gobj/geomVertexData.h | 2 + panda/src/gobj/geomVertexFormat.cxx | 13 +++-- panda/src/grutil/geoMipTerrain.cxx | 2 +- panda/src/grutil/pfmVizzer.cxx | 4 +- panda/src/parametrics/ropeNode.cxx | 2 +- 12 files changed, 98 insertions(+), 23 deletions(-) diff --git a/panda/src/dxgsg9/dxGeomMunger9.cxx b/panda/src/dxgsg9/dxGeomMunger9.cxx index 886ffd2af5..70b5ff8f47 100644 --- a/panda/src/dxgsg9/dxGeomMunger9.cxx +++ b/panda/src/dxgsg9/dxGeomMunger9.cxx @@ -118,7 +118,7 @@ munge_format_impl(const GeomVertexFormat *orig, if (normal_type != (const GeomVertexColumn *)NULL) { new_array_format->add_column - (InternalName::get_normal(), 3, NT_float32, C_vector); + (InternalName::get_normal(), 3, NT_float32, C_normal); new_format->remove_column(normal_type->get_name()); } @@ -227,7 +227,7 @@ premunge_format_impl(const GeomVertexFormat *orig) { if (normal_type != (const GeomVertexColumn *)NULL) { new_array_format->add_column - (InternalName::get_normal(), 3, NT_float32, C_vector); + (InternalName::get_normal(), 3, NT_float32, C_normal); new_format->remove_column(normal_type->get_name()); } diff --git a/panda/src/egg2pg/eggLoader.cxx b/panda/src/egg2pg/eggLoader.cxx index b472a104b6..d6b41df09a 100644 --- a/panda/src/egg2pg/eggLoader.cxx +++ b/panda/src/egg2pg/eggLoader.cxx @@ -2240,7 +2240,7 @@ make_vertex_data(const EggRenderState *render_state, if (vertex_pool->has_normals()) { array_format->add_column (InternalName::get_normal(), 3, - Geom::NT_stdfloat, Geom::C_vector); + Geom::NT_stdfloat, Geom::C_normal); } if (!ignore_color) { diff --git a/panda/src/gobj/geomEnums.cxx b/panda/src/gobj/geomEnums.cxx index e105b0c246..9fe394ccb9 100644 --- a/panda/src/gobj/geomEnums.cxx +++ b/panda/src/gobj/geomEnums.cxx @@ -139,6 +139,9 @@ operator << (ostream &out, GeomEnums::Contents contents) { case GeomEnums::C_matrix: return out << "matrix"; + + case GeomEnums::C_normal: + return out << "normal"; } return out << "**invalid contents (" << (int)contents << ")**"; diff --git a/panda/src/gobj/geomEnums.h b/panda/src/gobj/geomEnums.h index 62265cfc23..4cf392eb42 100644 --- a/panda/src/gobj/geomEnums.h +++ b/panda/src/gobj/geomEnums.h @@ -192,7 +192,7 @@ PUBLISHED: C_other, // Arbitrary meaning, leave it alone C_point, // A point in 3-space or 4-space C_clip_point, // A point pre-transformed into clip coordinates - C_vector, // A surface normal, tangent, or binormal + C_vector, // A surface tangent or binormal (see C_normal for normals) C_texcoord, // A texture coordinate C_color, // 3- or 4-component color, ordered R, G, B, [A] C_index, // An index value into some other table @@ -201,6 +201,10 @@ PUBLISHED: // A transformation matrix. This is typically three or four // columns, but we pretend it's only one for convenience. C_matrix, + + // A special version of C_vector that should be used for normal + // vectors, which are scaled differently from other vectors. + C_normal, }; // The type of animation data that is represented by a particular diff --git a/panda/src/gobj/geomVertexArrayFormat.cxx b/panda/src/gobj/geomVertexArrayFormat.cxx index 7f1deaff61..be82d262fd 100644 --- a/panda/src/gobj/geomVertexArrayFormat.cxx +++ b/panda/src/gobj/geomVertexArrayFormat.cxx @@ -394,8 +394,11 @@ align_columns_for_animation() { Columns::const_iterator ci; for (ci = orig_columns.begin(); ci != orig_columns.end(); ++ci) { GeomVertexColumn *column = (*ci); - if ((column->get_contents() == C_point || column->get_contents() == C_vector) && - (column->get_numeric_type() == NT_float32 || column->get_numeric_type() == NT_float64) && + if ((column->get_contents() == C_point || + column->get_contents() == C_vector || + column->get_contents() == C_normal) && + (column->get_numeric_type() == NT_float32 || + column->get_numeric_type() == NT_float64) && column->get_num_components() >= 3) { add_column(column->get_name(), 4, column->get_numeric_type(), column->get_contents(), -1, 16); } else { diff --git a/panda/src/gobj/geomVertexColumn.cxx b/panda/src/gobj/geomVertexColumn.cxx index 1698384d07..345e1660d4 100644 --- a/panda/src/gobj/geomVertexColumn.cxx +++ b/panda/src/gobj/geomVertexColumn.cxx @@ -340,6 +340,11 @@ make_packer() const { break; } return new Packer_color; + case C_normal: + if (get_num_values() != 3) { + gobj_cat.error() + << "GeomVertexColumn with contents C_normal must have 3 components!\n"; + } default: // Otherwise, we just read it as a generic value. switch (get_numeric_type()) { diff --git a/panda/src/gobj/geomVertexData.cxx b/panda/src/gobj/geomVertexData.cxx index 7a265b66a0..95a4c2ab5c 100644 --- a/panda/src/gobj/geomVertexData.cxx +++ b/panda/src/gobj/geomVertexData.cxx @@ -1915,10 +1915,37 @@ do_transform_point_column(const GeomVertexFormat *format, GeomVertexRewriter &da //////////////////////////////////////////////////////////////////// void GeomVertexData:: do_transform_vector_column(const GeomVertexFormat *format, GeomVertexRewriter &data, - const LMatrix4 &mat, int begin_row, int end_row) { + const LMatrix4 &mat, int begin_row, int end_row) { const GeomVertexColumn *data_column = data.get_column(); int num_values = data_column->get_num_values(); + LMatrix4 xform; + bool normalize = false; + if (data_column->get_contents() == C_normal) { + // This is to preserve perpendicularity to the surface. + LVecBase3 scale, shear, hpr; + if (decompose_matrix(mat.get_upper_3(), scale, shear, hpr) && + IS_NEARLY_EQUAL(scale[0], scale[1]) && + IS_NEARLY_EQUAL(scale[0], scale[2])) { + if (scale[0] == 1) { + // No scale to worry about. + xform = mat; + } else { + // Simply take the uniform scale out of the transformation. + // Not sure if it might be better to just normalize? + compose_matrix(xform, LVecBase3(1, 1, 1), shear, hpr, LVecBase3::zero()); + } + } else { + // There is a non-uniform scale, so we need to do all this to + // preserve orthogonality to the surface. + xform.invert_from(mat); + xform.transpose_in_place(); + normalize = true; + } + } else { + xform = mat; + } + if ((num_values == 3 || num_values == 4) && data_column->get_numeric_type() == NT_float32) { // The table of vectors is a table of LVector3f's or LVector4f's. @@ -1929,9 +1956,11 @@ do_transform_vector_column(const GeomVertexFormat *format, GeomVertexRewriter &d size_t num_rows = end_row - begin_row; unsigned char *datat = data_handle->get_write_pointer(); datat += data_column->get_start() + begin_row * stride; - LMatrix4f matf = LCAST(float, mat); + LMatrix4f matf = LCAST(float, xform); - if (num_values == 3) { + if (normalize) { + table_xform_normal3f(datat, num_rows, stride, matf); + } else if (num_values == 3) { table_xform_vector3f(datat, num_rows, stride, matf); } else { table_xform_vecbase4f(datat, num_rows, stride, matf); @@ -1939,11 +1968,20 @@ do_transform_vector_column(const GeomVertexFormat *format, GeomVertexRewriter &d } else { // Use the GeomVertexRewriter to transform the vectors. - data.set_row_unsafe(begin_row); - for (int j = begin_row; j < end_row; ++j) { - LVector3 vertex = data.get_data3(); - data.set_data3(vertex * mat); + + if (normalize) { + for (int j = begin_row; j < end_row; ++j) { + LVector3 vector = data.get_data3(); + vector *= xform; + vector.normalize(); + data.set_data3(vector); + } + } else { + for (int j = begin_row; j < end_row; ++j) { + LVector3 vector = data.get_data3(); + data.set_data3(vector * xform); + } } } } @@ -1965,6 +2003,25 @@ table_xform_point3f(unsigned char *datat, size_t num_rows, size_t stride, } } +//////////////////////////////////////////////////////////////////// +// Function: GeomVertexData::table_xform_normal3f +// Access: Private, Static +// Description: Transforms each of the LVector3f objects in the +// indicated table by the indicated matrix, and also +// normalizes them. +//////////////////////////////////////////////////////////////////// +void GeomVertexData:: +table_xform_normal3f(unsigned char *datat, size_t num_rows, size_t stride, + const LMatrix4f &matf) { + // We don't bother checking for the unaligned case here, because in + // practice it doesn't matter with a 3-component vector. + for (size_t i = 0; i < num_rows; ++i) { + LNormalf &vertex = *(LNormalf *)(&datat[i * stride]); + vertex *= matf; + vertex.normalize(); + } +} + //////////////////////////////////////////////////////////////////// // Function: GeomVertexData::table_xform_vector3f // Access: Private, Static diff --git a/panda/src/gobj/geomVertexData.h b/panda/src/gobj/geomVertexData.h index 9bcdd7daec..acb51b37cd 100644 --- a/panda/src/gobj/geomVertexData.h +++ b/panda/src/gobj/geomVertexData.h @@ -334,6 +334,8 @@ private: const LMatrix4 &mat, int begin_row, int end_row); static void table_xform_point3f(unsigned char *datat, size_t num_rows, size_t stride, const LMatrix4f &matf); + static void table_xform_normal3f(unsigned char *datat, size_t num_rows, + size_t stride, const LMatrix4f &matf); static void table_xform_vector3f(unsigned char *datat, size_t num_rows, size_t stride, const LMatrix4f &matf); static void table_xform_vecbase4f(unsigned char *datat, size_t num_rows, diff --git a/panda/src/gobj/geomVertexFormat.cxx b/panda/src/gobj/geomVertexFormat.cxx index b0fd53515c..ec5a29436e 100644 --- a/panda/src/gobj/geomVertexFormat.cxx +++ b/panda/src/gobj/geomVertexFormat.cxx @@ -825,6 +825,7 @@ do_register() { break; case C_vector: + case C_normal: // It's a vector. _vectors.push_back(column->get_name()); break; @@ -1017,7 +1018,7 @@ make_standard_formats() { (InternalName::get_vertex(), 3, NT_stdfloat, C_point, InternalName::get_normal(), 3, - NT_stdfloat, C_vector)); + NT_stdfloat, C_normal)); _v3t2 = register_format(new GeomVertexArrayFormat (InternalName::get_vertex(), 3, @@ -1029,7 +1030,7 @@ make_standard_formats() { (InternalName::get_vertex(), 3, NT_stdfloat, C_point, InternalName::get_normal(), 3, - NT_stdfloat, C_vector, + NT_stdfloat, C_normal, InternalName::get_texcoord(), 2, NT_stdfloat, C_texcoord)); @@ -1044,7 +1045,7 @@ make_standard_formats() { (InternalName::get_vertex(), 3, NT_stdfloat, C_point, InternalName::get_normal(), 3, - NT_stdfloat, C_vector, + NT_stdfloat, C_normal, InternalName::get_color(), 1, NT_packed_dabc, C_color)); @@ -1060,7 +1061,7 @@ make_standard_formats() { (InternalName::get_vertex(), 3, NT_stdfloat, C_point, InternalName::get_normal(), 3, - NT_stdfloat, C_vector, + NT_stdfloat, C_normal, InternalName::get_color(), 1, NT_packed_dabc, C_color, InternalName::get_texcoord(), 2, @@ -1079,7 +1080,7 @@ make_standard_formats() { (InternalName::get_vertex(), 3, NT_stdfloat, C_point, InternalName::get_normal(), 3, - NT_stdfloat, C_vector, + NT_stdfloat, C_normal, InternalName::get_color(), 4, NT_uint8, C_color)); @@ -1095,7 +1096,7 @@ make_standard_formats() { (InternalName::get_vertex(), 3, NT_stdfloat, C_point, InternalName::get_normal(), 3, - NT_stdfloat, C_vector, + NT_stdfloat, C_normal, InternalName::get_color(), 4, NT_uint8, C_color, InternalName::get_texcoord(), 2, diff --git a/panda/src/grutil/geoMipTerrain.cxx b/panda/src/grutil/geoMipTerrain.cxx index 145ba37131..c236564172 100644 --- a/panda/src/grutil/geoMipTerrain.cxx +++ b/panda/src/grutil/geoMipTerrain.cxx @@ -63,7 +63,7 @@ generate_block(unsigned short mx, array->add_column(InternalName::get_texcoord(), 2, Geom::NT_stdfloat, Geom::C_texcoord); array->add_column(InternalName::get_normal(), 3, - Geom::NT_stdfloat, Geom::C_vector); + Geom::NT_stdfloat, Geom::C_normal); PT(GeomVertexFormat) format = new GeomVertexFormat(); format->add_array(array); diff --git a/panda/src/grutil/pfmVizzer.cxx b/panda/src/grutil/pfmVizzer.cxx index 1304d59bea..1d84cd6331 100644 --- a/panda/src/grutil/pfmVizzer.cxx +++ b/panda/src/grutil/pfmVizzer.cxx @@ -1062,7 +1062,7 @@ make_array_format(const VisColumns &vis_columns) const { case CT_normal3: num_components = 3; numeric_type = GeomEnums::NT_float32; - contents = GeomEnums::C_vector; + contents = GeomEnums::C_normal; break; case CT_blend1: @@ -1072,7 +1072,7 @@ make_array_format(const VisColumns &vis_columns) const { break; } nassertr(num_components != 0, NULL); - + array_format->add_column(name, num_components, numeric_type, contents); } diff --git a/panda/src/parametrics/ropeNode.cxx b/panda/src/parametrics/ropeNode.cxx index eaf0ef48ed..871931cd1b 100644 --- a/panda/src/parametrics/ropeNode.cxx +++ b/panda/src/parametrics/ropeNode.cxx @@ -282,7 +282,7 @@ get_format(bool support_normals) const { if (support_normals && get_normal_mode() == NM_vertex) { array_format->add_column (InternalName::get_normal(), 3, Geom::NT_stdfloat, - Geom::C_vector); + Geom::C_normal); } if (get_use_vertex_color()) { array_format->add_column From 6d0e4c2662737b409de27be993c7a95f4fd87768 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 15 Jun 2015 00:19:52 +0200 Subject: [PATCH 012/203] Correct scaling and normalizations of binormals and tangents in generated shaders --- panda/src/pgraphnodes/shaderGenerator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 90265514ed..9b64a038b5 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -713,6 +713,8 @@ synthesize_shader(const RenderState *rs) { text << "\t uniform float4x4 trans_model_to_view,\n"; eye_position_freg = alloc_freg(); text << "\t out float4 l_eye_position : " << eye_position_freg << ",\n"; + } else if ((_lighting || _out_aux_normal) && (_map_index_normal >= 0 && _auto_normal_on)) { + text << "\t uniform float4x4 trans_model_to_view,\n"; } if (_need_eye_normal) { eye_normal_freg = alloc_freg(); @@ -784,9 +786,9 @@ synthesize_shader(const RenderState *rs) { text << "\t l_color = vtx_color;\n"; } if ((_lighting || _out_aux_normal) && (_map_index_normal >= 0 && _auto_normal_on)) { - text << "\t l_tangent.xyz = mul((float3x3)tpose_view_to_model, vtx_" << tangent_input << ".xyz);\n"; + text << "\t l_tangent.xyz = normalize(mul((float3x3)trans_model_to_view, vtx_" << tangent_input << ".xyz));\n"; text << "\t l_tangent.w = 0;\n"; - text << "\t l_binormal.xyz = mul((float3x3)tpose_view_to_model, -vtx_" << binormal_input << ".xyz);\n"; + text << "\t l_binormal.xyz = normalize(mul((float3x3)trans_model_to_view, -vtx_" << binormal_input << ".xyz));\n"; text << "\t l_binormal.w = 0;\n"; } if (_shadows && _auto_shadow_on) { From 458ca5ea41f6eec1146ba1f1bc45315c23bd8c7b Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 18 Jun 2015 21:21:00 +0200 Subject: [PATCH 013/203] Fix error when aligning C_normal column for vertex animation --- panda/src/gobj/geomVertexColumn.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/gobj/geomVertexColumn.cxx b/panda/src/gobj/geomVertexColumn.cxx index 345e1660d4..55910d7fc7 100644 --- a/panda/src/gobj/geomVertexColumn.cxx +++ b/panda/src/gobj/geomVertexColumn.cxx @@ -341,9 +341,9 @@ make_packer() const { } return new Packer_color; case C_normal: - if (get_num_values() != 3) { + if (get_num_values() != 3 && get_num_values() != 4) { gobj_cat.error() - << "GeomVertexColumn with contents C_normal must have 3 components!\n"; + << "GeomVertexColumn with contents C_normal must have 3 or 4 components!\n"; } default: // Otherwise, we just read it as a generic value. From 945d3c40357e6714b7bac932122543e3db261a0d Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Jun 2015 21:18:28 +0200 Subject: [PATCH 014/203] Fix compiler errors and crashes with Assimp loader --- pandatool/src/assimp/assimpLoader.cxx | 22 ++++++++++++++-------- pandatool/src/assimp/pandaIOStream.cxx | 6 ++++++ pandatool/src/assimp/pandaIOSystem.cxx | 1 + pandatool/src/assimp/pandaLogger.h | 2 +- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index 384462fc77..d67c70f604 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -25,7 +25,6 @@ #include "materialAttrib.h" #include "textureAttrib.h" #include "cullFaceAttrib.h" -#include "lightNode.h" #include "ambientLight.h" #include "directionalLight.h" #include "spotlight.h" @@ -570,12 +569,15 @@ load_light(const aiLight &light) { aiColor3D col; aiVector3D vec; - PT(LightNode) lnode; + PT(PandaNode) lnode; switch (light.mType) { case aiLightSource_DIRECTIONAL: { PT(DirectionalLight) dlight = new DirectionalLight(name); - lnode = DCAST(LightNode, dlight); + lnode = DCAST(PandaNode, dlight); + + col = light.mColorDiffuse; + dlight->set_color(LColor(col.r, col.g, col.b, 1)); col = light.mColorSpecular; dlight->set_specular_color(LColor(col.r, col.g, col.b, 1)); @@ -589,7 +591,10 @@ load_light(const aiLight &light) { case aiLightSource_POINT: { PT(PointLight) plight = new PointLight(name); - lnode = DCAST(LightNode, plight); + lnode = DCAST(PandaNode, plight); + + col = light.mColorDiffuse; + plight->set_color(LColor(col.r, col.g, col.b, 1)); col = light.mColorSpecular; plight->set_specular_color(LColor(col.r, col.g, col.b, 1)); @@ -604,7 +609,10 @@ load_light(const aiLight &light) { case aiLightSource_SPOT: { PT(Spotlight) plight = new Spotlight(name); - lnode = DCAST(LightNode, plight); + lnode = DCAST(PandaNode, plight); + + col = light.mColorDiffuse; + plight->set_color(LColor(col.r, col.g, col.b, 1)); col = light.mColorSpecular; plight->set_specular_color(LColor(col.r, col.g, col.b, 1)); @@ -630,15 +638,13 @@ load_light(const aiLight &light) { } // If there's an ambient color, add it as ambient light. + col = light.mColorAmbient; LVecBase4 ambient (col.r, col.g, col.b, 0); if (ambient != LVecBase4::zero()) { PT(AmbientLight) alight = new AmbientLight(name); - col = light.mColorAmbient; alight->set_color(ambient); _root->add_child(alight); } _root->add_child(lnode); - col = light.mColorDiffuse; - lnode->set_color(LColor(col.r, col.g, col.b, 1)); } diff --git a/pandatool/src/assimp/pandaIOStream.cxx b/pandatool/src/assimp/pandaIOStream.cxx index 4dc634f319..647af59ccc 100644 --- a/pandatool/src/assimp/pandaIOStream.cxx +++ b/pandatool/src/assimp/pandaIOStream.cxx @@ -78,6 +78,11 @@ Seek(size_t offset, aiOrigin origin) { case aiOrigin_END: _istream.seekg(offset, ios::end); break; + + default: + // Keep compiler happy + nassertr(false, AI_FAILURE); + break; } if (_istream.good()) { @@ -105,4 +110,5 @@ Tell() const { size_t PandaIOStream:: Write(const void *buffer, size_t size, size_t count) { nassertr(false, 0); + return 0; } diff --git a/pandatool/src/assimp/pandaIOSystem.cxx b/pandatool/src/assimp/pandaIOSystem.cxx index c28584ede5..abaadc76c8 100644 --- a/pandatool/src/assimp/pandaIOSystem.cxx +++ b/pandatool/src/assimp/pandaIOSystem.cxx @@ -95,5 +95,6 @@ Open(const char *file, const char *mode) { } else { nassertr(false, NULL); // Not implemented on purpose. + return NULL; } } diff --git a/pandatool/src/assimp/pandaLogger.h b/pandatool/src/assimp/pandaLogger.h index 8d0f39fc2a..7791153b8c 100644 --- a/pandatool/src/assimp/pandaLogger.h +++ b/pandatool/src/assimp/pandaLogger.h @@ -30,7 +30,7 @@ public: protected: INLINE bool attachStream(Assimp::LogStream*, unsigned int) {}; - INLINE bool detatchStream(Assimp::LogStream*, unsigned int) {}; + INLINE bool detatchStream(Assimp::LogStream*, unsigned int) {}; // sic void OnDebug(const char *message); void OnError(const char *message); From 179b10ca83943d59ffc5025d51864e5983decb8d Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 19 Jun 2015 21:57:29 +0200 Subject: [PATCH 015/203] Assimp loader now handles aiLightSource_AMBIENT lights --- pandatool/src/assimp/assimpLoader.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index d67c70f604..3ae5be3dc0 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -569,12 +569,10 @@ load_light(const aiLight &light) { aiColor3D col; aiVector3D vec; - PT(PandaNode) lnode; - switch (light.mType) { case aiLightSource_DIRECTIONAL: { PT(DirectionalLight) dlight = new DirectionalLight(name); - lnode = DCAST(PandaNode, dlight); + _root->add_child(dlight); col = light.mColorDiffuse; dlight->set_color(LColor(col.r, col.g, col.b, 1)); @@ -591,7 +589,7 @@ load_light(const aiLight &light) { case aiLightSource_POINT: { PT(PointLight) plight = new PointLight(name); - lnode = DCAST(PandaNode, plight); + _root->add_child(plight); col = light.mColorDiffuse; plight->set_color(LColor(col.r, col.g, col.b, 1)); @@ -609,7 +607,7 @@ load_light(const aiLight &light) { case aiLightSource_SPOT: { PT(Spotlight) plight = new Spotlight(name); - lnode = DCAST(PandaNode, plight); + _root->add_child(plight); col = light.mColorDiffuse; plight->set_color(LColor(col.r, col.g, col.b, 1)); @@ -632,6 +630,10 @@ load_light(const aiLight &light) { plight->set_transform(TransformState::make_pos_quat_scale(pos, quat, LVecBase3(1, 1, 1))); break; } + case aiLightSource_AMBIENT: + // This is handled below. + break; + default: assimp_cat.warning() << "Light '" << name << "' has an unknown type!\n"; return; @@ -645,6 +647,4 @@ load_light(const aiLight &light) { alight->set_color(ambient); _root->add_child(alight); } - - _root->add_child(lnode); } From 89d2fbd7e17ad3868bc7ae52c745ccd36a6a9111 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Jun 2015 14:13:31 +0200 Subject: [PATCH 016/203] Build with two threads on travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 92732bb929..2a3437725a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ compiler: - clang before_script: - sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libopenal-dev libode-dev nvidia-cg-toolkit -script: python makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT --installer +script: python makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT --installer --threads 2 notifications: irc: channels: From 8ecf6a7b9feca2cf936124f6f46b6de8406865ec Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Jun 2015 15:33:42 +0200 Subject: [PATCH 017/203] Fix getattr() and hasattr() of vector classes when invalid attribute name is used --- .../interfaceMakerPythonNative.cxx | 9 +++- dtool/src/interrogatedb/py_panda.cxx | 41 +++++++++++++++++++ dtool/src/interrogatedb/py_panda.h | 4 ++ panda/src/linmath/lpoint2_ext_src.I | 6 +-- panda/src/linmath/lpoint2_ext_src.h | 2 +- panda/src/linmath/lpoint2_src.h | 2 +- panda/src/linmath/lpoint3_ext_src.I | 6 +-- panda/src/linmath/lpoint3_ext_src.h | 2 +- panda/src/linmath/lpoint3_src.h | 2 +- panda/src/linmath/lpoint4_ext_src.I | 6 +-- panda/src/linmath/lpoint4_ext_src.h | 2 +- panda/src/linmath/lpoint4_src.h | 2 +- panda/src/linmath/lvecBase2_ext_src.I | 11 ++--- panda/src/linmath/lvecBase2_ext_src.h | 2 +- panda/src/linmath/lvecBase2_src.h | 2 +- panda/src/linmath/lvecBase3_ext_src.I | 11 ++--- panda/src/linmath/lvecBase3_ext_src.h | 2 +- panda/src/linmath/lvecBase3_src.h | 2 +- panda/src/linmath/lvecBase4_ext_src.I | 11 ++--- panda/src/linmath/lvecBase4_ext_src.h | 2 +- panda/src/linmath/lvecBase4_src.h | 2 +- panda/src/linmath/lvector2_ext_src.I | 6 +-- panda/src/linmath/lvector2_ext_src.h | 2 +- panda/src/linmath/lvector2_src.h | 2 +- panda/src/linmath/lvector3_ext_src.I | 6 +-- panda/src/linmath/lvector3_ext_src.h | 2 +- panda/src/linmath/lvector3_src.h | 2 +- panda/src/linmath/lvector4_ext_src.I | 6 +-- panda/src/linmath/lvector4_ext_src.h | 2 +- panda/src/linmath/lvector4_src.h | 2 +- 30 files changed, 100 insertions(+), 59 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index ecd2460d7c..30bb59d8a5 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1813,7 +1813,7 @@ write_module_class(ostream &out, Object *obj) { out << " if (res != NULL) {\n"; out << " return res;\n"; out << " }\n"; - out << " if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {\n"; + out << " if (_PyErr_OCCURRED() != PyExc_AttributeError) {\n"; out << " return NULL;\n"; out << " }\n"; out << " PyErr_Clear();\n\n"; @@ -5561,6 +5561,11 @@ write_function_instance(ostream &out, FunctionRemap *remap, << "return Dtool_Return_Bool(" << return_expr << ");\n"; return_flags &= ~RF_pyobject; + } else if (return_null && TypeManager::is_pointer_to_PyObject(remap->_return_type->get_new_type())) { + indent(out, indent_level) + << "return Dtool_Return(" << return_expr << ");\n"; + return_flags &= ~RF_pyobject; + } else { indent(out, indent_level) << "if (Dtool_CheckErrorOccurred()) {\n"; @@ -5661,7 +5666,7 @@ write_function_instance(ostream &out, FunctionRemap *remap, << "return DTool_PyInit_Finalize(self, " << return_expr << ", &" << CLASS_PREFIX << make_safe_name(itype.get_scoped_name()) << ", true, false);\n"; } else if (TypeManager::is_integer(orig_type)) { - if (return_flags & RF_compare) { + if ((return_flags & RF_compare) == RF_compare) { // Make sure it returns -1, 0, or 1, or Python complains with: // RuntimeWarning: tp_compare didn't return -1, 0 or 1 indent(out, indent_level) << "return (int)(" << return_expr << " > 0) - (int)(" << return_expr << " < 0);\n"; diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 11af0c1ace..02666e0fb0 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -273,6 +273,29 @@ PyObject *Dtool_Raise_ArgTypeError(PyObject *obj, int param, const char *functio return NULL; } +//////////////////////////////////////////////////////////////////// +// Function: Dtool_Raise_AttributeError +// Description: Raises an AttributeError of the form: +// 'type' has no attribute 'attr' +// +// Always returns NULL so that it can be conveniently +// used as a return expression for wrapper functions +// that return a PyObject pointer. +//////////////////////////////////////////////////////////////////// +PyObject *Dtool_Raise_AttributeError(PyObject *obj, const char *attribute) { +#if PY_MAJOR_VERSION >= 3 + PyObject *message = PyUnicode_FromFormat( +#else + PyObject *message = PyString_FromFormat( +#endif + "'%.100s' object has no attribute '%.200s'", + Py_TYPE(obj)->tp_name, attribute); + + Py_INCREF(PyExc_TypeError); + PyErr_Restore(PyExc_TypeError, message, (PyObject *)NULL); + return NULL; +} + //////////////////////////////////////////////////////////////////// // Function: Dtool_Raise_BadArgumentsError // Description: Raises a TypeError of the form: @@ -330,6 +353,24 @@ PyObject *Dtool_Return_Bool(bool value) { return result; } +//////////////////////////////////////////////////////////////////// +// Function: Dtool_Return +// Description: Convenience method that checks for exceptions, and +// if one occurred, returns NULL, otherwise the given +// return value. Its reference count is not increased. +//////////////////////////////////////////////////////////////////// +PyObject *_Dtool_Return(PyObject *value) { + if (_PyErr_OCCURRED()) { + return NULL; + } +#ifndef NDEBUG + if (Notify::ptr()->has_assert_failed()) { + return Dtool_Raise_AssertionError(); + } +#endif + return value; +} + //////////////////////////////////////////////////////////////////////// // Function : DTool_CreatePyInstanceTyped // diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index e6847359c3..babf870934 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -340,6 +340,7 @@ EXPCL_DTOOLCONFIG bool Dtool_CheckErrorOccurred(); EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_AssertionError(); EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_TypeError(const char *message); EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_ArgTypeError(PyObject *obj, int param, const char *function_name, const char *type_name); +EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_AttributeError(PyObject *obj, const char *attribute); EXPCL_DTOOLCONFIG PyObject *_Dtool_Raise_BadArgumentsError(); #ifdef NDEBUG @@ -352,11 +353,14 @@ EXPCL_DTOOLCONFIG PyObject *_Dtool_Raise_BadArgumentsError(); EXPCL_DTOOLCONFIG PyObject *_Dtool_Return_None(); EXPCL_DTOOLCONFIG PyObject *Dtool_Return_Bool(bool value); +EXPCL_DTOOLCONFIG PyObject *_Dtool_Return(PyObject *value); #ifdef NDEBUG #define Dtool_Return_None() (_PyErr_OCCURRED() != NULL ? NULL : (Py_INCREF(Py_None), Py_None)) +#define Dtool_Return(value) (_PyErr_OCCURRED() != NULL ? NULL : value) #else #define Dtool_Return_None() _Dtool_Return_None() +#define Dtool_Return(value) _Dtool_Return(value) #endif //////////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lpoint2_ext_src.I b/panda/src/linmath/lpoint2_ext_src.I index ba9eb8e1ca..aa7f88c281 100644 --- a/panda/src/linmath/lpoint2_ext_src.I +++ b/panda/src/linmath/lpoint2_ext_src.I @@ -42,7 +42,7 @@ __repr__() const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint3); @@ -52,7 +52,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it != 'x' && *it != 'y') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -83,7 +83,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lpoint2_ext_src.h b/panda/src/linmath/lpoint2_ext_src.h index 2bf9a6c8f9..0a9c790324 100644 --- a/panda/src/linmath/lpoint2_ext_src.h +++ b/panda/src/linmath/lpoint2_ext_src.h @@ -22,7 +22,7 @@ template<> class Extension : public ExtensionBase { public: - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; }; diff --git a/panda/src/linmath/lpoint2_src.h b/panda/src/linmath/lpoint2_src.h index 03b264ffdc..5347325800 100644 --- a/panda/src/linmath/lpoint2_src.h +++ b/panda/src/linmath/lpoint2_src.h @@ -26,7 +26,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint2)(FLOATTYPE x, FLOATTYPE y); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH static const FLOATNAME(LPoint2) &zero(); diff --git a/panda/src/linmath/lpoint3_ext_src.I b/panda/src/linmath/lpoint3_ext_src.I index 79215517a5..2e758bfa01 100644 --- a/panda/src/linmath/lpoint3_ext_src.I +++ b/panda/src/linmath/lpoint3_ext_src.I @@ -43,7 +43,7 @@ __repr__() const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint3); @@ -53,7 +53,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'x' || *it > 'z') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -84,7 +84,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lpoint3_ext_src.h b/panda/src/linmath/lpoint3_ext_src.h index e9131b891d..8e8339fc40 100644 --- a/panda/src/linmath/lpoint3_ext_src.h +++ b/panda/src/linmath/lpoint3_ext_src.h @@ -22,7 +22,7 @@ template<> class Extension : public ExtensionBase { public: - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; }; diff --git a/panda/src/linmath/lpoint3_src.h b/panda/src/linmath/lpoint3_src.h index 76e06982d4..e8645529ff 100644 --- a/panda/src/linmath/lpoint3_src.h +++ b/panda/src/linmath/lpoint3_src.h @@ -32,7 +32,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH static const FLOATNAME(LPoint3) &zero(); diff --git a/panda/src/linmath/lpoint4_ext_src.I b/panda/src/linmath/lpoint4_ext_src.I index 88a83d20d5..48c40e3dc5 100644 --- a/panda/src/linmath/lpoint4_ext_src.I +++ b/panda/src/linmath/lpoint4_ext_src.I @@ -44,7 +44,7 @@ __repr__() const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint3); @@ -54,7 +54,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'w' || *it > 'z') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -89,7 +89,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lpoint4_ext_src.h b/panda/src/linmath/lpoint4_ext_src.h index 05d1e4b3c2..1c5fe49779 100644 --- a/panda/src/linmath/lpoint4_ext_src.h +++ b/panda/src/linmath/lpoint4_ext_src.h @@ -22,7 +22,7 @@ template<> class Extension : public ExtensionBase { public: - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; }; diff --git a/panda/src/linmath/lpoint4_src.h b/panda/src/linmath/lpoint4_src.h index b71e328c62..50eeb1ce5d 100644 --- a/panda/src/linmath/lpoint4_src.h +++ b/panda/src/linmath/lpoint4_src.h @@ -26,7 +26,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH static const FLOATNAME(LPoint4) &zero(); diff --git a/panda/src/linmath/lvecBase2_ext_src.I b/panda/src/linmath/lvecBase2_ext_src.I index 8a2c8221b4..00b8fdf616 100644 --- a/panda/src/linmath/lvecBase2_ext_src.I +++ b/panda/src/linmath/lvecBase2_ext_src.I @@ -80,7 +80,7 @@ __reduce__(PyObject *self) const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVecBase2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVecBase3); @@ -90,7 +90,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it != 'x' && *it != 'y') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -121,7 +121,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// @@ -135,10 +135,7 @@ __setattr__(PyObject *self, const string &attr_name, PyObject *assign) { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it != 'x' && *it != 'y') { - PyTypeObject *tp = self->ob_type; - PyErr_Format(PyExc_AttributeError, - "'%.100s' object has no attribute '%.200s'", - tp->tp_name, attr_name.c_str()); + Dtool_Raise_AttributeError(self, attr_name.c_str()); return -1; } } diff --git a/panda/src/linmath/lvecBase2_ext_src.h b/panda/src/linmath/lvecBase2_ext_src.h index c19c8a49d4..d72a6da3e2 100644 --- a/panda/src/linmath/lvecBase2_ext_src.h +++ b/panda/src/linmath/lvecBase2_ext_src.h @@ -23,7 +23,7 @@ template<> class Extension : public ExtensionBase { public: INLINE_LINMATH PyObject *__reduce__(PyObject *self) const; - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; diff --git a/panda/src/linmath/lvecBase2_src.h b/panda/src/linmath/lvecBase2_src.h index 5cb049429e..f1f6d125e0 100644 --- a/panda/src/linmath/lvecBase2_src.h +++ b/panda/src/linmath/lvecBase2_src.h @@ -49,7 +49,7 @@ PUBLISHED: INLINE_LINMATH ~FLOATNAME(LVecBase2)(); EXTENSION(INLINE_LINMATH PyObject *__reduce__(PyObject *self) const); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH FLOATTYPE operator [](int i) const; diff --git a/panda/src/linmath/lvecBase3_ext_src.I b/panda/src/linmath/lvecBase3_ext_src.I index 6ecd5eefe0..56ac6cc176 100644 --- a/panda/src/linmath/lvecBase3_ext_src.I +++ b/panda/src/linmath/lvecBase3_ext_src.I @@ -81,7 +81,7 @@ __reduce__(PyObject *self) const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVecBase2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVecBase3); @@ -91,7 +91,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'x' || *it > 'z') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -122,7 +122,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// @@ -136,10 +136,7 @@ __setattr__(PyObject *self, const string &attr_name, PyObject *assign) { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'x' || *it > 'z') { - PyTypeObject *tp = self->ob_type; - PyErr_Format(PyExc_AttributeError, - "'%.100s' object has no attribute '%.200s'", - tp->tp_name, attr_name.c_str()); + Dtool_Raise_AttributeError(self, attr_name.c_str()); return -1; } } diff --git a/panda/src/linmath/lvecBase3_ext_src.h b/panda/src/linmath/lvecBase3_ext_src.h index cf9f60a0d7..6b12ac69f3 100644 --- a/panda/src/linmath/lvecBase3_ext_src.h +++ b/panda/src/linmath/lvecBase3_ext_src.h @@ -23,7 +23,7 @@ template<> class Extension : public ExtensionBase { public: INLINE_LINMATH PyObject *__reduce__(PyObject *self) const; - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index c126e0fb6c..1a4ec5ce97 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -51,7 +51,7 @@ PUBLISHED: INLINE_LINMATH ~FLOATNAME(LVecBase3)(); EXTENSION(INLINE_LINMATH PyObject *__reduce__(PyObject *self) const); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH FLOATTYPE operator [](int i) const; diff --git a/panda/src/linmath/lvecBase4_ext_src.I b/panda/src/linmath/lvecBase4_ext_src.I index a0400690a5..dd06bdc0dc 100644 --- a/panda/src/linmath/lvecBase4_ext_src.I +++ b/panda/src/linmath/lvecBase4_ext_src.I @@ -82,7 +82,7 @@ __reduce__(PyObject *self) const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVecBase2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVecBase3); @@ -92,7 +92,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'w' || *it > 'z') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -127,7 +127,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// @@ -141,10 +141,7 @@ __setattr__(PyObject *self, const string &attr_name, PyObject *assign) { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'w' || *it > 'z') { - PyTypeObject *tp = self->ob_type; - PyErr_Format(PyExc_AttributeError, - "'%.100s' object has no attribute '%.200s'", - tp->tp_name, attr_name.c_str()); + Dtool_Raise_AttributeError(self, attr_name.c_str()); return -1; } } diff --git a/panda/src/linmath/lvecBase4_ext_src.h b/panda/src/linmath/lvecBase4_ext_src.h index 97924376ba..5d582bbe64 100644 --- a/panda/src/linmath/lvecBase4_ext_src.h +++ b/panda/src/linmath/lvecBase4_ext_src.h @@ -23,7 +23,7 @@ template<> class Extension : public ExtensionBase { public: INLINE_LINMATH PyObject *__reduce__(PyObject *self) const; - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; diff --git a/panda/src/linmath/lvecBase4_src.h b/panda/src/linmath/lvecBase4_src.h index 4abd48ed98..988d31b859 100644 --- a/panda/src/linmath/lvecBase4_src.h +++ b/panda/src/linmath/lvecBase4_src.h @@ -61,7 +61,7 @@ PUBLISHED: INLINE_LINMATH ~FLOATNAME(LVecBase4)(); EXTENSION(INLINE_LINMATH PyObject *__reduce__(PyObject *self) const); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH FLOATTYPE operator [](int i) const; diff --git a/panda/src/linmath/lvector2_ext_src.I b/panda/src/linmath/lvector2_ext_src.I index e0ae2bea6d..4e52774d3c 100644 --- a/panda/src/linmath/lvector2_ext_src.I +++ b/panda/src/linmath/lvector2_ext_src.I @@ -42,7 +42,7 @@ __repr__() const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector3); @@ -52,7 +52,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it != 'x' && *it != 'y') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -83,7 +83,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lvector2_ext_src.h b/panda/src/linmath/lvector2_ext_src.h index 56a48aeaa3..4a2888e7d4 100644 --- a/panda/src/linmath/lvector2_ext_src.h +++ b/panda/src/linmath/lvector2_ext_src.h @@ -22,7 +22,7 @@ template<> class Extension : public ExtensionBase { public: - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; }; diff --git a/panda/src/linmath/lvector2_src.h b/panda/src/linmath/lvector2_src.h index 81b2475af6..2ee50d34ab 100644 --- a/panda/src/linmath/lvector2_src.h +++ b/panda/src/linmath/lvector2_src.h @@ -25,7 +25,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector2)(FLOATTYPE x, FLOATTYPE y); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH static const FLOATNAME(LVector2) &zero(); diff --git a/panda/src/linmath/lvector3_ext_src.I b/panda/src/linmath/lvector3_ext_src.I index 451b713dee..f7fc436f55 100644 --- a/panda/src/linmath/lvector3_ext_src.I +++ b/panda/src/linmath/lvector3_ext_src.I @@ -43,7 +43,7 @@ __repr__() const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector3); @@ -53,7 +53,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'x' || *it > 'z') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -84,7 +84,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lvector3_ext_src.h b/panda/src/linmath/lvector3_ext_src.h index 33ab4ab140..a4c45fbe9a 100644 --- a/panda/src/linmath/lvector3_ext_src.h +++ b/panda/src/linmath/lvector3_ext_src.h @@ -22,7 +22,7 @@ template<> class Extension : public ExtensionBase { public: - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; }; diff --git a/panda/src/linmath/lvector3_src.h b/panda/src/linmath/lvector3_src.h index 7fc0316b06..7e0dd196bb 100644 --- a/panda/src/linmath/lvector3_src.h +++ b/panda/src/linmath/lvector3_src.h @@ -32,7 +32,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH static const FLOATNAME(LVector3) &zero(); diff --git a/panda/src/linmath/lvector4_ext_src.I b/panda/src/linmath/lvector4_ext_src.I index 04edba6a06..78a651a99e 100644 --- a/panda/src/linmath/lvector4_ext_src.I +++ b/panda/src/linmath/lvector4_ext_src.I @@ -44,7 +44,7 @@ __repr__() const { // Description: This is used to implement swizzle masks. //////////////////////////////////////////////////////////////////// INLINE_LINMATH PyObject *Extension:: -__getattr__(const string &attr_name) const { +__getattr__(PyObject *self, const string &attr_name) const { #ifndef CPPPARSER extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector2); extern struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector3); @@ -54,7 +54,7 @@ __getattr__(const string &attr_name) const { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'w' || *it > 'z') { - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } } @@ -89,7 +89,7 @@ __getattr__(const string &attr_name) const { } } - return NULL; + return Dtool_Raise_AttributeError(self, attr_name.c_str()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lvector4_ext_src.h b/panda/src/linmath/lvector4_ext_src.h index 5bc319ad13..c313e89848 100644 --- a/panda/src/linmath/lvector4_ext_src.h +++ b/panda/src/linmath/lvector4_ext_src.h @@ -22,7 +22,7 @@ template<> class Extension : public ExtensionBase { public: - INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const; + INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const; INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign); INLINE_LINMATH string __repr__() const; }; diff --git a/panda/src/linmath/lvector4_src.h b/panda/src/linmath/lvector4_src.h index 1cce8f0db5..ebf87429f6 100644 --- a/panda/src/linmath/lvector4_src.h +++ b/panda/src/linmath/lvector4_src.h @@ -26,7 +26,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); - EXTENSION(INLINE_LINMATH PyObject *__getattr__(const string &attr_name) const); + EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const string &attr_name) const); EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const string &attr_name, PyObject *assign)); INLINE_LINMATH static const FLOATNAME(LVector4) &zero(); From f87785d2c07adb197c5a5a89b45a4d61fe056832 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Jun 2015 17:37:50 +0200 Subject: [PATCH 018/203] Allow using Panda without 'signal' module in platforms that do not have one (eg. JavaScript) --- direct/src/showbase/PythonUtil.py | 2 -- direct/src/task/Task.py | 15 +++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 7f335e7a94..8d20e1683d 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -49,8 +49,6 @@ import traceback import __builtin__ from StringIO import StringIO import marshal -import unicodedata -import bisect __report_indent = 3 diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index f75ebca9ce..54458f0d2c 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -10,12 +10,16 @@ from direct.directnotify.DirectNotifyGlobal import * from direct.showbase import ExceptionVarDump from direct.showbase.PythonUtil import * from direct.showbase.MessengerGlobal import messenger -import signal import types import time import random import string +try: + import signal +except ImportError: + signal = None + from panda3d.core import * def print_exc_plus(): @@ -149,7 +153,8 @@ class TaskManager: def invokeDefaultHandler(self, signalNumber, stackFrame): print '*** allowing mid-frame keyboard interrupt.' # Restore default interrupt handler - signal.signal(signal.SIGINT, signal.default_int_handler) + if signal: + signal.signal(signal.SIGINT, signal.default_int_handler) # and invoke it raise KeyboardInterrupt @@ -454,7 +459,8 @@ class TaskManager: # after task list processing is complete. self.fKeyboardInterrupt = 0 self.interruptCount = 0 - signal.signal(signal.SIGINT, self.keyboardInterruptHandler) + if signal: + signal.signal(signal.SIGINT, self.keyboardInterruptHandler) startFrameTime = self.globalClock.getRealTime() @@ -465,7 +471,8 @@ class TaskManager: self.doYield(startFrameTime, nextTaskTime) # Restore default interrupt handler - signal.signal(signal.SIGINT, signal.default_int_handler) + if signal: + signal.signal(signal.SIGINT, signal.default_int_handler) if self.fKeyboardInterrupt: raise KeyboardInterrupt From a7d56f0e653da39697bed1488d548dd119f4bff2 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Jun 2015 17:41:28 +0200 Subject: [PATCH 019/203] Fix compilation error when compiling Python without threads --- dtool/src/dtoolutil/executionEnvironment.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index 3e1543ba4d..a51fb7741c 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -272,7 +272,9 @@ ns_get_environment_variable(const string &var) const { // marked BLOCKING, which releases the Python thread state, we // have to temporarily re-establish our thread state in the // Python interpreter. +#ifdef WITH_THREAD PyGILState_STATE state = PyGILState_Ensure(); +#endif Filename main_dir; PyObject *obj = PySys_GetObject((char*) "argv"); // borrowed reference @@ -303,7 +305,9 @@ ns_get_environment_variable(const string &var) const { } } +#ifdef WITH_THREAD PyGILState_Release(state); +#endif if (main_dir.empty()) { // We must be running in the Python interpreter directly, so return the CWD. From 269b4eac2760c8916e20a9c6b271f19c7b18eacb Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Jun 2015 17:53:37 +0200 Subject: [PATCH 020/203] Fix METH_NOARGS calling convention violations in interrogate, and special support for LINK_ALL_STATIC in interrogated code --- .../interfaceMakerPythonNative.cxx | 60 ++++++++++++++----- dtool/src/interrogate/interrogate_module.cxx | 2 +- dtool/src/interrogatedb/py_panda.cxx | 4 +- dtool/src/interrogatedb/py_panda.h | 4 +- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index bb8557e03c..1cef42e102 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -831,6 +831,7 @@ write_prototypes(ostream &out_code, ostream *out_h) { out_code << "// " << class_name << "\n"; + out_code << "#ifndef LINK_ALL_STATIC\n"; //out_code << "IMPORT_THIS struct Dtool_PyTypedObject Dtool_" << safe_name << ";\n"; out_code << "static struct Dtool_PyTypedObject *Dtool_Ptr_" << safe_name << ";\n"; //out_code << "#define Dtool_Ptr_" << safe_name << " &Dtool_" << safe_name << "\n"; @@ -884,6 +885,29 @@ write_prototypes(ostream &out_code, ostream *out_h) { } } } + out_code << "#else\n"; + out_code << "extern struct Dtool_PyTypedObject Dtool_" << safe_name << ";\n"; + out_code << "static struct Dtool_PyTypedObject *const Dtool_Ptr_" << safe_name << " = &Dtool_" << safe_name << ";\n"; + + if (has_coerce > 0) { + if (TypeManager::is_reference_count(type)) { + assert(!type->is_trivial()); + out_code << "extern bool Dtool_ConstCoerce_" << safe_name << "(PyObject *args, CPT(" << class_name << ") &coerced);\n"; + if (has_coerce > 1) { + out_code << "extern bool Dtool_Coerce_" << safe_name << "(PyObject *args, PT(" << class_name << ") &coerced);\n"; + } + + } else if (TypeManager::is_trivial(type)) { + out_code << "extern " << class_name << " *Dtool_Coerce_" << safe_name << "(PyObject *args, " << class_name << " &coerced);\n"; + + } else { + out_code << "extern bool Dtool_ConstCoerce_" << safe_name << "(PyObject *args, " << class_name << " const *&coerced, bool &manage);\n"; + if (has_coerce > 1) { + out_code << "extern bool Dtool_Coerce_" << safe_name << "(PyObject *args, " << class_name << " *&coerced, bool &manage);\n"; + } + } + } + out_code << "#endif\n"; } } @@ -1259,7 +1283,6 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { Objects::iterator oi; out << "void Dtool_" << def->library_name << "_RegisterTypes() {\n"; - for (oi = _objects.begin(); oi != _objects.end(); ++oi) { Object *object = (*oi).second; if (object->_itype.is_class() || @@ -1276,8 +1299,10 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { << " RegisterRuntimeTypedClass(Dtool_" << class_name << ");\n"; } else { - out << " RegisterNamedClass(\"" << object->_itype.get_scoped_name() - << "\", Dtool_" << class_name << ");\n"; + out << "#ifndef LINK_ALL_STATIC\n" + << " RegisterNamedClass(\"" << object->_itype.get_scoped_name() + << "\", Dtool_" << class_name << ");\n" + << "#endif\n"; if (IsPandaTypedObject(object->_itype._cpptype->as_struct_type())) { nout << object->_itype.get_scoped_name() << " derives from TypedObject, " @@ -1290,6 +1315,7 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { out << "}\n\n"; out << "void Dtool_" << def->library_name << "_ResolveExternals() {\n"; + out << "#ifndef LINK_ALL_STATIC\n"; out << " // Resolve externally imported types.\n"; for (std::set::iterator ii = _external_imports.begin(); ii != _external_imports.end(); ++ii) { @@ -1302,6 +1328,7 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { out << " Dtool_Ptr_" << safe_name << " = LookupNamedClass(\"" << class_name << "\");\n"; } } + out << "#endif\n"; out << "}\n\n"; out << "void Dtool_" << def->library_name << "_BuildInstants(PyObject *module) {\n"; @@ -1387,9 +1414,11 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { string name2 = methodNameFromCppName(func, "", true); string flags; + string fptr = "&" + func->_name; switch (func->_args_type) { case AT_keyword_args: flags = "METH_VARARGS | METH_KEYWORDS"; + fptr = "(PyCFunction) " + fptr; break; case AT_varargs: @@ -1408,11 +1437,11 @@ write_module_support(ostream &out, ostream *out_h, InterrogateModuleDef *def) { // Note: we shouldn't add METH_STATIC here, since both METH_STATIC // and METH_CLASS are illegal for module-level functions. - out << " {\"" << name1 << "\", (PyCFunction) &" - << func->_name << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; + out << " {\"" << name1 << "\", " << fptr + << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; if (name1 != name2) { - out << " {\"" << name2 << "\", (PyCFunction) &" - << func->_name << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; + out << " {\"" << name2 << "\", " << fptr + << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; } } } @@ -1542,9 +1571,11 @@ write_module_class(ostream &out, Object *obj) { string name2 = methodNameFromCppName(func, export_class_name, true); string flags; + string fptr = "&" + func->_name; switch (func->_args_type) { case AT_keyword_args: flags = "METH_VARARGS | METH_KEYWORDS"; + fptr = "(PyCFunction) " + fptr; break; case AT_varargs: @@ -1634,29 +1665,29 @@ write_module_class(ostream &out, Object *obj) { } // This method has non-slotted remaps, so write it out into the function table. - out << " {\"" << name1 << "\", (PyCFunction) &" - << func->_name << ", " << flags << ", (char *) " << func->_name << "_comment},\n"; + out << " {\"" << name1 << "\", " << fptr + << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; if (name1 != name2) { - out << " {\"" << name2 << "\", (PyCFunction) &" - << func->_name << ", " << flags << ", (char *) " << func->_name << "_comment},\n"; + out << " {\"" << name2 << "\", " << fptr + << ", " << flags << ", (const char *)" << func->_name << "_comment},\n"; } } } if (obj->_protocol_types & Object::PT_make_copy) { if (!got_copy) { - out << " {\"__copy__\", (PyCFunction) ©_from_make_copy, METH_NOARGS, NULL},\n"; + out << " {\"__copy__\", ©_from_make_copy, METH_NOARGS, NULL},\n"; got_copy = true; } } else if (obj->_protocol_types & Object::PT_copy_constructor) { if (!got_copy) { - out << " {\"__copy__\", (PyCFunction) ©_from_copy_constructor, METH_NOARGS, NULL},\n"; + out << " {\"__copy__\", ©_from_copy_constructor, METH_NOARGS, NULL},\n"; got_copy = true; } } if (got_copy && !got_deepcopy) { - out << " {\"__deepcopy__\", (PyCFunction) &map_deepcopy_to_copy, METH_VARARGS, NULL},\n"; + out << " {\"__deepcopy__\", &map_deepcopy_to_copy, METH_VARARGS, NULL},\n"; } MakeSeqs::iterator msi; @@ -3271,6 +3302,7 @@ write_function_for_top(ostream &out, InterfaceMaker::Object *obj, InterfaceMaker break; default: + prototype += ", PyObject *"; break; } prototype += ")"; diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 9653654629..02ac43ca50 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -209,7 +209,7 @@ int write_python_table_native(ostream &out) { out << "NULL};\n" << "\n" - << " PyObject *module = Dtool_PyModuleInitHelper(defs, \"" << library_name << "\");\n" + << " PyObject *module = Dtool_PyModuleInitHelper(defs, \"" << module_name << "\");\n" << " if (module != NULL) {\n"; for (ii = libraries.begin(); ii != libraries.end(); ii++) { diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 1108ef0c2f..755f0760e6 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -810,7 +810,7 @@ PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op) { // Description: This is a support function for a synthesized // __copy__() method from a C++ make_copy() method. //////////////////////////////////////////////////////////////////// -PyObject *copy_from_make_copy(PyObject *self) { +PyObject *copy_from_make_copy(PyObject *self, PyObject *noargs) { return PyObject_CallMethod(self, (char *)"make_copy", (char *)"()"); } @@ -819,7 +819,7 @@ PyObject *copy_from_make_copy(PyObject *self) { // Description: This is a support function for a synthesized // __copy__() method from a C++ copy constructor. //////////////////////////////////////////////////////////////////// -PyObject *copy_from_copy_constructor(PyObject *self) { +PyObject *copy_from_copy_constructor(PyObject *self, PyObject *noargs) { PyObject *this_class = PyObject_Type(self); if (this_class == NULL) { return NULL; diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 7640c5d070..5a78786aa4 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -509,10 +509,10 @@ EXPCL_DTOOLCONFIG int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2); EXPCL_DTOOLCONFIG PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op); EXPCL_DTOOLCONFIG PyObject * -copy_from_make_copy(PyObject *self); +copy_from_make_copy(PyObject *self, PyObject *noargs); EXPCL_DTOOLCONFIG PyObject * -copy_from_copy_constructor(PyObject *self); +copy_from_copy_constructor(PyObject *self, PyObject *noargs); EXPCL_DTOOLCONFIG PyObject * map_deepcopy_to_copy(PyObject *self, PyObject *args); From 419eadb859f937e5f0268250dde9db41cceb4df8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 21 Jun 2015 20:28:31 +0200 Subject: [PATCH 021/203] Support hardware skinning in GLSL --- panda/src/display/standardMunger.cxx | 31 ++++--- panda/src/display/standardMunger.h | 1 + panda/src/glstuff/glGeomMunger_src.cxx | 2 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 6 +- panda/src/glstuff/glShaderContext_src.cxx | 84 +++++++++++++++++++ panda/src/glstuff/glShaderContext_src.h | 6 ++ panda/src/pgraph/shaderAttrib.h | 1 + 7 files changed, 118 insertions(+), 13 deletions(-) diff --git a/panda/src/display/standardMunger.cxx b/panda/src/display/standardMunger.cxx index 45fcc7feb1..5dc6c03d13 100644 --- a/panda/src/display/standardMunger.cxx +++ b/panda/src/display/standardMunger.cxx @@ -37,14 +37,14 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, StateMunger(gsg), _num_components(num_components), _numeric_type(numeric_type), - _contents(contents) + _contents(contents), + _munge_color(false), + _munge_color_scale(false), + _auto_shader(false), + _shader_skinning(false) { _render_mode = DCAST(RenderModeAttrib, state->get_attrib(RenderModeAttrib::get_class_slot())); - _munge_color = false; - _munge_color_scale = false; - _auto_shader = false; - if (!get_gsg()->get_runtime_color_scale()) { // We might need to munge the colors. const ColorAttrib *color_attrib = (const ColorAttrib *) @@ -98,6 +98,9 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, if (shader_attrib->auto_shader()) { _auto_shader = true; } + if (shader_attrib->get_flag(ShaderAttrib::F_hardware_skinning)) { + _shader_skinning = true; + } } //////////////////////////////////////////////////////////////////// @@ -128,9 +131,12 @@ munge_data_impl(const GeomVertexData *data) { } GeomVertexAnimationSpec animation = new_data->get_format()->get_animation(); - if (hardware_animated_vertices && - animation.get_animation_type() == AT_panda && - new_data->get_slider_table() == (SliderTable *)NULL) { + if (_shader_skinning) { + animation.set_hardware(4, true); + + } else if (hardware_animated_vertices && + animation.get_animation_type() == AT_panda && + new_data->get_slider_table() == (SliderTable *)NULL) { // Maybe we can animate the vertices with hardware. const TransformBlendTable *table = new_data->get_transform_blend_table(); if (table != (TransformBlendTable *)NULL && @@ -161,7 +167,7 @@ munge_data_impl(const GeomVertexData *data) { } } } - + CPT(GeomVertexFormat) orig_format = new_data->get_format(); CPT(GeomVertexFormat) new_format = munge_format(orig_format, animation); @@ -306,7 +312,9 @@ compare_to_impl(const GeomMunger *other) const { return compare; } } - + if (_shader_skinning != om->_shader_skinning) { + return (int)_shader_skinning - (int)om->_shader_skinning; + } if (_auto_shader != om->_auto_shader) { return (int)_auto_shader - (int)om->_auto_shader; } @@ -345,6 +353,9 @@ geom_compare_to_impl(const GeomMunger *other) const { return compare; } } + if (_shader_skinning != om->_shader_skinning) { + return (int)_shader_skinning - (int)om->_shader_skinning; + } return StateMunger::geom_compare_to_impl(other); } diff --git a/panda/src/display/standardMunger.h b/panda/src/display/standardMunger.h index 872d2d8403..515a1d1ace 100644 --- a/panda/src/display/standardMunger.h +++ b/panda/src/display/standardMunger.h @@ -60,6 +60,7 @@ private: bool _munge_color; bool _munge_color_scale; bool _auto_shader; + bool _shader_skinning; LColor _color; LVecBase4 _color_scale; diff --git a/panda/src/glstuff/glGeomMunger_src.cxx b/panda/src/glstuff/glGeomMunger_src.cxx index fd98cbab1f..778fb71d95 100644 --- a/panda/src/glstuff/glGeomMunger_src.cxx +++ b/panda/src/glstuff/glGeomMunger_src.cxx @@ -158,7 +158,7 @@ munge_format_impl(const GeomVertexFormat *orig, if (animation.get_num_transforms() > 1) { PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat; new_array_format->add_column - (InternalName::get_transform_weight(), animation.get_num_transforms() - 1, + (InternalName::get_transform_weight(), animation.get_num_transforms(), NT_stdfloat, C_other); if (animation.get_indexed_transforms()) { diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 9c6be3444c..c330776394 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3275,11 +3275,11 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, } } +#ifndef OPENGLES const GeomVertexAnimationSpec &animation = _data_reader->get_format()->get_animation(); bool hardware_animation = (animation.get_animation_type() == Geom::AT_hardware); -#ifndef OPENGLES - if (hardware_animation) { + if (hardware_animation && _current_shader_context == NULL) { // Set up the transform matrices for vertex blending. nassertr(_supports_vertex_blend, false); glEnable(GL_VERTEX_BLEND_ARB); @@ -3361,6 +3361,8 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, GLPf(LoadMatrix)(_internal_transform->get_mat().get_data()); } } +#else + const bool hardware_animation = false; #endif #ifndef OPENGLES_2 diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 58f78c5f6b..4c6922432f 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -211,6 +211,8 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext _uses_standard_vertex_arrays = false; _has_divisor = false; _color_attrib_index = -1; + _transform_table_index = -1; + _slider_table_index = -1; _validated = !gl_validate_shaders; nassertv(s->get_language() == Shader::SL_GLSL); @@ -883,6 +885,26 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { _shader->_mat_spec.push_back(bind); return; } + if (noprefix == "TransformTable") { + if (param_type != GL_FLOAT_MAT4) { + GLCAT.error() + << "p3d_TransformTable should be uniform mat4\n"; + return; + } + _transform_table_index = p; + _transform_table_size = param_size; + return; + } + if (noprefix == "SliderTable") { + if (param_type != GL_FLOAT) { + GLCAT.error() + << "p3d_SliderTable should be uniform float\n"; + return; + } + _slider_table_index = p; + _slider_table_size = param_size; + return; + } GLCAT.error() << "Unrecognized uniform name '" << param_name << "'!\n"; return; @@ -1586,6 +1608,58 @@ issue_parameters(int altered) { _glgsg->report_my_gl_errors(); } +//////////////////////////////////////////////////////////////////// +// Function: GLShaderContext::update_transform_table +// Access: Public +// Description: Changes the active transform table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(ShaderContext):: +update_transform_table(const TransformTable *table) { + LMatrix4f *matrices = (LMatrix4f *)alloca(_transform_table_size * 64); + + int i = 0; + if (table != NULL) { + int num_transforms = min(_transform_table_size, table->get_num_transforms()); + for (; i < num_transforms; ++i) { +#ifdef STDFLOAT_DOUBLE + LMatrix4 matrix; + table->get_transform(i)->get_matrix(matrix); + matrices[i] = LCAST(float, matrix); +#else + table->get_transform(i)->get_matrix(matrices[i]); +#endif + } + } + for (; i < _transform_table_size; ++i) { + matrices[i] = LMatrix4f::ident_mat(); + } + + _glgsg->_glUniformMatrix4fv(_transform_table_index, _transform_table_size, + GL_FALSE, (float *)matrices); +} + +//////////////////////////////////////////////////////////////////// +// Function: GLShaderContext::update_slider_table +// Access: Public +// Description: Changes the active slider table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(ShaderContext):: +update_slider_table(const SliderTable *table) { + float *sliders = (float *)alloca(_slider_table_size * 4); + memset(sliders, 0, _slider_table_size * 4); + + if (table != NULL) { + int num_sliders = min(_slider_table_size, table->get_num_sliders()); + for (int i = 0; i < num_sliders; ++i) { + sliders[i] = table->get_slider(i)->get_slider(); + } + } + + _glgsg->_glUniform1fv(_slider_table_index, _slider_table_size, sliders); +} + //////////////////////////////////////////////////////////////////// // Function: GLShaderContext::disable_shader_vertex_arrays // Access: Public @@ -1717,6 +1791,16 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { } } + if (_transform_table_index >= 0) { + const TransformTable *table = _glgsg->_data_reader->get_transform_table(); + update_transform_table(table); + } + + if (_slider_table_index >= 0) { + const SliderTable *table = _glgsg->_data_reader->get_slider_table(); + update_slider_table(table); + } + _glgsg->report_my_gl_errors(); return true; diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index 48a74f99cb..fd4b56def4 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -48,6 +48,8 @@ public: void bind(bool reissue_parameters = true); void unbind(); void issue_parameters(int altered); + void update_transform_table(const TransformTable *table); + void update_slider_table(const SliderTable *table); void disable_shader_vertex_arrays(); bool update_shader_vertex_arrays(ShaderContext *prev, bool force); void disable_shader_texture_bindings(); @@ -74,6 +76,10 @@ private: //ParamContexts _params; GLint _color_attrib_index; + GLint _transform_table_index; + GLint _slider_table_index; + GLsizei _transform_table_size; + GLsizei _slider_table_size; pmap _glsl_uniform_handles; struct ImageInput { diff --git a/panda/src/pgraph/shaderAttrib.h b/panda/src/pgraph/shaderAttrib.h index 7bf605f9bd..d146e80bab 100644 --- a/panda/src/pgraph/shaderAttrib.h +++ b/panda/src/pgraph/shaderAttrib.h @@ -48,6 +48,7 @@ PUBLISHED: enum { F_disable_alpha_write = 0, // Suppress writes to color buffer alpha channel. F_subsume_alpha_test = 1, // Shader promises to subsume the alpha test using TEXKILL + F_hardware_skinning = 2, // Shader needs pre-animated vertices }; INLINE bool has_shader() const; From 236b0c590cc1781848c76e119309acc1f942f5ec Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 22 Jun 2015 21:01:34 +0200 Subject: [PATCH 022/203] Use explicit symbol visibility control in GCC/clang --- dtool/src/dtoolbase/dtoolbase.h | 3 +++ dtool/src/dtoolbase/dtoolsymbols.h | 5 +++++ dtool/src/interrogate/interrogate_module.cxx | 4 ++++ dtool/src/prc/notifyCategoryProxy.h | 18 ++++-------------- makepanda/makepanda.py | 2 ++ 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 50efeab52d..4398036e3a 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -431,6 +431,9 @@ #if defined(WIN32_VC) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) #define EXPORT_CLASS __declspec(dllexport) #define IMPORT_CLASS __declspec(dllimport) +#elif __GNUC__ >= 4 && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) +#define EXPORT_CLASS __attribute__((visibility("default"))) +#define IMPORT_CLASS #else #define EXPORT_CLASS #define IMPORT_CLASS diff --git a/dtool/src/dtoolbase/dtoolsymbols.h b/dtool/src/dtoolbase/dtoolsymbols.h index 56320840f5..02e976b936 100644 --- a/dtool/src/dtoolbase/dtoolsymbols.h +++ b/dtool/src/dtoolbase/dtoolsymbols.h @@ -97,7 +97,12 @@ /* These two are always defined empty, because pystub is statically built. But we leave the symbol around in case we change our minds to make pystub once again be a dynamic library. */ +#if __GNUC__ >= 4 +/* In GCC, though, we still need to mark the symbols as visible. */ +#define EXPCL_PYSTUB __attribute__((visibility("default"))) +#else #define EXPCL_PYSTUB +#endif #define EXPTP_PYSTUB #endif diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 02ac43ca50..8aad13c5c6 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -135,6 +135,8 @@ int write_python_table_native(ostream &out) { << "\n" << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) PyObject *PyInit_" << library_name << "();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) PyObject *PyInit_" << library_name << "();\n" << "#else\n" << "extern \"C\" PyObject *PyInit_" << library_name << "();\n" << "#endif\n" @@ -180,6 +182,8 @@ int write_python_table_native(ostream &out) { << "\n" << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) void init" << library_name << "();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) void init" << library_name << "();\n" << "#else\n" << "extern \"C\" void init" << library_name << "();\n" << "#endif\n" diff --git a/dtool/src/prc/notifyCategoryProxy.h b/dtool/src/prc/notifyCategoryProxy.h index 5a306497cd..4349b4a04b 100644 --- a/dtool/src/prc/notifyCategoryProxy.h +++ b/dtool/src/prc/notifyCategoryProxy.h @@ -125,8 +125,9 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro // appear in the config_*.h file. The proxy object will be named // basename_cat. -#if defined(WIN32_VC) && !defined(CPPPARSER) - +#ifdef CPPPARSER +#define NotifyCategoryDecl(basename, expcl, exptp) +#else #define NotifyCategoryDecl(basename, expcl, exptp) \ class expcl NotifyCategoryGetCategory_ ## basename { \ public: \ @@ -135,18 +136,7 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro }; \ exptp template class expcl NotifyCategoryProxy; \ extern expcl NotifyCategoryProxy basename ## _cat; - -#else // WIN32_VC - -#define NotifyCategoryDecl(basename, expcl, exptp) \ - class NotifyCategoryGetCategory_ ## basename { \ - public: \ - NotifyCategoryGetCategory_ ## basename(); \ - static NotifyCategory *get_category(); \ - }; \ - extern NotifyCategoryProxy basename ## _cat; - -#endif // WIN32_VC +#endif // This macro is the same as the above, except that it declares a category // that is not intended to be exported from any DLL. diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 8d081ebf5f..de7d68b6b6 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1160,6 +1160,8 @@ def CompileCxx(obj,src,opts): if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val for x in ipath: cmd += ' -I' + x + cmd += ' -fvisibility=hidden' + # Mac-specific flags. if GetTarget() == "darwin": cmd += " -Wno-deprecated-declarations" From 773614c6105b30695bffd2e96b8d2ad0aef69fa5 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 22 Jun 2015 22:33:11 +0200 Subject: [PATCH 023/203] Fix missing EXPCL_DIRECT on activate_osx_application() --- direct/src/showbase/showBase.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direct/src/showbase/showBase.h b/direct/src/showbase/showBase.h index 8b9c24f40a..5ffea8cbee 100644 --- a/direct/src/showbase/showBase.h +++ b/direct/src/showbase/showBase.h @@ -52,13 +52,12 @@ EXPCL_DIRECT void store_accessibility_shortcut_keys(); EXPCL_DIRECT void allow_accessibility_shortcut_keys(bool allowKeys); #ifdef IS_OSX -void activate_osx_application(); +EXPCL_DIRECT void activate_osx_application(); #endif END_PUBLISH - #if 0 class TempGridZoneManager { PUBLISHED: From 4f3998ae11c3a188b7d70bfd15b026aa49a005e3 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 23 Jun 2015 21:09:33 +0200 Subject: [PATCH 024/203] Build panda3d/*.so as bundles on OSX, make OSX builds relocatable --- makepanda/makepanda.py | 62 +++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index de7d68b6b6..23651b7d0d 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1595,9 +1595,10 @@ def CompileLink(dll, obj, opts): else: if (GetTarget() == "darwin"): cmd = cxx + ' -undefined dynamic_lookup' - if ("BUNDLE" in opts): cmd += ' -bundle ' + if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"): + cmd += ' -bundle ' else: - install_name = os.path.basename(dll) + install_name = '@loader_path/../lib/' + os.path.basename(dll) cmd += ' -dynamiclib -install_name ' + install_name cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp' @@ -2622,6 +2623,12 @@ ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc) tp_dir = GetThirdpartyDir() if tp_dir is not None: + dylibs = set() + + if GetTarget() == 'darwin': + for lib in glob.glob(tp_dir + "/*/lib/*.dylib"): + dylibs.add(os.path.basename(lib)) + for pkg in PkgListGet(): if PkgSkip(pkg): continue @@ -2641,12 +2648,36 @@ if tp_dir is not None: CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib) if GetTarget() == 'darwin': - for tp_lib in glob.glob(tp_pkg + "/lib/*.dylib"): - CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib) + tp_libs = glob.glob(tp_pkg + "/lib/*.dylib") if not PkgSkip("PYTHON"): - for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib")): - CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib) + tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib")) + + for tp_lib in tp_libs: + basename = os.path.basename(tp_lib) + target = GetOutputDir() + "/lib/" + basename + if not NeedsBuild([target], [tp_lib]): + continue + + CopyFile(target, tp_lib) + if os.path.islink(target): + continue + + # Correct the inter-library dependencies so that the build is relocatable. + oscmd('install_name_tool -id @loader_path/../lib/%s %s' % (basename, target)) + oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True) + + for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"): + line = line.strip() + if not line or line.startswith('@loader_path/../lib/') or line.endswith(":"): + continue + + libdep = line.split(" ", 1)[0] + dep_basename = os.path.basename(libdep) + if dep_basename in dylibs: + oscmd("install_name_tool -change %s @loader_path/../lib/%s %s" % (libdep, dep_basename, target), True) + + JustBuilt([target], [tp_lib]) for fwx in glob.glob(tp_pkg + "/*.framework"): CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx) @@ -6649,16 +6680,6 @@ def MakeInstallerOSX(): # On OSX, just specifying -P is not enough to do that. oscmd("cp -R -P " + GetOutputDir() + "/" + base + " " + libname) - # Execute install_name_tool to make them reference an absolute path - if (libname.endswith(".dylib") or libname.endswith(".so")) and not os.path.islink(libname): - oscmd("install_name_tool -id /Developer/Panda3D/%s %s" % (base, libname), True) - oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (libname, GetOutputDir()), True) - for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): - if len(line.strip()) > 0 and not line.strip().endswith(":"): - libdep = line.strip().split(" ", 1)[0] - if 'lib/' + os.path.basename(libdep) in install_libs: - oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, os.path.basename(libdep), libname), True) - oscmd("mkdir -p dstroot/tools/Developer/Tools/Panda3D") oscmd("mkdir -p dstroot/tools/Developer/Panda3D") oscmd("mkdir -p dstroot/tools/etc/paths.d") @@ -6673,15 +6694,6 @@ def MakeInstallerOSX(): # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname) - # Execute install_name_tool to make the binaries reference an absolute path - if (not os.path.islink(binname)): - oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (binname, GetOutputDir()), True) - for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): - if len(line.strip()) > 0 and not line.strip().endswith(":"): - libdep = line.strip().split(" ", 1)[0] - if 'lib/' + os.path.basename(libdep) in install_libs: - oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, os.path.basename(libdep), binname), True) - if PkgSkip("PYTHON")==0: PV = SDK["PYTHONVERSION"].replace("python", "") oscmd("mkdir -p dstroot/pythoncode/usr/bin") From d9342043b098da270aa295b34dade574c6e05de3 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 28 Jun 2015 13:55:31 +0200 Subject: [PATCH 025/203] Deprecate pandac.PandaModules and genPyCode, move extensions to panda3d/, clean up imports and deprecated behaviour --- direct/src/actor/Actor.py | 5 +- direct/src/cluster/ClusterClient.py | 2 +- direct/src/cluster/ClusterConfig.py | 1 - direct/src/cluster/ClusterMsgs.py | 2 +- direct/src/cluster/ClusterServer.py | 2 +- direct/src/directbase/TestStart.py | 6 +- .../src/directdevices/DirectDeviceManager.py | 18 +- direct/src/directnotify/Logger.py | 1 - direct/src/directnotify/Notifier.py | 1 - direct/src/directscripts/doxygen_filter.py | 2 +- direct/src/directscripts/extract_docs.py | 2 +- direct/src/directtools/DirectCameraControl.py | 2 +- direct/src/directtools/DirectGeometry.py | 2 +- direct/src/directtools/DirectGlobals.py | 2 +- direct/src/directtools/DirectGrid.py | 2 +- direct/src/directtools/DirectLights.py | 2 +- direct/src/directtools/DirectSession.py | 16 +- direct/src/distributed/PyDatagram.py | 3 +- direct/src/distributed/PyDatagramIterator.py | 3 +- .../extensions_native/CInterval_extensions.py | 9 +- .../extensions_native/NodePath_extensions.py | 789 ++---------------- .../extensions_native/VBase3_extensions.py | 2 +- .../extensions_native/VBase4_extensions.py | 2 +- direct/src/ffi/DoGenPyCode.py | 6 +- direct/src/ffi/FFITypes.py | 1 - direct/src/ffi/jGenPyCode.py | 1 - direct/src/filter/CommonFilters.py | 4 +- direct/src/filter/FilterManager.py | 7 +- direct/src/fsm/FourState.py | 1 - direct/src/fsm/SampleFSM.py | 1 - direct/src/fsm/State.py | 1 - direct/src/fsm/StatePush.py | 2 +- direct/src/gui/DirectButton.py | 2 +- direct/src/gui/DirectCheckBox.py | 2 +- direct/src/gui/DirectCheckButton.py | 3 +- direct/src/gui/DirectDialog.py | 2 +- direct/src/gui/DirectEntry.py | 2 +- direct/src/gui/DirectEntryScroll.py | 6 +- direct/src/gui/DirectFrame.py | 4 +- direct/src/gui/DirectGuiBase.py | 8 +- direct/src/gui/DirectGuiGlobals.py | 2 +- direct/src/gui/DirectGuiTest.py | 4 +- direct/src/gui/DirectLabel.py | 3 +- direct/src/gui/DirectOptionMenu.py | 2 +- direct/src/gui/DirectRadioButton.py | 2 +- direct/src/gui/DirectScrollBar.py | 2 +- direct/src/gui/DirectScrolledFrame.py | 2 +- direct/src/gui/DirectScrolledList.py | 4 +- direct/src/gui/DirectSlider.py | 2 +- direct/src/gui/DirectWaitBar.py | 2 +- direct/src/gui/OnscreenGeom.py | 5 +- direct/src/gui/OnscreenImage.py | 5 +- direct/src/gui/OnscreenText.py | 4 +- direct/src/interval/ActorInterval.py | 3 +- direct/src/interval/AnimControlInterval.py | 3 +- direct/src/interval/FunctionInterval.py | 4 +- direct/src/interval/IndirectInterval.py | 3 +- direct/src/interval/Interval.py | 5 +- direct/src/interval/IntervalGlobal.py | 18 +- direct/src/interval/IntervalManager.py | 6 +- direct/src/interval/IntervalTest.py | 8 +- direct/src/interval/LerpInterval.py | 3 +- direct/src/interval/MetaInterval.py | 9 +- direct/src/interval/MopathInterval.py | 3 +- direct/src/interval/ParticleInterval.py | 4 +- direct/src/interval/ProjectileInterval.py | 4 +- direct/src/interval/ProjectileIntervalTest.py | 4 +- direct/src/interval/SoundInterval.py | 3 +- direct/src/interval/TestInterval.py | 4 +- direct/src/motiontrail/MotionTrail.py | 3 +- direct/src/p3d/AppRunner.py | 7 +- direct/src/p3d/DWBPackageInstaller.py | 2 + direct/src/p3d/DeploymentTools.py | 2 +- direct/src/p3d/FileSpec.py | 2 + direct/src/p3d/HostInfo.py | 2 + direct/src/p3d/InstalledHostData.py | 2 + direct/src/p3d/InstalledPackageData.py | 2 + direct/src/p3d/JavaScript.py | 2 + direct/src/p3d/PackageInfo.py | 4 +- direct/src/p3d/PackageInstaller.py | 2 + direct/src/p3d/PackageMerger.py | 3 +- direct/src/p3d/Packager.py | 4 +- direct/src/p3d/PatchMaker.py | 2 + direct/src/p3d/ScanDirectoryNode.py | 2 + direct/src/p3d/SeqValue.py | 2 + direct/src/particles/ForceGroup.py | 3 +- direct/src/particles/ParticleEffect.py | 10 +- direct/src/particles/ParticleFloorTest.py | 9 +- direct/src/particles/Particles.py | 6 +- direct/src/showbase/Audio3DManager.py | 2 +- direct/src/showbase/ContainerLeakDetector.py | 3 +- direct/src/showbase/ContainerReport.py | 4 +- direct/src/showbase/DistancePhasedNode.py | 3 +- direct/src/showbase/ExcelHandler.py | 1 - direct/src/showbase/Finder.py | 1 - direct/src/showbase/GarbageReport.py | 2 +- direct/src/showbase/LazySort.py | 1 - direct/src/showbase/Messenger.py | 1 - direct/src/showbase/ObjectPool.py | 1 - direct/src/showbase/OnScreenDebug.py | 4 +- direct/src/showbase/ProfileSession.py | 5 +- direct/src/showbase/PythonUtil.py | 2 - direct/src/showbase/RandomNumGen.py | 2 +- direct/src/showbase/SfxPlayer.py | 3 +- direct/src/showbase/ShowBase.py | 78 +- direct/src/showbase/Transitions.py | 4 +- direct/src/showbase/pandaSqueezeTool.py | 16 +- direct/src/showutil/BuildGeometry.py | 7 +- direct/src/showutil/Effects.py | 2 +- direct/src/showutil/FreezeTool.py | 1 - direct/src/showutil/Rope.py | 2 +- direct/src/showutil/TexMemWatcher.py | 2 +- direct/src/showutil/TexViewer.py | 2 +- direct/src/task/Task.py | 2 - direct/src/task/Timer.py | 1 - direct/src/tkpanels/AnimPanel.py | 2 +- direct/src/tkpanels/DirectSessionPanel.py | 4 +- direct/src/tkpanels/Inspector.py | 17 +- direct/src/tkpanels/MopathRecorder.py | 2 +- direct/src/tkpanels/NotifyPanel.py | 5 +- direct/src/tkpanels/ParticlePanel.py | 6 +- direct/src/tkpanels/Placer.py | 8 +- direct/src/tkwidgets/AppShell.py | 1 - direct/src/tkwidgets/Dial.py | 1 - direct/src/tkwidgets/EntryScale.py | 1 - direct/src/tkwidgets/Floater.py | 2 +- direct/src/tkwidgets/SceneGraphExplorer.py | 2 +- direct/src/tkwidgets/Slider.py | 6 +- direct/src/tkwidgets/Tree.py | 5 +- direct/src/wxwidgets/ViewPort.py | 2 +- direct/src/wxwidgets/WxPandaShell.py | 3 +- dtool/src/dtoolutil/executionEnvironment.cxx | 61 +- .../interfaceMakerPythonNative.cxx | 8 +- dtool/src/interrogate/interrogate_module.cxx | 6 +- makepanda/makepanda.py | 284 ++++--- makepanda/makepandacore.py | 5 +- 136 files changed, 484 insertions(+), 1222 deletions(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 7802ebc3eb..ae55e76d33 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -2,11 +2,10 @@ __all__ = ['Actor'] -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.DirectObject import DirectObject from direct.directnotify import DirectNotifyGlobal -from pandac.PandaModules import LODNode -import types, copy +import types class Actor(DirectObject, NodePath): """ diff --git a/direct/src/cluster/ClusterClient.py b/direct/src/cluster/ClusterClient.py index adb7f8744e..4dca3a1379 100644 --- a/direct/src/cluster/ClusterClient.py +++ b/direct/src/cluster/ClusterClient.py @@ -1,6 +1,6 @@ """ClusterClient: Master for mutli-piping or PC clusters. """ -from pandac.PandaModules import * +from panda3d.core import * from ClusterMsgs import * from ClusterConfig import * from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/cluster/ClusterConfig.py b/direct/src/cluster/ClusterConfig.py index 74313afc41..6cf71dcaab 100644 --- a/direct/src/cluster/ClusterConfig.py +++ b/direct/src/cluster/ClusterConfig.py @@ -1,6 +1,5 @@ from ClusterClient import * -import string # A dictionary of information for various cluster configurations. # Dictionary is keyed on cluster-config string diff --git a/direct/src/cluster/ClusterMsgs.py b/direct/src/cluster/ClusterMsgs.py index 1533884eb2..e06deeb132 100644 --- a/direct/src/cluster/ClusterMsgs.py +++ b/direct/src/cluster/ClusterMsgs.py @@ -3,7 +3,7 @@ # This module is intended to supply routines and dataformats common to # both ClusterClient and ClusterServer. -from pandac.PandaModules import * +from panda3d.core import * from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagramIterator import time diff --git a/direct/src/cluster/ClusterServer.py b/direct/src/cluster/ClusterServer.py index a4a8177a9d..0e5cea0e0d 100644 --- a/direct/src/cluster/ClusterServer.py +++ b/direct/src/cluster/ClusterServer.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import * +from panda3d.core import * from ClusterMsgs import * from direct.distributed.MsgTypes import * from direct.directnotify import DirectNotifyGlobal diff --git a/direct/src/directbase/TestStart.py b/direct/src/directbase/TestStart.py index 7439c691fa..7cb8ae37c7 100755 --- a/direct/src/directbase/TestStart.py +++ b/direct/src/directbase/TestStart.py @@ -1,10 +1,10 @@ -print 'TestStart: Starting up test environment.' +print('TestStart: Starting up test environment.') -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.PythonUtil import * from direct.showbase import ShowBase -ShowBase.ShowBase() +base = ShowBase.ShowBase() # Put an axis in the world: loader.loadModel("models/misc/xyzAxis").reparentTo(render) diff --git a/direct/src/directdevices/DirectDeviceManager.py b/direct/src/directdevices/DirectDeviceManager.py index 0c435849f1..1c0c89ca88 100644 --- a/direct/src/directdevices/DirectDeviceManager.py +++ b/direct/src/directdevices/DirectDeviceManager.py @@ -1,7 +1,8 @@ """ Class used to create and control vrpn devices """ from direct.showbase.DirectObject import DirectObject -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.vrpn import * ANALOG_MIN = -0.95 ANALOG_MAX = 0.95 @@ -294,18 +295,3 @@ class DirectTimecodeReader(AnalogNode, DirectObject): def __repr__(self): str = ('%s: %d:%d:%d:%d' % ((self.name,) + self.getTime()[:-1])) return str - - - - - - - - - - - - - - - diff --git a/direct/src/directnotify/Logger.py b/direct/src/directnotify/Logger.py index 8c7f6b6f3b..844dead3d5 100644 --- a/direct/src/directnotify/Logger.py +++ b/direct/src/directnotify/Logger.py @@ -1,7 +1,6 @@ """Logger module: contains the logger class which creates and writes data to log files on disk""" -import sys import time import math diff --git a/direct/src/directnotify/Notifier.py b/direct/src/directnotify/Notifier.py index 2d59c5bf70..816ab8c0df 100644 --- a/direct/src/directnotify/Notifier.py +++ b/direct/src/directnotify/Notifier.py @@ -6,7 +6,6 @@ from LoggerGlobal import defaultLogger from direct.showbase import PythonUtil from panda3d.core import ConfigVariableBool, NotifyCategory, StreamWriter, Notify import time -import types import sys class Notifier: diff --git a/direct/src/directscripts/doxygen_filter.py b/direct/src/directscripts/doxygen_filter.py index f69d2fa07f..43e8fc7aec 100644 --- a/direct/src/directscripts/doxygen_filter.py +++ b/direct/src/directscripts/doxygen_filter.py @@ -2,7 +2,7 @@ doxygen can understand and process. It can be used as an INPUT_FILTER in doxygen. """ -import sys, re, os +import sys, os # Explicitly include these files. Besides these, all # files ending in _src will be explicitly included too. diff --git a/direct/src/directscripts/extract_docs.py b/direct/src/directscripts/extract_docs.py index 9c59e05ff6..a0033ff5fe 100644 --- a/direct/src/directscripts/extract_docs.py +++ b/direct/src/directscripts/extract_docs.py @@ -7,7 +7,7 @@ files in the lib/pandac/input directory. """ __all__ = [] -import os, re +import os import panda3d, pandac from panda3d.dtoolconfig import * diff --git a/direct/src/directtools/DirectCameraControl.py b/direct/src/directtools/DirectCameraControl.py index b2333c2ff2..2ec27e8a5a 100644 --- a/direct/src/directtools/DirectCameraControl.py +++ b/direct/src/directtools/DirectCameraControl.py @@ -222,7 +222,7 @@ class DirectCameraControl(DirectObject): skipFlags |= SKIP_CAMERA * (1 - base.getControl()) self.computeCOA(base.direct.iRay.pickGeom(skipFlags = skipFlags)) # Record reference point - self.coaMarkerRef.iPosHprScale(base.cam) + self.coaMarkerRef.setPosHprScale(base.cam, 0, 0, 0, 0, 0, 0, 1, 1, 1) # Record entries self.cqEntries = [] for i in range(base.direct.iRay.getNumEntries()): diff --git a/direct/src/directtools/DirectGeometry.py b/direct/src/directtools/DirectGeometry.py index 437f09e448..9c748e57b3 100644 --- a/direct/src/directtools/DirectGeometry.py +++ b/direct/src/directtools/DirectGeometry.py @@ -1,5 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * from DirectGlobals import * from DirectUtil import * import math diff --git a/direct/src/directtools/DirectGlobals.py b/direct/src/directtools/DirectGlobals.py index 11c500e622..2a70697598 100644 --- a/direct/src/directtools/DirectGlobals.py +++ b/direct/src/directtools/DirectGlobals.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import Vec3, Point3, BitMask32 +from panda3d.core import Vec3, Point3, BitMask32 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible', 'GridBack', 'unpickable'] diff --git a/direct/src/directtools/DirectGrid.py b/direct/src/directtools/DirectGrid.py index d02195a2c1..71fedf52c1 100644 --- a/direct/src/directtools/DirectGrid.py +++ b/direct/src/directtools/DirectGrid.py @@ -1,5 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.DirectObject import DirectObject from DirectUtil import * from DirectGeometry import * diff --git a/direct/src/directtools/DirectLights.py b/direct/src/directtools/DirectLights.py index 5e5a5eb5e2..1c4ffef230 100644 --- a/direct/src/directtools/DirectLights.py +++ b/direct/src/directtools/DirectLights.py @@ -1,5 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * from string import lower class DirectLight(NodePath): diff --git a/direct/src/directtools/DirectSession.py b/direct/src/directtools/DirectSession.py index a68012c2d8..124799c6cb 100644 --- a/direct/src/directtools/DirectSession.py +++ b/direct/src/directtools/DirectSession.py @@ -2,7 +2,7 @@ import math import types import string -from pandac.PandaModules import * +from panda3d.core import * from DirectUtil import * from direct.showbase.DirectObject import DirectObject @@ -304,6 +304,7 @@ class DirectSession(DirectObject): except NameError: # Has the clusterMode been set via a config variable? self.clusterMode = base.config.GetString("cluster-mode", '') + if self.clusterMode == 'client': self.cluster = createClusterClient() elif self.clusterMode == 'server': @@ -400,7 +401,7 @@ class DirectSession(DirectObject): if self.oobeMode: # Position a target point to lerp the oobe camera to - base.direct.cameraControl.camManipRef.iPosHpr(self.trueCamera) + base.direct.cameraControl.camManipRef.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0) ival = self.oobeCamera.posHprInterval( 2.0, pos = Point3(0), hpr = Vec3(0), other = base.direct.cameraControl.camManipRef, @@ -416,7 +417,7 @@ class DirectSession(DirectObject): cameraParent = self.camera.getParent() # Prepare oobe camera self.oobeCamera.reparentTo(cameraParent) - self.oobeCamera.iPosHpr(self.trueCamera) + self.oobeCamera.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0) # Put camera under new oobe camera self.cam.reparentTo(self.oobeCamera) # Position a target point to lerp the oobe camera to @@ -432,13 +433,13 @@ class DirectSession(DirectObject): def beginOOBE(self): # Make sure we've reached our final destination - self.oobeCamera.iPosHpr(base.direct.cameraControl.camManipRef) + self.oobeCamera.setPosHpr(base.direct.cameraControl.camManipRef, 0, 0, 0, 0, 0, 0) base.direct.camera = self.oobeCamera self.oobeMode = 1 def endOOBE(self): # Make sure we've reached our final destination - self.oobeCamera.iPosHpr(self.trueCamera) + self.oobeCamera.setPosHpr(self.trueCamera, 0, 0, 0, 0, 0, 0) # Disable OOBE mode. self.cam.reparentTo(self.trueCamera) base.direct.camera = self.trueCamera @@ -806,7 +807,7 @@ class DirectSession(DirectObject): [nodePath, oldParent, self.activeParent, fWrt]) def isNotCycle(self, nodePath, parent): - if nodePath.id() == parent.id(): + if nodePath == parent: print 'DIRECT.reparent: Invalid parent' return 0 elif parent.hasParent(): @@ -1308,6 +1309,3 @@ class DisplayRegionList(DirectObject): if drc.cam == cam: self.displayRegionList.remove(drc) break - -# Create one -__builtins__['direct'] = base.direct = DirectSession() diff --git a/direct/src/distributed/PyDatagram.py b/direct/src/distributed/PyDatagram.py index 3699407b73..f5db501b72 100755 --- a/direct/src/distributed/PyDatagram.py +++ b/direct/src/distributed/PyDatagram.py @@ -3,7 +3,8 @@ # class variable FuncDict and so we can import DCSubatomicType at the top # of the file rather than every time we call the putArg function. -from pandac.PandaModules import * +from panda3d.core import Datagram +from panda3d.direct import * # Import the type numbers #from otp.ai.AIMsgTypes import * diff --git a/direct/src/distributed/PyDatagramIterator.py b/direct/src/distributed/PyDatagramIterator.py index ea3cd0ea02..88ebf4021b 100755 --- a/direct/src/distributed/PyDatagramIterator.py +++ b/direct/src/distributed/PyDatagramIterator.py @@ -3,7 +3,8 @@ # class variable FuncDict and so we can import DCSubatomicType at the top # of the file rather than every time we call the putArg function. -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * # Import the type numbers class PyDatagramIterator(DatagramIterator): diff --git a/direct/src/extensions_native/CInterval_extensions.py b/direct/src/extensions_native/CInterval_extensions.py index 34c7a781cc..f20232e2cb 100644 --- a/direct/src/extensions_native/CInterval_extensions.py +++ b/direct/src/extensions_native/CInterval_extensions.py @@ -1,7 +1,8 @@ +from .core import Dtool_funcToMethod from direct.directnotify.DirectNotifyGlobal import directNotify -notify = directNotify.newCategory("Interval") -Dtool_ObjectToDict(CInterval,"notify", notify) -del notify + +CInterval.DtoolClassDict["notify"] = directNotify.newCategory("Interval") + ##################################################################### def setT(self, t): # Overridden from the C++ function to call privPostEvent @@ -10,7 +11,7 @@ def setT(self, t): self.setT_Old(t) self.privPostEvent() -Dtool_ObjectToDict(CInterval, "setT_Old", CInterval.setT) +CInterval.DtoolClassDict["setT_Old"] = CInterval.setT Dtool_funcToMethod(setT, CInterval) del setT ##################################################################### diff --git a/direct/src/extensions_native/NodePath_extensions.py b/direct/src/extensions_native/NodePath_extensions.py index 7b17dc34f6..33c530180c 100644 --- a/direct/src/extensions_native/NodePath_extensions.py +++ b/direct/src/extensions_native/NodePath_extensions.py @@ -10,22 +10,16 @@ of the NodePath class #################################################################### def id(self): - """Returns a unique id identifying the NodePath instance""" - print "Warning: NodePath.id() is deprecated. Use hash(NodePath) or NodePath.get_key() instead." + """Deprecated. Returns a unique id identifying the NodePath instance""" + print("Warning: NodePath.id() is deprecated. Use hash(NodePath) or NodePath.get_key() instead.") return self.getKey() Dtool_funcToMethod(id, NodePath) del id ##################################################################### - -## def __hash__(self): // inside c code -## return self.getKey() -##################################################################### - - # For iterating over children def getChildrenAsList(self): - """Converts a node path's child NodePathCollection into a list""" - print "Warning: NodePath.getChildrenAsList() is deprecated. Use get_children() instead." + """Deprecated. Converts a node path's child NodePathCollection into a list""" + print("Warning: NodePath.getChildrenAsList() is deprecated. Use get_children() instead.") return list(self.getChildren()) Dtool_funcToMethod(getChildrenAsList, NodePath) @@ -35,7 +29,7 @@ del getChildrenAsList def printChildren(self): """Prints out the children of the bottom node of a node path""" for child in self.getChildren(): - print child.getName() + print(child.getName()) Dtool_funcToMethod(printChildren, NodePath) del printChildren ##################################################################### @@ -95,8 +89,8 @@ del isolate ##################################################################### def remove(self): - """Remove a node path from the scene graph""" - print "Warning: NodePath.remove() is deprecated. Use remove_node() instead." + """Deprecated. Remove a node path from the scene graph""" + print("Warning: NodePath.remove() is deprecated. Use remove_node() instead.") # Send message in case anyone needs to do something # before node is deleted messenger.send('preRemoveNodePath', [self]) @@ -109,11 +103,11 @@ del remove def lsNames(self): """Walk down a tree and print out the path""" if self.isEmpty(): - print "(empty)" + print("(empty)") else: type = self.node().getType().getName() name = self.getName() - print type + " " + name + print(type + " " + name) self.lsNamesRecurse() Dtool_funcToMethod(lsNames, NodePath) @@ -124,7 +118,7 @@ def lsNamesRecurse(self, indentString=' '): for nodePath in self.getChildren(): type = nodePath.node().getType().getName() name = nodePath.getName() - print indentString + type + " " + name + print(indentString + type + " " + name) nodePath.lsNamesRecurse(indentString + " ") Dtool_funcToMethod(lsNamesRecurse, NodePath) @@ -138,7 +132,7 @@ def reverseLsNames(self): for nodePath in ancestry: type = nodePath.node().getType().getName() name = nodePath.getName() - print indentString + type + " " + name + print(indentString + type + " " + name) indentString = indentString + " " Dtool_funcToMethod(reverseLsNames, NodePath) @@ -146,7 +140,7 @@ del reverseLsNames ##################################################################### def getAncestry(self): """Get a list of a node path's ancestors""" - print "NodePath.getAncestry() is deprecated. Use get_ancestors() instead.""" + print("NodePath.getAncestry() is deprecated. Use get_ancestors() instead.""") ancestors = list(self.getAncestors()) ancestors.reverse() return ancestors @@ -197,11 +191,11 @@ def printPos(self, other = None, sd = 2): else: pos = self.getPos() otherString = '' - print (self.getName() + '.setPos(' + otherString + + print((self.getName() + '.setPos(' + otherString + formatString % pos[0] + ', ' + formatString % pos[1] + ', ' + formatString % pos[2] + - ')\n') + ')\n')) Dtool_funcToMethod(printPos, NodePath) del printPos ##################################################################### @@ -215,11 +209,11 @@ def printHpr(self, other = None, sd = 2): else: hpr = self.getHpr() otherString = '' - print (self.getName() + '.setHpr(' + otherString + + print((self.getName() + '.setHpr(' + otherString + formatString % hpr[0] + ', ' + formatString % hpr[1] + ', ' + formatString % hpr[2] + - ')\n') + ')\n')) Dtool_funcToMethod(printHpr, NodePath) del printHpr ##################################################################### @@ -233,11 +227,11 @@ def printScale(self, other = None, sd = 2): else: scale = self.getScale() otherString = '' - print (self.getName() + '.setScale(' + otherString + + print((self.getName() + '.setScale(' + otherString + formatString % scale[0] + ', ' + formatString % scale[1] + ', ' + formatString % scale[2] + - ')\n') + ')\n')) Dtool_funcToMethod(printScale, NodePath) del printScale @@ -253,14 +247,14 @@ def printPosHpr(self, other = None, sd = 2): pos = self.getPos() hpr = self.getHpr() otherString = '' - print (self.getName() + '.setPosHpr(' + otherString + + print((self.getName() + '.setPosHpr(' + otherString + formatString % pos[0] + ', ' + formatString % pos[1] + ', ' + formatString % pos[2] + ', ' + formatString % hpr[0] + ', ' + formatString % hpr[1] + ', ' + formatString % hpr[2] + - ')\n') + ')\n')) Dtool_funcToMethod(printPosHpr, NodePath) del printPosHpr @@ -278,7 +272,7 @@ def printPosHprScale(self, other = None, sd = 2): hpr = self.getHpr() scale = self.getScale() otherString = '' - print (self.getName() + '.setPosHprScale(' + otherString + + print((self.getName() + '.setPosHprScale(' + otherString + formatString % pos[0] + ', ' + formatString % pos[1] + ', ' + formatString % pos[2] + ', ' + @@ -288,14 +282,14 @@ def printPosHprScale(self, other = None, sd = 2): formatString % scale[0] + ', ' + formatString % scale[1] + ', ' + formatString % scale[2] + - ')\n') + ')\n')) Dtool_funcToMethod(printPosHprScale, NodePath) del printPosHprScale ##################################################################### def printTransform(self, other = None, sd = 2, fRecursive = 0): - from pandac.PandaModules import Vec3 + from panda3d.core import Vec3 fmtStr = '%%0.%df' % sd name = self.getName() if other == None: @@ -306,23 +300,23 @@ def printTransform(self, other = None, sd = 2, fRecursive = 0): pos = transform.getPos() if not pos.almostEqual(Vec3(0)): outputString = '%s.setPos(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr) - print outputString % (pos[0], pos[1], pos[2]) + print(outputString % (pos[0], pos[1], pos[2])) if transform.hasHpr(): hpr = transform.getHpr() if not hpr.almostEqual(Vec3(0)): outputString = '%s.setHpr(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr) - print outputString % (hpr[0], hpr[1], hpr[2]) + print(outputString % (hpr[0], hpr[1], hpr[2])) if transform.hasScale(): if transform.hasUniformScale(): scale = transform.getUniformScale() if scale != 1.0: outputString = '%s.setScale(%s)' % (name, fmtStr) - print outputString % scale + print(outputString % scale) else: scale = transform.getScale() if not scale.almostEqual(Vec3(1)): outputString = '%s.setScale(%s, %s, %s)' % (name, fmtStr, fmtStr, fmtStr) - print outputString % (scale[0], scale[1], scale[2]) + print(outputString % (scale[0], scale[1], scale[2])) if fRecursive: for child in self.getChildren(): child.printTransform(other, sd, fRecursive) @@ -383,700 +377,6 @@ def iPosHprScale(self, other = None): Dtool_funcToMethod(iPosHprScale, NodePath) del iPosHprScale ##################################################################### - -def __lerp(self, functorFunc, duration, blendType, taskName=None): - """ - __lerp(self, functorFunc, float, string, string) - Basic lerp functionality used by other lerps. - Fire off a lerp. Make it a task if taskName given. - """ - # functorFunc is a function which can be called to create a functor. - # functor creation is defered so initial state (sampled in functorFunc) - # will be appropriate for the time the lerp is spawned - from direct.task import Task - from direct.interval import LerpBlendHelpers - from direct.task.TaskManagerGlobal import taskMgr - - # make the task function - def lerpTaskFunc(task): - from pandac.PandaModules import Lerp - from pandac.PandaModules import ClockObject - from direct.task.Task import Task, cont, done - if task.init == 1: - # make the lerp - functor = task.functorFunc() - task.lerp = Lerp(functor, task.duration, task.blendType) - task.init = 0 - dt = globalClock.getDt() - task.lerp.setStepSize(dt) - task.lerp.step() - if (task.lerp.isDone()): - # Reset the init flag, in case the task gets re-used - task.init = 1 - return(done) - else: - return(cont) - - # make the lerp task - lerpTask = Task.Task(lerpTaskFunc) - lerpTask.init = 1 - lerpTask.functorFunc = functorFunc - lerpTask.duration = duration - lerpTask.blendType = LerpBlendHelpers.getBlend(blendType) - - if (taskName == None): - # don't spawn a task, return one instead - return lerpTask - else: - # spawn the lerp task - taskMgr.add(lerpTask, taskName) - return lerpTask - -Dtool_funcToMethod(__lerp, NodePath) -del __lerp -##################################################################### -def __autoLerp(self, functorFunc, time, blendType, taskName): - """_autoLerp(self, functor, float, string, string) - This lerp uses C++ to handle the stepping. Bonus is - its more efficient, trade-off is there is less control""" - from pandac.PandaModules import AutonomousLerp - from direct.interval import LerpBlendHelpers - # make a lerp that lives in C++ land - functor = functorFunc() - lerp = AutonomousLerp(functor, time, - LerpBlendHelpers.getBlend(blendType), - base.eventHandler) - lerp.start() - return lerp - -Dtool_funcToMethod(__autoLerp, NodePath) -del __autoLerp -##################################################################### - -# user callable lerp methods -def lerpColor(self, *posArgs, **keyArgs): - """lerpColor(self, *positionArgs, **keywordArgs) - determine which lerpColor* to call based on arguments - """ - if (len(posArgs) == 2): - return apply(self.lerpColorVBase4, posArgs, keyArgs) - elif (len(posArgs) == 3): - return apply(self.lerpColorVBase4VBase4, posArgs, keyArgs) - elif (len(posArgs) == 5): - return apply(self.lerpColorRGBA, posArgs, keyArgs) - elif (len(posArgs) == 9): - return apply(self.lerpColorRGBARGBA, posArgs, keyArgs) - else: - # bad args - raise Exception("Error: NodePath.lerpColor: bad number of args") - -Dtool_funcToMethod(lerpColor, NodePath) -del lerpColor -##################################################################### - -def lerpColorRGBA(self, r, g, b, a, time, - blendType="noBlend", auto=None, task=None): - """lerpColorRGBA(self, float, float, float, float, float, - string="noBlend", string=none, string=none) - """ - def functorFunc(self = self, r = r, g = g, b = b, a = a): - from pandac.PandaModules import ColorLerpFunctor - # just end rgba values, use current color rgba values for start - startColor = self.getColor() - functor = ColorLerpFunctor( - self, - startColor[0], startColor[1], - startColor[2], startColor[3], - r, g, b, a) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpColorRGBA, NodePath) -del lerpColorRGBA -##################################################################### -def lerpColorRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time, - blendType="noBlend", auto=None, task=None): - """lerpColorRGBARGBA(self, float, float, float, float, float, - float, float, float, float, string="noBlend", string=none, string=none) - """ - def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa, - er = er, eg = eg, eb = eb, ea = ea): - from pandac.PandaModules import ColorLerpFunctor - # start and end rgba values - functor = ColorLerpFunctor(self, sr, sg, sb, sa, - er, eg, eb, ea) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpColorRGBARGBA, NodePath) -del lerpColorRGBARGBA -##################################################################### -def lerpColorVBase4(self, endColor, time, - blendType="noBlend", auto=None, task=None): - """lerpColorVBase4(self, VBase4, float, string="noBlend", string=none, - string=none) - """ - def functorFunc(self = self, endColor = endColor): - from pandac.PandaModules import ColorLerpFunctor - # just end vec4, use current color for start - startColor = self.getColor() - functor = ColorLerpFunctor( - self, startColor, endColor) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpColorVBase4, NodePath) -del lerpColorVBase4 -##################################################################### -def lerpColorVBase4VBase4(self, startColor, endColor, time, - blendType="noBlend", auto=None, task=None): - """lerpColorVBase4VBase4(self, VBase4, VBase4, float, string="noBlend", - string=none, string=none) - """ - def functorFunc(self = self, startColor = startColor, - endColor = endColor): - from pandac.PandaModules import ColorLerpFunctor - # start color and end vec - functor = ColorLerpFunctor( - self, startColor, endColor) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - - - -Dtool_funcToMethod(lerpColorVBase4VBase4, NodePath) -del lerpColorVBase4VBase4 -##################################################################### - # user callable lerp methods -def lerpColorScale(self, *posArgs, **keyArgs): - """lerpColorScale(self, *positionArgs, **keywordArgs) - determine which lerpColorScale* to call based on arguments - """ - if (len(posArgs) == 2): - return apply(self.lerpColorScaleVBase4, posArgs, keyArgs) - elif (len(posArgs) == 3): - return apply(self.lerpColorScaleVBase4VBase4, posArgs, keyArgs) - elif (len(posArgs) == 5): - return apply(self.lerpColorScaleRGBA, posArgs, keyArgs) - elif (len(posArgs) == 9): - return apply(self.lerpColorScaleRGBARGBA, posArgs, keyArgs) - else: - # bad args - raise Exception("Error: NodePath.lerpColorScale: bad number of args") - - -Dtool_funcToMethod(lerpColorScale, NodePath) -del lerpColorScale -##################################################################### -def lerpColorScaleRGBA(self, r, g, b, a, time, - blendType="noBlend", auto=None, task=None): - """lerpColorScaleRGBA(self, float, float, float, float, float, - string="noBlend", string=none, string=none) - """ - def functorFunc(self = self, r = r, g = g, b = b, a = a): - from pandac.PandaModules import ColorScaleLerpFunctor - # just end rgba values, use current color rgba values for start - startColor = self.getColor() - functor = ColorScaleLerpFunctor( - self, - startColor[0], startColor[1], - startColor[2], startColor[3], - r, g, b, a) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpColorScaleRGBA, NodePath) -del lerpColorScaleRGBA -##################################################################### -def lerpColorScaleRGBARGBA(self, sr, sg, sb, sa, er, eg, eb, ea, time, - blendType="noBlend", auto=None, task=None): - """lerpColorScaleRGBARGBA(self, float, float, float, float, float, - float, float, float, float, string="noBlend", string=none, string=none) - """ - def functorFunc(self = self, sr = sr, sg = sg, sb = sb, sa = sa, - er = er, eg = eg, eb = eb, ea = ea): - from pandac.PandaModules import ColorScaleLerpFunctor - # start and end rgba values - functor = ColorScaleLerpFunctor(self, sr, sg, sb, sa, - er, eg, eb, ea) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpColorScaleRGBARGBA, NodePath) -del lerpColorScaleRGBARGBA -##################################################################### -def lerpColorScaleVBase4(self, endColor, time, - blendType="noBlend", auto=None, task=None): - """lerpColorScaleVBase4(self, VBase4, float, string="noBlend", string=none, - string=none) - """ - def functorFunc(self = self, endColor = endColor): - from pandac.PandaModules import ColorScaleLerpFunctor - # just end vec4, use current color for start - startColor = self.getColor() - functor = ColorScaleLerpFunctor( - self, startColor, endColor) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpColorScaleVBase4, NodePath) -del lerpColorScaleVBase4 -##################################################################### -def lerpColorScaleVBase4VBase4(self, startColor, endColor, time, - blendType="noBlend", auto=None, task=None): - """lerpColorScaleVBase4VBase4(self, VBase4, VBase4, float, string="noBlend", - string=none, string=none) - """ - def functorFunc(self = self, startColor = startColor, - endColor = endColor): - from pandac.PandaModules import ColorScaleLerpFunctor - # start color and end vec - functor = ColorScaleLerpFunctor( - self, startColor, endColor) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - - - -Dtool_funcToMethod(lerpColorScaleVBase4VBase4, NodePath) -del lerpColorScaleVBase4VBase4 -##################################################################### -def lerpHpr(self, *posArgs, **keyArgs): - """lerpHpr(self, *positionArgs, **keywordArgs) - Determine whether to call lerpHprHPR or lerpHprVBase3 - based on first argument - """ - # check to see if lerping with - # three floats or a VBase3 - if (len(posArgs) == 4): - return apply(self.lerpHprHPR, posArgs, keyArgs) - elif(len(posArgs) == 2): - return apply(self.lerpHprVBase3, posArgs, keyArgs) - else: - # bad args - raise Exception("Error: NodePath.lerpHpr: bad number of args") - -Dtool_funcToMethod(lerpHpr, NodePath) -del lerpHpr -##################################################################### -def lerpHprHPR(self, h, p, r, time, other=None, - blendType="noBlend", auto=None, task=None, shortest=1): - """lerpHprHPR(self, float, float, float, float, string="noBlend", - string=none, string=none, NodePath=none) - Perform a hpr lerp with three floats as the end point - """ - def functorFunc(self = self, h = h, p = p, r = r, - other = other, shortest=shortest): - from pandac.PandaModules import HprLerpFunctor - # it's individual hpr components - if (other != None): - # lerp wrt other - startHpr = self.getHpr(other) - functor = HprLerpFunctor( - self, - startHpr[0], startHpr[1], startHpr[2], - h, p, r, other) - if shortest: - functor.takeShortest() - else: - startHpr = self.getHpr() - functor = HprLerpFunctor( - self, - startHpr[0], startHpr[1], startHpr[2], - h, p, r) - if shortest: - functor.takeShortest() - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpHprHPR, NodePath) -del lerpHprHPR -##################################################################### -def lerpHprVBase3(self, hpr, time, other=None, - blendType="noBlend", auto=None, task=None, shortest=1): - """lerpHprVBase3(self, VBase3, float, string="noBlend", string=none, - string=none, NodePath=None) - Perform a hpr lerp with a VBase3 as the end point - """ - def functorFunc(self = self, hpr = hpr, - other = other, shortest=shortest): - from pandac.PandaModules import HprLerpFunctor - # it's a vbase3 hpr - if (other != None): - # lerp wrt other - functor = HprLerpFunctor( - self, (self.getHpr(other)), hpr, other) - if shortest: - functor.takeShortest() - else: - functor = HprLerpFunctor( - self, (self.getHpr()), hpr) - if shortest: - functor.takeShortest() - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - - -Dtool_funcToMethod(lerpHprVBase3, NodePath) -del lerpHprVBase3 -##################################################################### -def lerpPos(self, *posArgs, **keyArgs): - """lerpPos(self, *positionArgs, **keywordArgs) - Determine whether to call lerpPosXYZ or lerpPosPoint3 - based on the first argument - """ - # check to see if lerping with three - # floats or a Point3 - if (len(posArgs) == 4): - return apply(self.lerpPosXYZ, posArgs, keyArgs) - elif(len(posArgs) == 2): - return apply(self.lerpPosPoint3, posArgs, keyArgs) - else: - # bad number off args - raise Exception("Error: NodePath.lerpPos: bad number of args") - -Dtool_funcToMethod(lerpPos, NodePath) -del lerpPos -##################################################################### -def lerpPosXYZ(self, x, y, z, time, other=None, - blendType="noBlend", auto=None, task=None): - """lerpPosXYZ(self, float, float, float, float, string="noBlend", - string=None, NodePath=None) - Perform a pos lerp with three floats as the end point - """ - def functorFunc(self = self, x = x, y = y, z = z, other = other): - from pandac.PandaModules import PosLerpFunctor - if (other != None): - # lerp wrt other - startPos = self.getPos(other) - functor = PosLerpFunctor(self, - startPos[0], startPos[1], startPos[2], - x, y, z, other) - else: - startPos = self.getPos() - functor = PosLerpFunctor(self, startPos[0], - startPos[1], startPos[2], x, y, z) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpPosXYZ, NodePath) -del lerpPosXYZ -##################################################################### -def lerpPosPoint3(self, pos, time, other=None, - blendType="noBlend", auto=None, task=None): - """lerpPosPoint3(self, Point3, float, string="noBlend", string=None, - string=None, NodePath=None) - Perform a pos lerp with a Point3 as the end point - """ - def functorFunc(self = self, pos = pos, other = other): - from pandac.PandaModules import PosLerpFunctor - if (other != None): - #lerp wrt other - functor = PosLerpFunctor( - self, (self.getPos(other)), pos, other) - else: - functor = PosLerpFunctor( - self, (self.getPos()), pos) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - - -Dtool_funcToMethod(lerpPosPoint3, NodePath) -del lerpPosPoint3 -##################################################################### -def lerpPosHpr(self, *posArgs, **keyArgs): - """lerpPosHpr(self, *positionArgs, **keywordArgs) - Determine whether to call lerpPosHprXYZHPR or lerpHprPoint3VBase3 - based on first argument - """ - # check to see if lerping with - # six floats or a Point3 and a VBase3 - if (len(posArgs) == 7): - return apply(self.lerpPosHprXYZHPR, posArgs, keyArgs) - elif(len(posArgs) == 3): - return apply(self.lerpPosHprPoint3VBase3, posArgs, keyArgs) - else: - # bad number off args - raise Exception("Error: NodePath.lerpPosHpr: bad number of args") - -Dtool_funcToMethod(lerpPosHpr, NodePath) -del lerpPosHpr -##################################################################### -def lerpPosHprPoint3VBase3(self, pos, hpr, time, other=None, - blendType="noBlend", auto=None, task=None, shortest=1): - """lerpPosHprPoint3VBase3(self, Point3, VBase3, string="noBlend", - string=none, string=none, NodePath=None) - """ - def functorFunc(self = self, pos = pos, hpr = hpr, - other = other, shortest=shortest): - from pandac.PandaModules import PosHprLerpFunctor - if (other != None): - # lerp wrt other - startPos = self.getPos(other) - startHpr = self.getHpr(other) - functor = PosHprLerpFunctor( - self, startPos, pos, - startHpr, hpr, other) - if shortest: - functor.takeShortest() - else: - startPos = self.getPos() - startHpr = self.getHpr() - functor = PosHprLerpFunctor( - self, startPos, pos, - startHpr, hpr) - if shortest: - functor.takeShortest() - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpPosHprPoint3VBase3, NodePath) -del lerpPosHprPoint3VBase3 -##################################################################### -def lerpPosHprXYZHPR(self, x, y, z, h, p, r, time, other=None, - blendType="noBlend", auto=None, task=None, shortest=1): - """lerpPosHpr(self, float, string="noBlend", string=none, - string=none, NodePath=None) - """ - def functorFunc(self = self, x = x, y = y, z = z, - h = h, p = p, r = r, other = other, shortest=shortest): - from pandac.PandaModules import PosHprLerpFunctor - if (other != None): - # lerp wrt other - startPos = self.getPos(other) - startHpr = self.getHpr(other) - functor = PosHprLerpFunctor(self, - startPos[0], startPos[1], - startPos[2], x, y, z, - startHpr[0], startHpr[1], - startHpr[2], h, p, r, - other) - if shortest: - functor.takeShortest() - else: - startPos = self.getPos() - startHpr = self.getHpr() - functor = PosHprLerpFunctor(self, - startPos[0], startPos[1], - startPos[2], x, y, z, - startHpr[0], startHpr[1], - startHpr[2], h, p, r) - if shortest: - functor.takeShortest() - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - - -Dtool_funcToMethod(lerpPosHprXYZHPR, NodePath) -del lerpPosHprXYZHPR -##################################################################### -def lerpPosHprScale(self, pos, hpr, scale, time, other=None, - blendType="noBlend", auto=None, task=None, shortest=1): - """lerpPosHpr(self, Point3, VBase3, float, float, string="noBlend", - string=none, string=none, NodePath=None) - Only one case, no need for extra args. Call the appropriate lerp - (auto, spawned, or blocking) based on how(if) a task name is given - """ - def functorFunc(self = self, pos = pos, hpr = hpr, - scale = scale, other = other, shortest=shortest): - from pandac.PandaModules import PosHprScaleLerpFunctor - if (other != None): - # lerp wrt other - startPos = self.getPos(other) - startHpr = self.getHpr(other) - startScale = self.getScale(other) - functor = PosHprScaleLerpFunctor(self, - startPos, pos, - startHpr, hpr, - startScale, scale, other) - if shortest: - functor.takeShortest() - else: - startPos = self.getPos() - startHpr = self.getHpr() - startScale = self.getScale() - functor = PosHprScaleLerpFunctor(self, - startPos, pos, - startHpr, hpr, - startScale, scale) - if shortest: - functor.takeShortest() - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - - -Dtool_funcToMethod(lerpPosHprScale, NodePath) -del lerpPosHprScale -##################################################################### -def lerpScale(self, *posArgs, **keyArgs): - """lerpSclae(self, *positionArgs, **keywordArgs) - Determine whether to call lerpScaleXYZ or lerpScaleaseV3 - based on the first argument - """ - # check to see if lerping with three - # floats or a Point3 - if (len(posArgs) == 4): - return apply(self.lerpScaleXYZ, posArgs, keyArgs) - elif(len(posArgs) == 2): - return apply(self.lerpScaleVBase3, posArgs, keyArgs) - else: - # bad number off args - raise Exception("Error: NodePath.lerpScale: bad number of args") - -Dtool_funcToMethod(lerpScale, NodePath) -del lerpScale -##################################################################### -def lerpScaleVBase3(self, scale, time, other=None, - blendType="noBlend", auto=None, task=None): - """lerpPos(self, VBase3, float, string="noBlend", string=none, - string=none, NodePath=None) - """ - def functorFunc(self = self, scale = scale, other = other): - from pandac.PandaModules import ScaleLerpFunctor - if (other != None): - # lerp wrt other - functor = ScaleLerpFunctor(self, - (self.getScale(other)), - scale, other) - else: - functor = ScaleLerpFunctor(self, - (self.getScale()), scale) - - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - -Dtool_funcToMethod(lerpScaleVBase3, NodePath) -del lerpScaleVBase3 -##################################################################### -def lerpScaleXYZ(self, sx, sy, sz, time, other=None, - blendType="noBlend", auto=None, task=None): - """lerpPos(self, float, float, float, float, string="noBlend", - string=none, string=none, NodePath=None) - """ - def functorFunc(self = self, sx = sx, sy = sy, sz = sz, other = other): - from pandac.PandaModules import ScaleLerpFunctor - if (other != None): - # lerp wrt other - startScale = self.getScale(other) - functor = ScaleLerpFunctor(self, - startScale[0], startScale[1], - startScale[2], sx, sy, sz, other) - else: - startScale = self.getScale() - functor = ScaleLerpFunctor(self, - startScale[0], startScale[1], - startScale[2], sx, sy, sz) - return functor - #determine whether to use auto, spawned, or blocking lerp - if (auto != None): - return self.__autoLerp(functorFunc, time, blendType, auto) - elif (task != None): - return self.__lerp(functorFunc, time, blendType, task) - else: - return self.__lerp(functorFunc, time, blendType) - - - - -Dtool_funcToMethod(lerpScaleXYZ, NodePath) -del lerpScaleXYZ -##################################################################### def place(self): base.startDirect(fWantTk = 1) from direct.tkpanels import Placer @@ -1253,8 +553,8 @@ Dtool_funcToMethod(colorScaleInterval, NodePath) del colorScaleInterval ##################################################################### def attachCollisionSphere(self, name, cx, cy, cz, r, fromCollide, intoCollide): - from pandac.PandaModules import CollisionSphere - from pandac.PandaModules import CollisionNode + from panda3d.core import CollisionSphere + from panda3d.core import CollisionNode coll = CollisionSphere(cx, cy, cz, r) collNode = CollisionNode(name) collNode.addSolid(coll) @@ -1267,8 +567,8 @@ Dtool_funcToMethod(attachCollisionSphere, NodePath) del attachCollisionSphere ##################################################################### def attachCollisionSegment(self, name, ax, ay, az, bx, by, bz, fromCollide, intoCollide): - from pandac.PandaModules import CollisionSegment - from pandac.PandaModules import CollisionNode + from panda3d.core import CollisionSegment + from panda3d.core import CollisionNode coll = CollisionSegment(ax, ay, az, bx, by, bz) collNode = CollisionNode(name) collNode.addSolid(coll) @@ -1281,8 +581,8 @@ Dtool_funcToMethod(attachCollisionSegment, NodePath) del attachCollisionSegment ##################################################################### def attachCollisionRay(self, name, ox, oy, oz, dx, dy, dz, fromCollide, intoCollide): - from pandac.PandaModules import CollisionRay - from pandac.PandaModules import CollisionNode + from panda3d.core import CollisionRay + from panda3d.core import CollisionNode coll = CollisionRay(ox, oy, oz, dx, dy, dz) collNode = CollisionNode(name) collNode.addSolid(coll) @@ -1296,7 +596,7 @@ del attachCollisionRay ##################################################################### def flattenMultitex(self, stateFrom = None, target = None, useGeom = 0, allowTexMat = 0, win = None): - from pandac.PandaModules import MultitexReducer + from panda3d.core import MultitexReducer mr = MultitexReducer() if target != None: mr.setTarget(target) @@ -1466,26 +766,31 @@ del r_constructCollisionTree ##################################################################### def analyze(self): - from pandac.PandaModules import SceneGraphAnalyzer + """ + Analyzes the geometry below this node and reports the + number of vertices, triangles, etc. This is the same + information reported by the bam-info program. + """ + from panda3d.core import SceneGraphAnalyzer sga = SceneGraphAnalyzer() sga.addNode(self.node()) if sga.getNumLodNodes() == 0: - print sga + print(sga) else: - print "At highest LOD:" + print("At highest LOD:") sga2 = SceneGraphAnalyzer() sga2.setLodMode(sga2.LMHighest) sga2.addNode(self.node()) - print sga2 + print(sga2) - print "\nAt lowest LOD:" + print("\nAt lowest LOD:") sga2.clear() sga2.setLodMode(sga2.LMLowest) sga2.addNode(self.node()) - print sga2 + print(sga2) - print "\nAll nodes:" - print sga + print("\nAll nodes:") + print(sga) Dtool_funcToMethod(analyze, NodePath) del analyze diff --git a/direct/src/extensions_native/VBase3_extensions.py b/direct/src/extensions_native/VBase3_extensions.py index 331bafdd4e..29fbb3dc00 100755 --- a/direct/src/extensions_native/VBase3_extensions.py +++ b/direct/src/extensions_native/VBase3_extensions.py @@ -14,7 +14,7 @@ def asTuple(self): """ Returns the vector as a tuple. """ - print "Warning: VBase3.asTuple() is no longer needed and deprecated. Use the vector directly instead." + print("Warning: VBase3.asTuple() is no longer needed and deprecated. Use the vector directly instead.") return tuple(self) Dtool_funcToMethod(asTuple, VBase3) del asTuple diff --git a/direct/src/extensions_native/VBase4_extensions.py b/direct/src/extensions_native/VBase4_extensions.py index 8b7c022593..cf5c790e51 100755 --- a/direct/src/extensions_native/VBase4_extensions.py +++ b/direct/src/extensions_native/VBase4_extensions.py @@ -14,7 +14,7 @@ def asTuple(self): """ Returns the vector as a tuple. """ - print "Warning: VBase4.asTuple() is no longer needed and deprecated. Use the vector directly instead." + print("Warning: VBase4.asTuple() is no longer needed and deprecated. Use the vector directly instead.") return tuple(self) Dtool_funcToMethod(asTuple, VBase4) diff --git a/direct/src/ffi/DoGenPyCode.py b/direct/src/ffi/DoGenPyCode.py index 5bb7cb56e7..9bfb627ab1 100644 --- a/direct/src/ffi/DoGenPyCode.py +++ b/direct/src/ffi/DoGenPyCode.py @@ -5,8 +5,6 @@ the user to specify alternate parameters on the command line. """ import getopt import sys import os -import glob -import types import time from direct.ffi import FFIConstants @@ -224,7 +222,7 @@ def doErrorCheck(): FFIConstants.CodeModuleNameList = codeLibs def generateNativeWrappers(): - from direct.extensions_native.extension_native_helpers import Dtool_FindModule, Dtool_PreloadDLL + from direct.extensions_native.extension_native_helpers import Dtool_PreloadDLL # Empty out the output directories of unnecessary crud from # previous runs before we begin. @@ -337,7 +335,7 @@ def run(): if doHTML: from direct.directscripts import gendocs - from pandac.PandaModules import PandaSystem + from panda3d.core import PandaSystem versionString = '%s %s' % ( PandaSystem.getDistributor(), PandaSystem.getVersionString()) diff --git a/direct/src/ffi/FFITypes.py b/direct/src/ffi/FFITypes.py index 8669d2ec85..da20acb499 100644 --- a/direct/src/ffi/FFITypes.py +++ b/direct/src/ffi/FFITypes.py @@ -8,7 +8,6 @@ They get constructed by and stored in FFIInterrogateDatabase. """ -import sys import os import string import FFIConstants diff --git a/direct/src/ffi/jGenPyCode.py b/direct/src/ffi/jGenPyCode.py index cc7440bd42..3c8ee77bee 100755 --- a/direct/src/ffi/jGenPyCode.py +++ b/direct/src/ffi/jGenPyCode.py @@ -72,7 +72,6 @@ if (EXTENSIONS is None): ############################################################## from direct.ffi import DoGenPyCode -from direct.ffi import FFIConstants DoGenPyCode.outputCodeDir = PANDAC DoGenPyCode.outputHTMLDir = os.path.join(PANDAC,"..","doc") DoGenPyCode.directDir = DIRECT diff --git a/direct/src/filter/CommonFilters.py b/direct/src/filter/CommonFilters.py index 42b06d740b..a6f9e43520 100644 --- a/direct/src/filter/CommonFilters.py +++ b/direct/src/filter/CommonFilters.py @@ -19,8 +19,8 @@ from FilterManager import FilterManager from panda3d.core import LVecBase4, LPoint2 from panda3d.core import Filename from panda3d.core import AuxBitplaneAttrib -from panda3d.core import RenderState, Texture, Shader, ATSNone -import sys,os +from panda3d.core import Texture, Shader, ATSNone +import os CARTOON_BODY=""" float4 cartoondelta = k_cartoonseparation * texpix_txaux.xwyw; diff --git a/direct/src/filter/FilterManager.py b/direct/src/filter/FilterManager.py index c03afe4bc0..432ae6fe93 100644 --- a/direct/src/filter/FilterManager.py +++ b/direct/src/filter/FilterManager.py @@ -14,13 +14,12 @@ Still need to implement: """ -from panda3d.core import NodePath, PandaNode -from panda3d.core import RenderState, Texture, Shader +from panda3d.core import NodePath +from panda3d.core import Texture from panda3d.core import CardMaker -from panda3d.core import TextureStage from panda3d.core import GraphicsPipe, GraphicsOutput from panda3d.core import WindowProperties, FrameBufferProperties -from panda3d.core import Camera, DisplayRegion +from panda3d.core import Camera from panda3d.core import OrthographicLens from panda3d.core import AuxBitplaneAttrib from direct.directnotify.DirectNotifyGlobal import * diff --git a/direct/src/fsm/FourState.py b/direct/src/fsm/FourState.py index 6f42046cef..52c9549d85 100755 --- a/direct/src/fsm/FourState.py +++ b/direct/src/fsm/FourState.py @@ -8,7 +8,6 @@ from direct.directnotify import DirectNotifyGlobal #import DistributedObject import ClassicFSM import State -from direct.task import Task class FourState: diff --git a/direct/src/fsm/SampleFSM.py b/direct/src/fsm/SampleFSM.py index e12c847a4b..ba2c1de138 100644 --- a/direct/src/fsm/SampleFSM.py +++ b/direct/src/fsm/SampleFSM.py @@ -3,7 +3,6 @@ __all__ = ['ClassicStyle', 'NewStyle', 'ToonEyes'] import FSM -from pandac.PandaModules import * from direct.task import Task import string diff --git a/direct/src/fsm/State.py b/direct/src/fsm/State.py index 0af9f45851..75e8269f11 100644 --- a/direct/src/fsm/State.py +++ b/direct/src/fsm/State.py @@ -4,7 +4,6 @@ __all__ = ['State'] from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.DirectObject import DirectObject -import types class State(DirectObject): diff --git a/direct/src/fsm/StatePush.py b/direct/src/fsm/StatePush.py index 49a6667fbb..10820b175b 100755 --- a/direct/src/fsm/StatePush.py +++ b/direct/src/fsm/StatePush.py @@ -5,7 +5,7 @@ __all__ = ['StateVar', 'FunctionCall', 'EnterExit', 'Pulse', 'EventPulse', 'EventArgument', ] from direct.showbase.DirectObject import DirectObject -import types + class PushesStateChanges: # base class for objects that broadcast state changes to a set of subscriber objects diff --git a/direct/src/gui/DirectButton.py b/direct/src/gui/DirectButton.py index 110b4e5a38..a40dfda94b 100644 --- a/direct/src/gui/DirectButton.py +++ b/direct/src/gui/DirectButton.py @@ -2,7 +2,7 @@ __all__ = ['DirectButton'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * diff --git a/direct/src/gui/DirectCheckBox.py b/direct/src/gui/DirectCheckBox.py index cf2a371fec..6091f8bc31 100755 --- a/direct/src/gui/DirectCheckBox.py +++ b/direct/src/gui/DirectCheckBox.py @@ -1,5 +1,5 @@ from direct.gui.DirectGui import * -from pandac.PandaModules import * +from panda3d.core import * class DirectCheckBox(DirectButton): diff --git a/direct/src/gui/DirectCheckButton.py b/direct/src/gui/DirectCheckButton.py index 77244b185f..5212031600 100644 --- a/direct/src/gui/DirectCheckButton.py +++ b/direct/src/gui/DirectCheckButton.py @@ -2,8 +2,7 @@ __all__ = ['DirectCheckButton'] -from pandac.PandaModules import * -import DirectGuiGlobals as DGG +from panda3d.core import * from DirectButton import * from DirectLabel import * diff --git a/direct/src/gui/DirectDialog.py b/direct/src/gui/DirectDialog.py index 44cb182ab0..1aa75332d0 100644 --- a/direct/src/gui/DirectDialog.py +++ b/direct/src/gui/DirectDialog.py @@ -2,7 +2,7 @@ __all__ = ['findDialog', 'cleanupDialog', 'DirectDialog', 'OkDialog', 'OkCancelDialog', 'YesNoDialog', 'YesNoCancelDialog', 'RetryCancelDialog'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * from DirectButton import * diff --git a/direct/src/gui/DirectEntry.py b/direct/src/gui/DirectEntry.py index e2b306af06..5fa8920328 100644 --- a/direct/src/gui/DirectEntry.py +++ b/direct/src/gui/DirectEntry.py @@ -2,7 +2,7 @@ __all__ = ['DirectEntry'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * from OnscreenText import OnscreenText diff --git a/direct/src/gui/DirectEntryScroll.py b/direct/src/gui/DirectEntryScroll.py index bf829bed63..7341671d6a 100644 --- a/direct/src/gui/DirectEntryScroll.py +++ b/direct/src/gui/DirectEntryScroll.py @@ -1,6 +1,6 @@ __all__ = ['DirectEntryScroll'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectScrolledFrame import * from DirectFrame import * @@ -114,6 +114,4 @@ class DirectEntryScroll(DirectFrame): def resetCanvas(self): self.canvas.setPos(0,0,0) - - - \ No newline at end of file + diff --git a/direct/src/gui/DirectFrame.py b/direct/src/gui/DirectFrame.py index 4603f9356c..ed67b84c25 100644 --- a/direct/src/gui/DirectFrame.py +++ b/direct/src/gui/DirectFrame.py @@ -2,12 +2,12 @@ __all__ = ['DirectFrame'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectGuiBase import * from OnscreenImage import OnscreenImage from OnscreenGeom import OnscreenGeom -import string, types +import types class DirectFrame(DirectGuiWidget): DefDynGroups = ('text', 'geom', 'image') diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index 2d8c8241e7..11af7ec844 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -3,7 +3,7 @@ __all__ = ['DirectGuiBase', 'DirectGuiWidget'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from OnscreenText import * from OnscreenGeom import * @@ -11,9 +11,7 @@ from OnscreenImage import * from direct.directtools.DirectUtil import ROUND_TO from direct.showbase import DirectObject from direct.task import Task -from direct.showbase import ShowBase from direct.showbase.PythonUtil import recordCreationStackStr -from pandac.PandaModules import PStatCollector import types guiObjectCollector = PStatCollector("Client::GuiObjects") @@ -1069,8 +1067,8 @@ class DirectGuiWidget(DirectGuiBase, NodePath): def printConfig(self, indent = 0): space = ' ' * indent print space + self.guiId, '-', self.__class__.__name__ - print space + 'Pos: ' + self.getPos().pPrintValues() - print space + 'Scale: ' + self.getScale().pPrintValues() + print space + 'Pos: %s' % tuple(self.getPos()) + print space + 'Scale: %s' % tuple(self.getScale()) # Print out children info for child in self.getChildren(): messenger.send(DGG.PRINT + child.getName(), [indent + 2]) diff --git a/direct/src/gui/DirectGuiGlobals.py b/direct/src/gui/DirectGuiGlobals.py index 167d2a99b4..0602f9cfc0 100644 --- a/direct/src/gui/DirectGuiGlobals.py +++ b/direct/src/gui/DirectGuiGlobals.py @@ -7,7 +7,7 @@ __all__ = [] Global definitions used by Direct Gui Classes and handy constants that can be used during widget construction """ -from pandac.PandaModules import * +from panda3d.core import * defaultFont = None defaultFontFunc = TextNode.getDefaultFont diff --git a/direct/src/gui/DirectGuiTest.py b/direct/src/gui/DirectGuiTest.py index 2b076eed00..46edc3dd09 100644 --- a/direct/src/gui/DirectGuiTest.py +++ b/direct/src/gui/DirectGuiTest.py @@ -4,11 +4,13 @@ __all__ = [] if __name__ == "__main__": - from direct.directbase import DirectStart + from direct.showbase.ShowBase import ShowBase from DirectGui import * #from whrandom import * from random import * + base = ShowBase() + # EXAMPLE CODE # Load a model smiley = loader.loadModel('models/misc/smiley') diff --git a/direct/src/gui/DirectLabel.py b/direct/src/gui/DirectLabel.py index babd6d53c4..1728fdcb13 100644 --- a/direct/src/gui/DirectLabel.py +++ b/direct/src/gui/DirectLabel.py @@ -2,8 +2,7 @@ __all__ = ['DirectLabel'] -from pandac.PandaModules import * -import DirectGuiGlobals as DGG +from panda3d.core import * from DirectFrame import * class DirectLabel(DirectFrame): diff --git a/direct/src/gui/DirectOptionMenu.py b/direct/src/gui/DirectOptionMenu.py index b37436b5c7..bd2e45fffc 100644 --- a/direct/src/gui/DirectOptionMenu.py +++ b/direct/src/gui/DirectOptionMenu.py @@ -4,7 +4,7 @@ __all__ = ['DirectOptionMenu'] import types -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectButton import * from DirectLabel import * diff --git a/direct/src/gui/DirectRadioButton.py b/direct/src/gui/DirectRadioButton.py index c2cb423f0d..775ccf5648 100755 --- a/direct/src/gui/DirectRadioButton.py +++ b/direct/src/gui/DirectRadioButton.py @@ -2,7 +2,7 @@ __all__ = ['DirectRadioButton'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectButton import * from DirectLabel import * diff --git a/direct/src/gui/DirectScrollBar.py b/direct/src/gui/DirectScrollBar.py index f69896568b..a2a6f70ab2 100644 --- a/direct/src/gui/DirectScrollBar.py +++ b/direct/src/gui/DirectScrollBar.py @@ -2,7 +2,7 @@ __all__ = ['DirectScrollBar'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * from DirectButton import * diff --git a/direct/src/gui/DirectScrolledFrame.py b/direct/src/gui/DirectScrolledFrame.py index e3efa164c7..325582ef52 100644 --- a/direct/src/gui/DirectScrolledFrame.py +++ b/direct/src/gui/DirectScrolledFrame.py @@ -2,7 +2,7 @@ __all__ = ['DirectScrolledFrame'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * from DirectScrollBar import * diff --git a/direct/src/gui/DirectScrolledList.py b/direct/src/gui/DirectScrolledList.py index aa0293ae5e..d2ac37dfef 100644 --- a/direct/src/gui/DirectScrolledList.py +++ b/direct/src/gui/DirectScrolledList.py @@ -2,13 +2,13 @@ __all__ = ['DirectScrolledListItem', 'DirectScrolledList'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from direct.directnotify import DirectNotifyGlobal from direct.task.Task import Task from DirectFrame import * from DirectButton import * -import string, types +import types class DirectScrolledListItem(DirectButton): diff --git a/direct/src/gui/DirectSlider.py b/direct/src/gui/DirectSlider.py index d2066c3b68..40737e6c9f 100644 --- a/direct/src/gui/DirectSlider.py +++ b/direct/src/gui/DirectSlider.py @@ -2,7 +2,7 @@ __all__ = ['DirectSlider'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * from DirectButton import * diff --git a/direct/src/gui/DirectWaitBar.py b/direct/src/gui/DirectWaitBar.py index c1e7bee0c9..2fe9567941 100644 --- a/direct/src/gui/DirectWaitBar.py +++ b/direct/src/gui/DirectWaitBar.py @@ -2,7 +2,7 @@ __all__ = ['DirectWaitBar'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * import types diff --git a/direct/src/gui/OnscreenGeom.py b/direct/src/gui/OnscreenGeom.py index d9ef571aa6..faf020a2d1 100644 --- a/direct/src/gui/OnscreenGeom.py +++ b/direct/src/gui/OnscreenGeom.py @@ -2,10 +2,9 @@ __all__ = ['OnscreenGeom'] -from pandac.PandaModules import * -import DirectGuiGlobals as DGG +from panda3d.core import * from direct.showbase.DirectObject import DirectObject -import string,types +import types class OnscreenGeom(DirectObject, NodePath): def __init__(self, geom = None, diff --git a/direct/src/gui/OnscreenImage.py b/direct/src/gui/OnscreenImage.py index 50923eec19..7f4579886d 100644 --- a/direct/src/gui/OnscreenImage.py +++ b/direct/src/gui/OnscreenImage.py @@ -2,10 +2,9 @@ __all__ = ['OnscreenImage'] -from pandac.PandaModules import * -import DirectGuiGlobals as DGG +from panda3d.core import * from direct.showbase.DirectObject import DirectObject -import string,types +import types class OnscreenImage(DirectObject, NodePath): def __init__(self, image = None, diff --git a/direct/src/gui/OnscreenText.py b/direct/src/gui/OnscreenText.py index ed212d2643..9e0f2cb18b 100644 --- a/direct/src/gui/OnscreenText.py +++ b/direct/src/gui/OnscreenText.py @@ -2,10 +2,10 @@ __all__ = ['OnscreenText', 'Plain', 'ScreenTitle', 'ScreenPrompt', 'NameConfirm', 'BlackOnWhite'] -from pandac.PandaModules import * +from panda3d.core import * import DirectGuiGlobals as DGG from direct.showbase.DirectObject import DirectObject -import string,types +import types ## These are the styles of text we might commonly see. They set the ## overall appearance of the text according to one of a number of diff --git a/direct/src/interval/ActorInterval.py b/direct/src/interval/ActorInterval.py index 98e82bc605..2e884fcc15 100644 --- a/direct/src/interval/ActorInterval.py +++ b/direct/src/interval/ActorInterval.py @@ -2,7 +2,8 @@ __all__ = ['ActorInterval', 'LerpAnimInterval'] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * import Interval import math diff --git a/direct/src/interval/AnimControlInterval.py b/direct/src/interval/AnimControlInterval.py index 3e1d1259d1..bd2acc17ff 100755 --- a/direct/src/interval/AnimControlInterval.py +++ b/direct/src/interval/AnimControlInterval.py @@ -2,7 +2,8 @@ __all__ = ['AnimControlInterval'] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * import Interval import math diff --git a/direct/src/interval/FunctionInterval.py b/direct/src/interval/FunctionInterval.py index fd46bad994..815fd8b090 100644 --- a/direct/src/interval/FunctionInterval.py +++ b/direct/src/interval/FunctionInterval.py @@ -2,11 +2,11 @@ __all__ = ['FunctionInterval', 'EventInterval', 'AcceptInterval', 'IgnoreInterval', 'ParentInterval', 'WrtParentInterval', 'PosInterval', 'HprInterval', 'ScaleInterval', 'PosHprInterval', 'HprScaleInterval', 'PosHprScaleInterval', 'Func', 'Wait'] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.showbase.MessengerGlobal import * from direct.directnotify.DirectNotifyGlobal import directNotify import Interval -import types ############################################################# diff --git a/direct/src/interval/IndirectInterval.py b/direct/src/interval/IndirectInterval.py index 9039064d24..c435dbc76a 100644 --- a/direct/src/interval/IndirectInterval.py +++ b/direct/src/interval/IndirectInterval.py @@ -2,7 +2,8 @@ __all__ = ['IndirectInterval'] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * import Interval import LerpBlendHelpers diff --git a/direct/src/interval/Interval.py b/direct/src/interval/Interval.py index 0907c6d6a0..0ce940a261 100644 --- a/direct/src/interval/Interval.py +++ b/direct/src/interval/Interval.py @@ -4,10 +4,9 @@ __all__ = ['Interval'] from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.DirectObject import DirectObject -from pandac.PandaModules import * from direct.task.Task import Task, TaskManager -from direct.showbase import PythonUtil -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * import math class Interval(DirectObject): diff --git a/direct/src/interval/IntervalGlobal.py b/direct/src/interval/IntervalGlobal.py index ecc9abb6ad..d1589d268d 100644 --- a/direct/src/interval/IntervalGlobal.py +++ b/direct/src/interval/IntervalGlobal.py @@ -10,15 +10,17 @@ from FunctionInterval import * from LerpInterval import * from IndirectInterval import * from MopathInterval import * -import pandac.PandaModules -##Some people may have the particle system compiled out -if hasattr( pandac.PandaModules, 'ParticleSystem' ): - from ParticleInterval import * +try: + import panda3d.physics + ##Some people may have the particle system compiled out + if hasattr( panda3d.physics, 'ParticleSystem' ): + from ParticleInterval import * + if __debug__: + from TestInterval import * +except ImportError: + pass from SoundInterval import * from ProjectileInterval import * from MetaInterval import * from IntervalManager import * -if __debug__: - if hasattr( pandac.PandaModules, 'ParticleSystem' ): - from TestInterval import * -from pandac.PandaModules import WaitInterval +from panda3d.direct import WaitInterval diff --git a/direct/src/interval/IntervalManager.py b/direct/src/interval/IntervalManager.py index 95a0c754a9..3fa556f30c 100644 --- a/direct/src/interval/IntervalManager.py +++ b/direct/src/interval/IntervalManager.py @@ -2,12 +2,10 @@ __all__ = ['IntervalManager', 'ivalMgr'] -from pandac.PandaModules import * -from pandac import PandaModules +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * from direct.showbase import EventManager -import Interval -import types import fnmatch class IntervalManager(CIntervalManager): diff --git a/direct/src/interval/IntervalTest.py b/direct/src/interval/IntervalTest.py index 7a4954a154..4bbfc9db57 100644 --- a/direct/src/interval/IntervalTest.py +++ b/direct/src/interval/IntervalTest.py @@ -4,13 +4,15 @@ __all__ = [] if __name__ == "__main__": - from direct.directbase import DirectStart - from pandac.PandaModules import * + from direct.showbase.ShowBase import ShowBase + from panda3d.core import * from IntervalGlobal import * from direct.actor.Actor import * from direct.directutil import Mopath + base = ShowBase() + boat = loader.loadModel('models/misc/smiley') boat.reparentTo(render) @@ -205,4 +207,4 @@ if __name__ == "__main__": # return mt test(5) - run() + base.run() diff --git a/direct/src/interval/LerpInterval.py b/direct/src/interval/LerpInterval.py index bba040494f..51e9a7e61e 100644 --- a/direct/src/interval/LerpInterval.py +++ b/direct/src/interval/LerpInterval.py @@ -12,7 +12,8 @@ __all__ = [ 'LerpFunctionInterval', 'LerpFunc','LerpFunctionNoStateInterval','LerpFuncNS' ] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * import Interval import LerpBlendHelpers diff --git a/direct/src/interval/MetaInterval.py b/direct/src/interval/MetaInterval.py index f521414593..067414aea1 100644 --- a/direct/src/interval/MetaInterval.py +++ b/direct/src/interval/MetaInterval.py @@ -2,14 +2,15 @@ __all__ = ['MetaInterval', 'Sequence', 'Parallel', 'ParallelEndTogether', 'Track'] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * from IntervalManager import ivalMgr import Interval -from direct.task.Task import Task, TaskManager +from direct.task.Task import TaskManager import types -if __debug__: - import direct.showbase.PythonUtil as PythonUtil +#if __debug__: +# import direct.showbase.PythonUtil as PythonUtil PREVIOUS_END = CMetaInterval.RSPreviousEnd PREVIOUS_START = CMetaInterval.RSPreviousBegin diff --git a/direct/src/interval/MopathInterval.py b/direct/src/interval/MopathInterval.py index fe16700fc9..4a479896f1 100644 --- a/direct/src/interval/MopathInterval.py +++ b/direct/src/interval/MopathInterval.py @@ -3,7 +3,8 @@ __all__ = ['MopathInterval'] import LerpInterval -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * # import Mopath diff --git a/direct/src/interval/ParticleInterval.py b/direct/src/interval/ParticleInterval.py index 1456654330..fec166b6ec 100644 --- a/direct/src/interval/ParticleInterval.py +++ b/direct/src/interval/ParticleInterval.py @@ -6,11 +6,11 @@ __all__ = ['ParticleInterval'] Contains the ParticleInterval class """ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import directNotify from Interval import Interval -from direct.particles import ParticleEffect class ParticleInterval(Interval): """ diff --git a/direct/src/interval/ProjectileInterval.py b/direct/src/interval/ProjectileInterval.py index 7118c36f4d..3372b415af 100755 --- a/direct/src/interval/ProjectileInterval.py +++ b/direct/src/interval/ProjectileInterval.py @@ -2,10 +2,10 @@ __all__ = ['ProjectileInterval'] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * from Interval import Interval -from direct.showbase.PythonUtil import lerp from direct.showbase import PythonUtil class ProjectileInterval(Interval): diff --git a/direct/src/interval/ProjectileIntervalTest.py b/direct/src/interval/ProjectileIntervalTest.py index 4a5dc0907a..7e0b080d5a 100755 --- a/direct/src/interval/ProjectileIntervalTest.py +++ b/direct/src/interval/ProjectileIntervalTest.py @@ -2,8 +2,8 @@ __all__ = ['doTest'] -from pandac.PandaModules import * -from direct.directbase.DirectStart import * +from panda3d.core import * +from panda3d.direct import * from IntervalGlobal import * def doTest(): diff --git a/direct/src/interval/SoundInterval.py b/direct/src/interval/SoundInterval.py index fab99973e0..5326f105e6 100644 --- a/direct/src/interval/SoundInterval.py +++ b/direct/src/interval/SoundInterval.py @@ -2,7 +2,8 @@ __all__ = ['SoundInterval'] -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * import Interval import random diff --git a/direct/src/interval/TestInterval.py b/direct/src/interval/TestInterval.py index 7066bac0d5..b7a56d1698 100755 --- a/direct/src/interval/TestInterval.py +++ b/direct/src/interval/TestInterval.py @@ -6,11 +6,11 @@ __all__ = ['TestInterval'] Contains the ParticleInterval class """ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import directNotify from Interval import Interval -from direct.particles import ParticleEffect class TestInterval(Interval): # Name counter diff --git a/direct/src/motiontrail/MotionTrail.py b/direct/src/motiontrail/MotionTrail.py index ffcdbe5781..531deef003 100644 --- a/direct/src/motiontrail/MotionTrail.py +++ b/direct/src/motiontrail/MotionTrail.py @@ -1,6 +1,7 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.direct import * from direct.task import Task from direct.showbase.DirectObject import DirectObject diff --git a/direct/src/p3d/AppRunner.py b/direct/src/p3d/AppRunner.py index b9a1f17572..4b331ba272 100644 --- a/direct/src/p3d/AppRunner.py +++ b/direct/src/p3d/AppRunner.py @@ -9,9 +9,10 @@ runp3d.py for a command-line tool to invoke this module. """ +__all__ = ["AppRunner", "dummyAppRunner", "ArgumentError"] + import sys import os -import types import __builtin__ if 'VFSImporter' in sys.modules: @@ -29,7 +30,7 @@ else: from direct.showbase import VFSImporter from direct.showbase.DirectObject import DirectObject -from panda3d.core import VirtualFileSystem, Filename, Multifile, loadPrcFileData, unloadPrcFile, getModelPath, Thread, WindowProperties, ExecutionEnvironment, PandaSystem, Notify, StreamWriter, ConfigVariableString, ConfigPageManager +from panda3d.core import VirtualFileSystem, Filename, Multifile, loadPrcFileData, unloadPrcFile, getModelPath, WindowProperties, ExecutionEnvironment, PandaSystem, Notify, StreamWriter, ConfigVariableString, ConfigPageManager from panda3d.direct import init_app_for_gui from panda3d import core from direct.stdpy import file, glob @@ -43,7 +44,7 @@ from direct.p3d.InstalledHostData import InstalledHostData from direct.p3d.InstalledPackageData import InstalledPackageData # These imports are read by the C++ wrapper in p3dPythonRun.cxx. -from direct.p3d.JavaScript import UndefinedObject, Undefined, ConcreteStruct, BrowserObject +from direct.p3d.JavaScript import Undefined, ConcreteStruct class ArgumentError(AttributeError): pass diff --git a/direct/src/p3d/DWBPackageInstaller.py b/direct/src/p3d/DWBPackageInstaller.py index 43ee9fb71d..4d32e4d503 100644 --- a/direct/src/p3d/DWBPackageInstaller.py +++ b/direct/src/p3d/DWBPackageInstaller.py @@ -1,3 +1,5 @@ +__all__ = ["DWBPackageInstaller"] + from direct.p3d.PackageInstaller import PackageInstaller from direct.gui.DirectWaitBar import DirectWaitBar from direct.gui import DirectGuiGlobals as DGG diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 10677cd5d4..5f316e35c7 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -4,7 +4,7 @@ to build for as many platforms as possible. """ __all__ = ["Standalone", "Installer"] -import os, sys, subprocess, tarfile, shutil, time, zipfile, glob, socket, getpass, struct +import os, sys, subprocess, tarfile, shutil, time, zipfile, socket, getpass, struct from cStringIO import StringIO from direct.directnotify.DirectNotifyGlobal import * from direct.showbase.AppRunnerGlobal import appRunner diff --git a/direct/src/p3d/FileSpec.py b/direct/src/p3d/FileSpec.py index 291149ad77..f6ca6b93d0 100644 --- a/direct/src/p3d/FileSpec.py +++ b/direct/src/p3d/FileSpec.py @@ -1,3 +1,5 @@ +__all__ = ["FileSpec"] + import os import time from panda3d.core import Filename, HashVal, VirtualFileSystem diff --git a/direct/src/p3d/HostInfo.py b/direct/src/p3d/HostInfo.py index f22e47cf82..82fa5001cd 100644 --- a/direct/src/p3d/HostInfo.py +++ b/direct/src/p3d/HostInfo.py @@ -1,3 +1,5 @@ +__all__ = ["HostInfo"] + from panda3d.core import HashVal, Filename, PandaSystem, DocumentSpec, Ramfile from panda3d.core import HTTPChannel, ConfigVariableInt from panda3d import core diff --git a/direct/src/p3d/InstalledHostData.py b/direct/src/p3d/InstalledHostData.py index e8c9e5d5d2..d98abb6d18 100644 --- a/direct/src/p3d/InstalledHostData.py +++ b/direct/src/p3d/InstalledHostData.py @@ -1,3 +1,5 @@ +__all__ = ["InstalledHostData"] + from panda3d.core import URLSpec class InstalledHostData: diff --git a/direct/src/p3d/InstalledPackageData.py b/direct/src/p3d/InstalledPackageData.py index 6d0675ac36..c6ebed3ec1 100644 --- a/direct/src/p3d/InstalledPackageData.py +++ b/direct/src/p3d/InstalledPackageData.py @@ -1,3 +1,5 @@ +__all__ = ["InstalledPackageData"] + class InstalledPackageData: """ A list of instances of this class is maintained by InstalledHostData (which is in turn returned by diff --git a/direct/src/p3d/JavaScript.py b/direct/src/p3d/JavaScript.py index 6c08d0ed29..f10ad28d1d 100644 --- a/direct/src/p3d/JavaScript.py +++ b/direct/src/p3d/JavaScript.py @@ -2,6 +2,8 @@ useful when writing code that integrates with JavaScript, especially code that runs in a browser via the web plugin. """ +__all__ = ["UndefinedObject", "Undefined", "ConcreteStruct", "BrowserObject", "MethodWrapper"] + import types class UndefinedObject: diff --git a/direct/src/p3d/PackageInfo.py b/direct/src/p3d/PackageInfo.py index 3e1767b91f..cceb2164c6 100644 --- a/direct/src/p3d/PackageInfo.py +++ b/direct/src/p3d/PackageInfo.py @@ -1,4 +1,6 @@ -from panda3d.core import Filename, URLSpec, DocumentSpec, Ramfile, Multifile, Decompressor, EUOk, EUSuccess, VirtualFileSystem, Thread, getModelPath, ExecutionEnvironment, PStatCollector, TiXmlDocument, TiXmlDeclaration, TiXmlElement +__all__ = ["PackageInfo"] + +from panda3d.core import Filename, DocumentSpec, Multifile, Decompressor, EUOk, EUSuccess, VirtualFileSystem, Thread, getModelPath, ExecutionEnvironment, PStatCollector, TiXmlDocument, TiXmlDeclaration, TiXmlElement import panda3d.core as core from direct.p3d.FileSpec import FileSpec from direct.p3d.ScanDirectoryNode import ScanDirectoryNode diff --git a/direct/src/p3d/PackageInstaller.py b/direct/src/p3d/PackageInstaller.py index 3f920b8bd3..33527ef94e 100644 --- a/direct/src/p3d/PackageInstaller.py +++ b/direct/src/p3d/PackageInstaller.py @@ -1,3 +1,5 @@ +__all__ = ["PackageInstaller"] + from direct.showbase.DirectObject import DirectObject from direct.stdpy.threading import Lock, RLock from direct.showbase.MessengerGlobal import messenger diff --git a/direct/src/p3d/PackageMerger.py b/direct/src/p3d/PackageMerger.py index e5b90705e3..a00a3f7d35 100644 --- a/direct/src/p3d/PackageMerger.py +++ b/direct/src/p3d/PackageMerger.py @@ -1,8 +1,9 @@ +__all__ = ["PackageMerger", "PackageMergerError"] + from direct.p3d.FileSpec import FileSpec from direct.p3d.SeqValue import SeqValue from direct.directnotify.DirectNotifyGlobal import * from panda3d.core import * -import copy import shutil import os diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 9614e96d59..5386bb8d71 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -3,17 +3,17 @@ within a Panda3D Multifile, which can be easily be downloaded and/or patched onto a client machine, for the purpose of running a large application. """ +__all__ = ["Packager", "PackagerError", "OutsideOfPackageError", "ArgumentError"] + # Important to import panda3d first, to avoid naming conflicts with # Python's "string" and "Loader" names that are imported later. from panda3d.core import * import sys import os import glob -import marshal import string import types import getpass -import platform import struct import subprocess from direct.p3d.FileSpec import FileSpec diff --git a/direct/src/p3d/PatchMaker.py b/direct/src/p3d/PatchMaker.py index e8fbf80274..7055f5eb3e 100644 --- a/direct/src/p3d/PatchMaker.py +++ b/direct/src/p3d/PatchMaker.py @@ -1,3 +1,5 @@ +__all__ = ["PatchMaker"] + from direct.p3d.FileSpec import FileSpec from direct.p3d.SeqValue import SeqValue from panda3d.core import * diff --git a/direct/src/p3d/ScanDirectoryNode.py b/direct/src/p3d/ScanDirectoryNode.py index 94f323551e..429b8f0fd2 100644 --- a/direct/src/p3d/ScanDirectoryNode.py +++ b/direct/src/p3d/ScanDirectoryNode.py @@ -1,3 +1,5 @@ +__all__ = ["ScanDirectoryNode"] + from panda3d.core import VirtualFileSystem, VirtualFileMountSystem, Filename, TiXmlDocument vfs = VirtualFileSystem.getGlobalPtr() diff --git a/direct/src/p3d/SeqValue.py b/direct/src/p3d/SeqValue.py index 493098f4e6..6ae527578d 100644 --- a/direct/src/p3d/SeqValue.py +++ b/direct/src/p3d/SeqValue.py @@ -1,3 +1,5 @@ +__all__ = ["SeqValue"] + import types class SeqValue: diff --git a/direct/src/particles/ForceGroup.py b/direct/src/particles/ForceGroup.py index 8c04052232..9cd451f5ec 100644 --- a/direct/src/particles/ForceGroup.py +++ b/direct/src/particles/ForceGroup.py @@ -1,4 +1,5 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.physics import * from direct.showbase.DirectObject import DirectObject from direct.showbase.PhysicsManagerGlobal import * diff --git a/direct/src/particles/ParticleEffect.py b/direct/src/particles/ParticleEffect.py index 914630f19c..bfd4e0c7c9 100644 --- a/direct/src/particles/ParticleEffect.py +++ b/direct/src/particles/ParticleEffect.py @@ -1,7 +1,11 @@ -from pandac.PandaModules import * -import Particles -import ForceGroup +from panda3d.core import * + +# Leave these imports in, they may be used by ptf files. +from panda3d.physics import * +from . import Particles +from . import ForceGroup + from direct.directnotify import DirectNotifyGlobal class ParticleEffect(NodePath): diff --git a/direct/src/particles/ParticleFloorTest.py b/direct/src/particles/ParticleFloorTest.py index 39126fd080..8bb021eed0 100755 --- a/direct/src/particles/ParticleFloorTest.py +++ b/direct/src/particles/ParticleFloorTest.py @@ -1,5 +1,6 @@ -from pandac.PandaModules import * +from panda3d.core import NodePath +from panda3d.physics import LinearVectorForce from direct.particles import ParticleEffect from direct.particles import Particles from direct.particles import ForceGroup @@ -48,8 +49,8 @@ class ParticleFloorTest(NodePath): if __name__ == "__main__": from direct.directbase.TestStart import * - pt=ParticleFloorTest() + pt = ParticleFloorTest() pt.reparentTo(render) pt.start() - camera.setY(-10.0) - run() + base.camera.setY(-10.0) + base.run() diff --git a/direct/src/particles/Particles.py b/direct/src/particles/Particles.py index 826b004b80..ee82ffc81b 100644 --- a/direct/src/particles/Particles.py +++ b/direct/src/particles/Particles.py @@ -1,7 +1,7 @@ -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.physics import PhysicalNode from panda3d.physics import ParticleSystem -from panda3d.physics import BaseParticleFactory from panda3d.physics import PointParticleFactory from panda3d.physics import ZSpinParticleFactory #from panda3d.physics import OrientedParticleFactory @@ -25,8 +25,6 @@ from panda3d.physics import TangentRingEmitter import SpriteParticleRendererExt -import string -import os from direct.directnotify.DirectNotifyGlobal import directNotify import sys diff --git a/direct/src/showbase/Audio3DManager.py b/direct/src/showbase/Audio3DManager.py index 84c572d815..28dffc4bd7 100644 --- a/direct/src/showbase/Audio3DManager.py +++ b/direct/src/showbase/Audio3DManager.py @@ -2,7 +2,7 @@ __all__ = ['Audio3DManager'] -from pandac.PandaModules import Vec3, VBase3 +from panda3d.core import Vec3, VBase3 from direct.task import Task # class Audio3DManager: diff --git a/direct/src/showbase/ContainerLeakDetector.py b/direct/src/showbase/ContainerLeakDetector.py index bc85db1fda..7180ffe543 100755 --- a/direct/src/showbase/ContainerLeakDetector.py +++ b/direct/src/showbase/ContainerLeakDetector.py @@ -1,6 +1,5 @@ -from pandac.PandaModules import PStatCollector from direct.directnotify.DirectNotifyGlobal import directNotify -from direct.showbase.PythonUtil import Queue, invertDictLossless, makeFlywheelGen +from direct.showbase.PythonUtil import makeFlywheelGen from direct.showbase.PythonUtil import itype, serialNum, safeRepr, fastRepr from direct.showbase.Job import Job import types, weakref, random, __builtin__ diff --git a/direct/src/showbase/ContainerReport.py b/direct/src/showbase/ContainerReport.py index d12f42285f..fb5b1a4de1 100755 --- a/direct/src/showbase/ContainerReport.py +++ b/direct/src/showbase/ContainerReport.py @@ -1,6 +1,6 @@ from direct.directnotify.DirectNotifyGlobal import directNotify -from direct.showbase.PythonUtil import Queue, fastRepr, invertDictLossless -from direct.showbase.PythonUtil import itype, safeRepr +from direct.showbase.PythonUtil import Queue, invertDictLossless +from direct.showbase.PythonUtil import safeRepr from direct.showbase.Job import Job import types diff --git a/direct/src/showbase/DistancePhasedNode.py b/direct/src/showbase/DistancePhasedNode.py index 3f8be4306d..02b3fd7a24 100755 --- a/direct/src/showbase/DistancePhasedNode.py +++ b/direct/src/showbase/DistancePhasedNode.py @@ -1,6 +1,5 @@ from direct.showbase.DirectObject import DirectObject -from direct.directnotify import DirectNotifyGlobal -from pandac.PandaModules import * +from panda3d.core import * from PhasedObject import PhasedObject class DistancePhasedNode(PhasedObject, DirectObject, NodePath): diff --git a/direct/src/showbase/ExcelHandler.py b/direct/src/showbase/ExcelHandler.py index d1c6a89d92..01f932b1de 100755 --- a/direct/src/showbase/ExcelHandler.py +++ b/direct/src/showbase/ExcelHandler.py @@ -13,7 +13,6 @@ print e.tables """ from xml.sax import saxutils -from xml.sax import parse class ExcelHandler(saxutils.DefaultHandler): def __init__(self): diff --git a/direct/src/showbase/Finder.py b/direct/src/showbase/Finder.py index f209ef9b14..4c81b64b99 100644 --- a/direct/src/showbase/Finder.py +++ b/direct/src/showbase/Finder.py @@ -2,7 +2,6 @@ __all__ = ['findClass', 'rebindClass', 'copyFuncs', 'replaceMessengerFunc', 'replaceTaskMgrFunc', 'replaceStateFunc', 'replaceCRFunc', 'replaceAIRFunc', 'replaceIvalFunc'] -import time import types import os import sys diff --git a/direct/src/showbase/GarbageReport.py b/direct/src/showbase/GarbageReport.py index 6d6eacea0d..c04fb42367 100755 --- a/direct/src/showbase/GarbageReport.py +++ b/direct/src/showbase/GarbageReport.py @@ -3,7 +3,7 @@ __all__ = ['FakeObject', '_createGarbage', 'GarbageReport', 'GarbageLogger'] from direct.directnotify.DirectNotifyGlobal import directNotify -from direct.showbase.PythonUtil import safeRepr, fastRepr, printListEnumGen, printNumberedTypesGen +from direct.showbase.PythonUtil import fastRepr from direct.showbase.PythonUtil import AlphabetCounter from direct.showbase.Job import Job import gc diff --git a/direct/src/showbase/LazySort.py b/direct/src/showbase/LazySort.py index 90f33559a1..85ac166c00 100755 --- a/direct/src/showbase/LazySort.py +++ b/direct/src/showbase/LazySort.py @@ -109,7 +109,6 @@ if __debug__: print x def test(): - import random from itertools import islice control = sorted(data, key = lambda x: x[0]) diff --git a/direct/src/showbase/Messenger.py b/direct/src/showbase/Messenger.py index 3d901d219d..aba83d7d3a 100644 --- a/direct/src/showbase/Messenger.py +++ b/direct/src/showbase/Messenger.py @@ -7,7 +7,6 @@ from PythonUtil import * from direct.directnotify import DirectNotifyGlobal import types -from panda3d.core import ConfigVariableBool, Thread, Mutex from direct.stdpy.threading import Lock class Messenger: diff --git a/direct/src/showbase/ObjectPool.py b/direct/src/showbase/ObjectPool.py index acfd99696c..80109226ce 100755 --- a/direct/src/showbase/ObjectPool.py +++ b/direct/src/showbase/ObjectPool.py @@ -6,7 +6,6 @@ from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import invertDictLossless, makeList, safeRepr from direct.showbase.PythonUtil import getNumberedTypedString, getNumberedTypedSortedString from direct.showbase.PythonUtil import getNumberedTypedSortedStringWithReferrersGen -import types import gc class Diff: diff --git a/direct/src/showbase/OnScreenDebug.py b/direct/src/showbase/OnScreenDebug.py index e193996cea..addd59f3ad 100755 --- a/direct/src/showbase/OnScreenDebug.py +++ b/direct/src/showbase/OnScreenDebug.py @@ -2,9 +2,7 @@ __all__ = ['OnScreenDebug'] - - -from pandac.PandaModules import * +from panda3d.core import * import types from direct.gui import OnscreenText diff --git a/direct/src/showbase/ProfileSession.py b/direct/src/showbase/ProfileSession.py index c2cd4f7b67..828272be8c 100755 --- a/direct/src/showbase/ProfileSession.py +++ b/direct/src/showbase/ProfileSession.py @@ -2,13 +2,10 @@ from panda3d.core import TrueClock from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import ( StdoutCapture, _installProfileCustomFuncs,_removeProfileCustomFuncs, - _profileWithoutGarbageLeak, _getProfileResultFileInfo, _setProfileResultsFileInfo, - _clearProfileResultFileInfo, ) + _getProfileResultFileInfo, _setProfileResultsFileInfo) import __builtin__ import profile import pstats -from StringIO import StringIO -import marshal class PercentStats(pstats.Stats): # prints more useful output when sampled durations are shorter than a millisecond diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 8d20e1683d..8b8d59394d 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -35,7 +35,6 @@ __all__ = ['indent', import types import string -import re import math import operator import inspect @@ -52,7 +51,6 @@ import marshal __report_indent = 3 -from direct.directutil import Verify from panda3d.core import ConfigVariableBool ScalarTypes = (types.FloatType, types.IntType, types.LongType) diff --git a/direct/src/showbase/RandomNumGen.py b/direct/src/showbase/RandomNumGen.py index 685fffa8fa..0b6df19d2b 100644 --- a/direct/src/showbase/RandomNumGen.py +++ b/direct/src/showbase/RandomNumGen.py @@ -3,7 +3,7 @@ __all__ = ['randHash', 'RandomNumGen'] from direct.directnotify import DirectNotifyGlobal -from pandac.PandaModules import Mersenne +from panda3d.core import Mersenne def randHash(num): """ this returns a random 16-bit integer, given a seed integer. diff --git a/direct/src/showbase/SfxPlayer.py b/direct/src/showbase/SfxPlayer.py index 9579ada442..496481e6a4 100644 --- a/direct/src/showbase/SfxPlayer.py +++ b/direct/src/showbase/SfxPlayer.py @@ -2,9 +2,8 @@ __all__ = ['SfxPlayer'] - import math -from pandac.PandaModules import * +from panda3d.core import * class SfxPlayer: """ diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 9ab3184d6a..057b049fd9 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -24,18 +24,14 @@ from PythonUtil import * from direct.showbase import PythonUtil #from direct.interval.IntervalManager import ivalMgr from direct.interval import IntervalManager -from InputStateGlobal import inputState from direct.showbase.BufferViewer import BufferViewer from direct.task import Task from direct.directutil import Verify from direct.showbase import GarbageReport -import math,sys,os +import sys import Loader import time -import gc import atexit -from direct.fsm import ClassicFSM -from direct.fsm import State from direct.showbase import ExceptionVarDump import DirectObject import SfxPlayer @@ -367,7 +363,7 @@ class ShowBase(DirectObject.DirectObject): builtins.cpMgr = ConfigPageManager.getGlobalPtr() builtins.cvMgr = ConfigVariableManager.getGlobalPtr() builtins.pandaSystem = PandaSystem.getGlobalPtr() - builtins.wantUberdog = base.config.GetBool('want-uberdog', 1) + builtins.wantUberdog = self.config.GetBool('want-uberdog', 1) if __debug__: builtins.deltaProfiler = DeltaProfiler.DeltaProfiler("ShowBase") builtins.onScreenDebug = OnScreenDebug.OnScreenDebug() @@ -419,7 +415,7 @@ class ShowBase(DirectObject.DirectObject): # adds a sleep right after the main render in igloop # tends to even out the frame rate and keeps it from going # to zero in the out of focus windows - if base.config.GetBool('multi-sleep', 0): + if self.config.GetBool('multi-sleep', 0): self.multiClientSleep = 1 else: self.multiClientSleep = 0 @@ -464,8 +460,8 @@ class ShowBase(DirectObject.DirectObject): profile.Profile.bias = float(self.config.GetString("profile-bias","0")) def f8(x): - return ("%"+"8.%df"%base.config.GetInt("profile-decimals",3)) % x - pstats.f8=f8 + return ("%" + "8.%df" % self.config.GetInt("profile-decimals", 3)) % x + pstats.f8 = f8 # temp; see ToonBase.py def getExitErrorCode(self): @@ -807,7 +803,7 @@ class ShowBase(DirectObject.DirectObject): # Set up a 3-d camera for the window by default. if keepCamera: self.makeCamera(win, scene = scene, aspectRatio = aspectRatio, - stereo = stereo, useCamera = base.cam) + stereo = stereo, useCamera = self.cam) elif makeCamera: self.makeCamera(win, scene = scene, aspectRatio = aspectRatio, stereo = stereo) @@ -832,10 +828,10 @@ class ShowBase(DirectObject.DirectObject): for i in range(numRegions): dr = win.getDisplayRegion(i) # [gjeon] remove drc in base.direct.drList - if base.direct is not None: - for drc in base.direct.drList: + if self.direct is not None: + for drc in self.direct.drList: if drc.cam == dr.getCamera(): - base.direct.drList.displayRegionList.remove(drc) + self.direct.drList.displayRegionList.remove(drc) break cam = NodePath(dr.getCamera()) @@ -888,7 +884,7 @@ class ShowBase(DirectObject.DirectObject): if not self.winList: # Give the window(s) a chance to actually close before we # continue. - base.graphicsEngine.renderFrame() + self.graphicsEngine.renderFrame() def openDefaultWindow(self, *args, **kw): # Creates the main window for the first time, without being @@ -2121,7 +2117,7 @@ class ShowBase(DirectObject.DirectObject): """ if self.__deadInputs: self.eventMgr.doEvents() - self.dgTrav.traverse(base.dataRootNode) + self.dgTrav.traverse(self.dataRootNode) self.eventMgr.eventQueue.clear() self.taskMgr.add(self.__dataLoop, 'dataLoop', sort = -50) self.__deadInputs = 0 @@ -2182,15 +2178,15 @@ class ShowBase(DirectObject.DirectObject): # Clean up the old mode. self.showVertices.node().setActive(0) dr = self.showVertices.node().getDisplayRegion(0) - base.win.removeDisplayRegion(dr) + self.win.removeDisplayRegion(dr) self.showVertices.removeNode() self.showVertices = None return - dr = base.win.makeDisplayRegion() + dr = self.win.makeDisplayRegion() dr.setSort(1000) cam = Camera('showVertices') - cam.setLens(base.camLens) + cam.setLens(self.camLens) # Set up a funny state to render only vertices. override = 100000 @@ -2381,7 +2377,7 @@ class ShowBase(DirectObject.DirectObject): # Tell the camera to cull from here instead of its own # origin. - for c in base.camList: + for c in self.camList: c.node().setCullCenter(self.oobeCullFrustum) if cam.node().isOfType(Camera): cam.node().setCullCenter(self.oobeCullFrustum) @@ -2390,7 +2386,7 @@ class ShowBase(DirectObject.DirectObject): else: # Disable OOBE culling. - for c in base.camList: + for c in self.camList: c.node().setCullCenter(NodePath()) if cam.node().isOfType(Camera): cam.node().setCullCenter(self.oobeCullFrustum) @@ -2487,16 +2483,16 @@ class ShowBase(DirectObject.DirectObject): """ if source == None: - source = base.win + source = self.win if camera == None: if hasattr(source, "getCamera"): camera = source.getCamera() if camera == None: - camera = base.camera + camera = self.camera if sourceLens == None: - sourceLens = base.camLens + sourceLens = self.camLens if hasattr(source, "getWindow"): source = source.getWindow() @@ -2513,15 +2509,15 @@ class ShowBase(DirectObject.DirectObject): # Now render a frame to fill up the texture. rig.reparentTo(camera) - base.graphicsEngine.openWindows() - base.graphicsEngine.renderFrame() + self.graphicsEngine.openWindows() + self.graphicsEngine.renderFrame() tex = buffer.getTexture() saved = self.screenshot(namePrefix = namePrefix, defaultFilename = defaultFilename, source = tex) - base.graphicsEngine.removeWindow(buffer) + self.graphicsEngine.removeWindow(buffer) rig.removeNode() return saved @@ -2547,16 +2543,16 @@ class ShowBase(DirectObject.DirectObject): there is a problem. """ if source == None: - source = base.win + source = self.win if camera == None: if hasattr(source, "getCamera"): camera = source.getCamera() if camera == None: - camera = base.camera + camera = self.camera if sourceLens == None: - sourceLens = base.camLens + sourceLens = self.camLens if hasattr(source, "getWindow"): source = source.getWindow() @@ -2571,7 +2567,7 @@ class ShowBase(DirectObject.DirectObject): rig = NodePath(namePrefix) buffer = toSphere.makeCubeMap(namePrefix, size, rig, cameraMask, 0) if buffer == None: - base.graphicsEngine.removeWindow(toSphere) + self.graphicsEngine.removeWindow(toSphere) raise StandardError, "Could not make cube map." # Set the near and far planes from the default lens. @@ -2600,18 +2596,18 @@ class ShowBase(DirectObject.DirectObject): # Now render a frame. This will render out the cube map and # then apply it to the the card in the toSphere buffer. rig.reparentTo(camera) - base.graphicsEngine.openWindows() - base.graphicsEngine.renderFrame() + self.graphicsEngine.openWindows() + self.graphicsEngine.renderFrame() # One more frame for luck. - base.graphicsEngine.renderFrame() + self.graphicsEngine.renderFrame() saved = self.screenshot(namePrefix = namePrefix, defaultFilename = defaultFilename, source = toSphere.getTexture()) - base.graphicsEngine.removeWindow(buffer) - base.graphicsEngine.removeWindow(toSphere) + self.graphicsEngine.removeWindow(buffer) + self.graphicsEngine.removeWindow(toSphere) rig.removeNode() return saved @@ -2832,11 +2828,11 @@ class ShowBase(DirectObject.DirectObject): def wxLoop(task): # First we need to ensure that the OS message queue is # processed. - base.wxApp.Yield() + self.wxApp.Yield() # Now do all the wxPython events waiting on this frame. - while base.wxApp.Pending(): - base.wxApp.Dispatch() + while self.wxApp.Pending(): + self.wxApp.Dispatch() return task.again @@ -2943,8 +2939,10 @@ class ShowBase(DirectObject.DirectObject): self.startWx(fWantWx) self.wantDirect = fWantDirect if self.wantDirect: - from direct.directtools import DirectSession - base.direct.enable() + from direct.directtools.DirectSession import DirectSession + self.direct = DirectSession() + self.direct.enable() + builtins.direct = self.direct else: builtins.direct = self.direct = None diff --git a/direct/src/showbase/Transitions.py b/direct/src/showbase/Transitions.py index ca4919a48f..86f5ee70fd 100644 --- a/direct/src/showbase/Transitions.py +++ b/direct/src/showbase/Transitions.py @@ -2,10 +2,8 @@ __all__ = ['Transitions'] - -from pandac.PandaModules import * +from panda3d.core import * from direct.gui.DirectGui import * -from direct.task import Task from direct.interval.LerpInterval import LerpColorScaleInterval, LerpColorInterval, LerpScaleInterval, LerpPosInterval from direct.interval.MetaInterval import Sequence, Parallel from direct.interval.FunctionInterval import Func diff --git a/direct/src/showbase/pandaSqueezeTool.py b/direct/src/showbase/pandaSqueezeTool.py index 0899689926..fd87135930 100755 --- a/direct/src/showbase/pandaSqueezeTool.py +++ b/direct/src/showbase/pandaSqueezeTool.py @@ -52,7 +52,7 @@ __all__ = ['usage', 'Squeezer', 'Loader', 'boot', 'open', 'explode', 'getloader' VERSION = "1.6/98-05-04" MAGIC = "[PANDASQUEEZE]" -import base64, imp, marshal, os, string, sys, md5 +import base64, imp, marshal, os, string, sys # -------------------------------------------------------------------- # usage @@ -246,7 +246,7 @@ def getloader(data, package): # # parse options -import getopt, glob, sys +import sys import zlib embed = 0 @@ -340,23 +340,23 @@ exec "import %(start)s" #%(localMagic)s %(archiveid)s import ihooks, zlib, marshal, os, sys -import pandac - def searchPath(filename): - # Look along pandac.__path__ for the indicated filename. Returns + # Look along panda3d.__path__ for the indicated filename. Returns # the located pathname, or None if the filename is not found. - for dir in pandac.__path__: + import panda3d + + for dir in panda3d.__path__: pathname = os.path.join(dir, filename) if os.path.exists(pathname): return pathname return None -# Look for %(archiveBase)s along pandac.__path__. +# Look for %(archiveBase)s along panda3d.__path__. archiveName = "%(archiveBase)s" archivePath = searchPath(archiveName) if archivePath == None: - raise ImportError, "Could not locate pandac.%%s." %% (archiveName) + raise ImportError, "Could not locate panda3d.%%s." %% (archiveName) f=open(archivePath,"rb") exec marshal.loads(%(zbegin)sf.read(%(loaderlen)d)%(zend)s) diff --git a/direct/src/showutil/BuildGeometry.py b/direct/src/showutil/BuildGeometry.py index 5dfec621e2..7a7ff73b49 100644 --- a/direct/src/showutil/BuildGeometry.py +++ b/direct/src/showutil/BuildGeometry.py @@ -1,8 +1,5 @@ -from direct.distributed import DistributedObject -from direct.directnotify import DirectNotifyGlobal -from pandac.PandaModules import * +from panda3d.core import * from math import * -import math GEO_ID = 0 @@ -385,4 +382,4 @@ def addArrowGeom(rootNode, sizeX, sizeY, color = Vec4(1.0, 1.0, 1.0, 1.0), layer GEO_ID += 1 NodePathGeom = rootNode.attachNewNode(GN) geo = addArrow(GN, sizeX, sizeY, color, layer) - return NodePathGeom, GN, geo \ No newline at end of file + return NodePathGeom, GN, geo diff --git a/direct/src/showutil/Effects.py b/direct/src/showutil/Effects.py index f2847d188d..19f9b40515 100644 --- a/direct/src/showutil/Effects.py +++ b/direct/src/showutil/Effects.py @@ -1,6 +1,6 @@ """ Showutil Effects module: contains code for useful showcode effects. """ -from pandac.PandaModules import * +from panda3d.core import * from direct.interval.IntervalGlobal import * # bounce types diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 28c622a9be..df845b0c26 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -16,7 +16,6 @@ try: except ImportError: p3extend_frozen = None -import direct from panda3d.core import * from pandac.extension_native_helpers import dll_suffix, dll_ext diff --git a/direct/src/showutil/Rope.py b/direct/src/showutil/Rope.py index 9f4a3b1c90..5bbda785ed 100644 --- a/direct/src/showutil/Rope.py +++ b/direct/src/showutil/Rope.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import * +from panda3d.core import * import types class Rope(NodePath): diff --git a/direct/src/showutil/TexMemWatcher.py b/direct/src/showutil/TexMemWatcher.py index 5368b49e2e..5de8ecb138 100644 --- a/direct/src/showutil/TexMemWatcher.py +++ b/direct/src/showutil/TexMemWatcher.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.DirectObject import DirectObject import math import copy diff --git a/direct/src/showutil/TexViewer.py b/direct/src/showutil/TexViewer.py index c645ca6403..7d325afdfc 100644 --- a/direct/src/showutil/TexViewer.py +++ b/direct/src/showutil/TexViewer.py @@ -1,4 +1,4 @@ -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.DirectObject import DirectObject class TexViewer(DirectObject): diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index 54458f0d2c..5374c135d2 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -11,9 +11,7 @@ from direct.showbase import ExceptionVarDump from direct.showbase.PythonUtil import * from direct.showbase.MessengerGlobal import messenger import types -import time import random -import string try: import signal diff --git a/direct/src/task/Timer.py b/direct/src/task/Timer.py index ddb188a24a..7474deb652 100644 --- a/direct/src/task/Timer.py +++ b/direct/src/task/Timer.py @@ -2,7 +2,6 @@ __all__ = ['Timer'] -from pandac.PandaModules import * import Task class Timer: diff --git a/direct/src/tkpanels/AnimPanel.py b/direct/src/tkpanels/AnimPanel.py index adb7a0f89b..e68f52fced 100644 --- a/direct/src/tkpanels/AnimPanel.py +++ b/direct/src/tkpanels/AnimPanel.py @@ -11,7 +11,7 @@ from direct.tkwidgets.AppShell import * from direct.showbase.TkGlobal import * from tkSimpleDialog import askfloat from Tkinter import * -import Pmw, string, math, types +import Pmw, string, types from direct.task import Task FRAMES = 0 diff --git a/direct/src/tkpanels/DirectSessionPanel.py b/direct/src/tkpanels/DirectSessionPanel.py index e10c0d91bb..a197cd385f 100644 --- a/direct/src/tkpanels/DirectSessionPanel.py +++ b/direct/src/tkpanels/DirectSessionPanel.py @@ -6,7 +6,7 @@ __all__ = ['DirectSessionPanel'] from direct.showbase.TkGlobal import * from direct.tkwidgets.AppShell import * from Tkinter import * -from pandac.PandaModules import * +from panda3d.core import * import Pmw, string from direct.tkwidgets import Dial from direct.tkwidgets import Floater @@ -724,7 +724,7 @@ class DirectSessionPanel(AppShell): dictName = name else: # Generate a unique name for the dict - dictName = name + '-' + repr(nodePath.id()) + dictName = name + '-' + repr(hash(nodePath)) if dictName not in dict: # Update combo box to include new item names.append(dictName) diff --git a/direct/src/tkpanels/Inspector.py b/direct/src/tkpanels/Inspector.py index ed0e3989cd..2ffa1a5249 100644 --- a/direct/src/tkpanels/Inspector.py +++ b/direct/src/tkpanels/Inspector.py @@ -7,7 +7,6 @@ so that I can just type: inspect(anObject) any time.""" __all__ = ['inspect', 'inspectorFor', 'Inspector', 'ModuleInspector', 'ClassInspector', 'InstanceInspector', 'FunctionInspector', 'InstanceMethodInspector', 'CodeInspector', 'ComplexInspector', 'DictionaryInspector', 'SequenceInspector', 'SliceInspector', 'InspectorWindow'] -import string from direct.showbase.TkGlobal import * from Tkinter import * import Pmw @@ -23,11 +22,11 @@ def inspect(anObject): ### private def inspectorFor(anObject): - typeName = string.capitalize(type(anObject).__name__) + 'Type' + typeName = type(anObject).__name__.capitalize() + 'Type' if typeName in _InspectorMap: inspectorName = _InspectorMap[typeName] else: - print "Can't find an inspector for " + typeName + print("Can't find an inspector for " + typeName) inspectorName = 'Inspector' inspector = globals()[inspectorName](anObject) return inspector @@ -96,7 +95,7 @@ class Inspector: def title(self): "Subclasses may override." - return string.capitalize(self.objectType().__name__) + return self.objectType().__name__.capitalize() def getLastPartNumber(self): return self.lastPartNumber @@ -406,14 +405,14 @@ class InspectorWindow: return self.topInspector().inspectorFor(part) def popupMenu(self, event): - print event + print(event) partNumber = self.selectedIndex() - print partNumber + print(partNumber) if partNumber == None: return part = self.topInspector().partNumber(partNumber) - print part - from pandac.PandaModules import NodePath + print(part) + from panda3d.core import NodePath from direct.fsm import ClassicFSM popupMenu = None if isinstance(part, NodePath): @@ -427,7 +426,7 @@ class InspectorWindow: popupMenu = self.createPopupMenu( part, [('Inspect ClassicFSM', FSMInspector.FSMInspector)]) - print popupMenu + print(popupMenu) if popupMenu: popupMenu.post(event.widget.winfo_pointerx(), event.widget.winfo_pointery()) diff --git a/direct/src/tkpanels/MopathRecorder.py b/direct/src/tkpanels/MopathRecorder.py index 929c166315..3e7bc3e0c5 100644 --- a/direct/src/tkpanels/MopathRecorder.py +++ b/direct/src/tkpanels/MopathRecorder.py @@ -3,7 +3,7 @@ __all__ = ['MopathRecorder'] # Import Tkinter, Pmw, and the dial code from this directory tree. -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.DirectObject import DirectObject from direct.showbase.TkGlobal import * from direct.tkwidgets.AppShell import * diff --git a/direct/src/tkpanels/NotifyPanel.py b/direct/src/tkpanels/NotifyPanel.py index b6156b31fe..76d139daad 100644 --- a/direct/src/tkpanels/NotifyPanel.py +++ b/direct/src/tkpanels/NotifyPanel.py @@ -16,8 +16,7 @@ class NotifyPanel: from direct.showbase.TkGlobal import Pmw, Toplevel, Frame, Label, Radiobutton from direct.showbase.TkGlobal import HORIZONTAL, X, W, NW, BOTH, LEFT, RIGHT, IntVar # To get severity levels - from pandac.PandaModules import NSFatal, NSError, NSWarning, NSInfo - from pandac.PandaModules import NSDebug, NSSpam + from panda3d.core import NSFatal, NSError, NSWarning, NSInfo, NSDebug, NSSpam if tl == None: tl = Toplevel() @@ -125,7 +124,7 @@ class NotifyPanel: return categories def getPandaCategories(self): - from pandac.PandaModules import Notify + from panda3d.core import Notify topCategory = Notify.ptr().getTopCategory() return self._getPandaCategories(topCategory) diff --git a/direct/src/tkpanels/ParticlePanel.py b/direct/src/tkpanels/ParticlePanel.py index 2d89609903..ccc622bdc6 100644 --- a/direct/src/tkpanels/ParticlePanel.py +++ b/direct/src/tkpanels/ParticlePanel.py @@ -17,7 +17,8 @@ from direct.particles import ParticleEffect from Tkinter import * import Pmw, os,Placer -from pandac.PandaModules import * +from panda3d.core import * +from panda3d.physics import * class ParticlePanel(AppShell): # Override class variables @@ -2778,7 +2779,8 @@ if __name__ == '__main__': try: base except: - from direct.directbase import DirectStart + from direct.showbase.ShowBase import ShowBase + base = ShowBase() root = Pmw.initialise() pp = ParticlePanel() diff --git a/direct/src/tkpanels/Placer.py b/direct/src/tkpanels/Placer.py index e762725bd5..9b52343bf7 100644 --- a/direct/src/tkpanels/Placer.py +++ b/direct/src/tkpanels/Placer.py @@ -3,7 +3,7 @@ __all__ = ['Placer', 'place'] # Import Tkinter, Pmw, and the dial code from this directory tree. -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.TkGlobal import * from direct.tkwidgets.AppShell import * from direct.tkwidgets import Dial @@ -429,7 +429,7 @@ class Placer(AppShell): background = self.nodePathMenuBG) # Check to see if node path and ref node path are the same if ((self.refCS != None) and - (self.refCS.id() == self['nodePath'].id())): + (self.refCS == self['nodePath'])): # Yes they are, use temp CS as ref # This calls updatePlacer self.setReferenceNodePath(self.tempCS) @@ -474,7 +474,7 @@ class Placer(AppShell): listbox = self.refNodePathMenu.component('scrolledlist') listbox.setlist(self.refNodePathNames) # Check to see if node path and ref node path are the same - if (nodePath != None) and (nodePath.id() == self['nodePath'].id()): + if (nodePath != None) and (nodePath == self['nodePath']): # Yes they are, use temp CS and update listbox accordingly nodePath = self.tempCS self.refNodePathMenu.selectitem('parent') @@ -509,7 +509,7 @@ class Placer(AppShell): dictName = name else: # Generate a unique name for the dict - dictName = name + '-' + repr(nodePath.id()) + dictName = name + '-' + repr(hash(nodePath)) if dictName not in dict: # Update combo box to include new item names.append(dictName) diff --git a/direct/src/tkwidgets/AppShell.py b/direct/src/tkwidgets/AppShell.py index 3f024c58e5..67a7e6b794 100644 --- a/direct/src/tkwidgets/AppShell.py +++ b/direct/src/tkwidgets/AppShell.py @@ -17,7 +17,6 @@ import Floater import Slider import EntryScale import VectorWidgets -import sys, string import ProgressBar """ diff --git a/direct/src/tkwidgets/Dial.py b/direct/src/tkwidgets/Dial.py index f4216ce844..13a3cc8472 100644 --- a/direct/src/tkwidgets/Dial.py +++ b/direct/src/tkwidgets/Dial.py @@ -10,7 +10,6 @@ from Tkinter import * from Valuator import Valuator, VALUATOR_MINI, VALUATOR_FULL from direct.task import Task import math, string, operator, Pmw -from pandac.PandaModules import ClockObject TWO_PI = 2.0 * math.pi ONEPOINTFIVE_PI = 1.5 * math.pi diff --git a/direct/src/tkwidgets/EntryScale.py b/direct/src/tkwidgets/EntryScale.py index f79afe00aa..e4c8a96a60 100644 --- a/direct/src/tkwidgets/EntryScale.py +++ b/direct/src/tkwidgets/EntryScale.py @@ -4,7 +4,6 @@ EntryScale Class: Scale with a label, and a linked and validated entry __all__ = ['EntryScale', 'EntryScaleGroup'] -from direct.showbase.DirectObject import DirectObject from direct.showbase.TkGlobal import * from Tkinter import * import string, Pmw diff --git a/direct/src/tkwidgets/Floater.py b/direct/src/tkwidgets/Floater.py index 799d6c7b8e..655b7728be 100644 --- a/direct/src/tkwidgets/Floater.py +++ b/direct/src/tkwidgets/Floater.py @@ -9,7 +9,7 @@ from direct.showbase.TkGlobal import * from Tkinter import * from Valuator import Valuator, VALUATOR_MINI, VALUATOR_FULL from direct.task import Task -import math, sys, string, Pmw +import math, Pmw FLOATER_WIDTH = 22 FLOATER_HEIGHT = 18 diff --git a/direct/src/tkwidgets/SceneGraphExplorer.py b/direct/src/tkwidgets/SceneGraphExplorer.py index 9faf76e5e0..f07b24b496 100644 --- a/direct/src/tkwidgets/SceneGraphExplorer.py +++ b/direct/src/tkwidgets/SceneGraphExplorer.py @@ -155,7 +155,7 @@ class SceneGraphExplorerItem(TreeItem): return type + " " + name def GetKey(self): - return self.nodePath.id() + return hash(self.nodePath) def IsEditable(self): # All nodes' names can be edited nowadays. diff --git a/direct/src/tkwidgets/Slider.py b/direct/src/tkwidgets/Slider.py index 2a28107d8d..f2d9bb1246 100644 --- a/direct/src/tkwidgets/Slider.py +++ b/direct/src/tkwidgets/Slider.py @@ -8,10 +8,8 @@ __all__ = ['Slider', 'SliderWidget', 'rgbPanel'] from direct.showbase.TkGlobal import * from Tkinter import * from Valuator import Valuator, rgbPanel, VALUATOR_MINI, VALUATOR_FULL -from direct.task import Task -import math, sys, string -import operator, Pmw -from pandac.PandaModules import ClockObject +import string +import Pmw class Slider(Valuator): """ diff --git a/direct/src/tkwidgets/Tree.py b/direct/src/tkwidgets/Tree.py index b8c8100940..45857934b8 100644 --- a/direct/src/tkwidgets/Tree.py +++ b/direct/src/tkwidgets/Tree.py @@ -20,12 +20,9 @@ __all__ = ['TreeNode', 'TreeItem'] # - optimize tree redraw after expand of subnode import os -import sys -import string from direct.showbase.TkGlobal import * from Tkinter import * -import Pmw -from pandac.PandaModules import * +from panda3d.core import * # Initialize icon directory ICONDIR = ConfigVariableSearchPath('model-path').findFile(Filename('icons')).toOsSpecific() diff --git a/direct/src/wxwidgets/ViewPort.py b/direct/src/wxwidgets/ViewPort.py index 494c3ab845..2fd21a7a41 100755 --- a/direct/src/wxwidgets/ViewPort.py +++ b/direct/src/wxwidgets/ViewPort.py @@ -13,7 +13,7 @@ from direct.directtools.DirectGrid import DirectGrid from direct.showbase.ShowBase import WindowControls from direct.directtools.DirectGlobals import * from WxPandaWindow import WxPandaWindow -from pandac.PandaModules import WindowProperties, OrthographicLens, Point3, Plane, CollisionPlane, CollisionNode, NodePath +from panda3d.core import OrthographicLens, Point3, Plane, CollisionPlane, CollisionNode, NodePath import wx HORIZONTAL = wx.SPLIT_HORIZONTAL diff --git a/direct/src/wxwidgets/WxPandaShell.py b/direct/src/wxwidgets/WxPandaShell.py index 00b2483276..76420489c7 100755 --- a/direct/src/wxwidgets/WxPandaShell.py +++ b/direct/src/wxwidgets/WxPandaShell.py @@ -1,8 +1,7 @@ import wx -import os from wx.lib.agw import fourwaysplitter as FWS -from pandac.PandaModules import * +from panda3d.core import * from direct.showbase.ShowBase import * from direct.directtools.DirectGlobals import * diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index a51fb7741c..8c67ace1c8 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -66,10 +66,6 @@ extern char **environ; #include #endif -#ifdef HAVE_PYTHON -#include "Python.h" -#endif - // We define the symbol PREREAD_ENVIRONMENT if we cannot rely on // getenv() to read environment variables at static init time. In // this case, we must read all of the environment variables directly @@ -265,60 +261,9 @@ ns_get_environment_variable(const string &var) const { } else if (var == "COMMON_APPDATA") { return Filename::get_common_appdata_directory().to_os_specific(); } else if (var == "MAIN_DIR") { -#ifdef HAVE_PYTHON - // If we're running from Python code, read out sys.argv. - if (!ns_has_environment_variable("PANDA_INCOMPATIBLE_PYTHON") && Py_IsInitialized()) { - // Since we might have gotten to this point from a function call - // marked BLOCKING, which releases the Python thread state, we - // have to temporarily re-establish our thread state in the - // Python interpreter. -#ifdef WITH_THREAD - PyGILState_STATE state = PyGILState_Ensure(); -#endif - - Filename main_dir; - PyObject *obj = PySys_GetObject((char*) "argv"); // borrowed reference - if (obj != NULL && PyList_Check(obj)) { - PyObject *item = PyList_GetItem(obj, 0); // borrowed reference - if (item != NULL) { - if (PyUnicode_Check(item)) { - Py_ssize_t size = PyUnicode_GetSize(item); - wchar_t *data = new wchar_t[size + 1]; -#if PY_MAJOR_VERSION >= 3 - if (PyUnicode_AsWideChar(item, data, size) != -1) { -#else - if (PyUnicode_AsWideChar((PyUnicodeObject*) item, data, size) != -1) { -#endif - wstring wstr (data, size); - main_dir = Filename::from_os_specific_w(wstr); - } - delete data; - } -#if PY_MAJOR_VERSION < 3 - else if (PyString_Check(item)) { - char *str = PyString_AsString(item); - if (str != (char *)NULL) { - main_dir = Filename::from_os_specific(str); - } - } -#endif - } - } - -#ifdef WITH_THREAD - PyGILState_Release(state); -#endif - - if (main_dir.empty()) { - // We must be running in the Python interpreter directly, so return the CWD. - return get_cwd().to_os_specific(); - } - main_dir.make_absolute(); - return Filename(main_dir.get_dirname()).to_os_specific(); - } -#endif - - // Otherwise, Return the binary name's parent directory. + // Return the binary name's parent directory. If we're running + // inside the Python interpreter, this will be overridden by + // a setting from panda3d/core.py. if (!_binary_name.empty()) { Filename main_dir (_binary_name); main_dir.make_absolute(); diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 1cef42e102..9bae13353f 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1264,9 +1264,15 @@ write_sub_module(ostream &out, Object *obj) { std::string export_class_name = classNameFromCppName(obj->_itype.get_name(), false); std::string export_class_name2 = classNameFromCppName(obj->_itype.get_name(), true); -// out << " Py_INCREF(&Dtool_" << class_name << ".As_PyTypeObject());\n"; + // Note: PyModule_AddObject steals a reference, so we have to call Py_INCREF + // for every but the first time we add it to the module. + if (obj->_itype.is_typedef()) { + out << " Py_INCREF((PyObject *)&Dtool_" << class_name << ");\n"; + } + out << " PyModule_AddObject(module, \"" << export_class_name << "\", (PyObject *)&Dtool_" << class_name << ");\n"; if (export_class_name != export_class_name2) { + out << " Py_INCREF((PyObject *)&Dtool_" << class_name << ");\n"; out << " PyModule_AddObject(module, \"" << export_class_name2 << "\", (PyObject *)&Dtool_" << class_name << ");\n"; } } diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 8aad13c5c6..8f5b39591e 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -95,13 +95,13 @@ int write_python_table_native(ostream &out) { FunctionIndex function_index = interrogate_get_function(fi); // Consider only those that belong in the module we asked for. - if (interrogate_function_has_module_name(function_index) && - module_name == interrogate_function_module_name(function_index)) { + //if (interrogate_function_has_module_name(function_index) && + // module_name == interrogate_function_module_name(function_index)) { // if it has a library name add it to set of libraries if (interrogate_function_has_library_name(function_index)) { libraries.insert(interrogate_function_library_name(function_index)); } - } + //} } for (int ti = 0; ti < interrogate_number_of_types(); ti++) { diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 23651b7d0d..16932aedfe 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -30,11 +30,6 @@ import time import os import sys -## jGenPyCode tries to get the directory for Direct from the sys.path. This only works if you -## have installed the sdk using a installer. This would not work if the installer was -## never used and everything was grabbed into a virgin environment using cvs. -sys.path.append(os.getcwd()) - ######################################################################## ## ## PARSING THE COMMAND LINE OPTIONS @@ -1332,9 +1327,8 @@ def CompileIgate(woutd,wsrc,opts): if (PkgSkip("PYTHON")): WriteFile(woutc, "") WriteFile(woutd, "") - CompileCxx(wobj, woutc, opts) ConditionalWriteFile(woutd, "") - return + return (wobj, woutc, opts) if not CrossCompiling(): # If we're compiling for this platform, we can use the one we've built. @@ -1385,8 +1379,8 @@ def CompileIgate(woutd,wsrc,opts): else: cmd += ' ' + BracketNameWithQuotes(os.path.basename(x)) oscmd(cmd) - CompileCxx(wobj,woutc,opts) - return + + return (wobj, woutc, opts) ######################################################################## ## @@ -1773,28 +1767,26 @@ def CompileRsrc(target, src, opts): ########################################################################################## # -# RunGenPyCode +# GenPyExtensions # ########################################################################################## -def RunGenPyCode(target, inputs, opts): - if (PkgSkip("PYTHON") != 0): - return +def GenPyExtensions(target, inputs, opts): + # Hopefully the need for this will soon go away as we migrate everything to + # C extensions. - cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " " - if sys.version_info >= (2, 6): - cmdstr += "-B " + code = "# This file is automatically generated by makepanda.py. Do not modify.\n" + code += "from __future__ import absolute_import\n" - cmdstr += os.path.join(GetOutputDir(), "direct", "ffi", "jGenPyCode.py") - if (GENMAN): cmdstr += " -d" - cmdstr += " -r" for i in inputs: - if (GetOrigExt(i)==".pyd"): - cmdstr += " panda3d." + os.path.basename(os.path.splitext(i)[0]) - elif (GetOrigExt(i)==".dll"): - cmdstr += " " + os.path.basename(os.path.splitext(i)[0].replace("_d","")) + if GetOrigExt(i) == ".pyd": + code += "from .%s import *\n" % (os.path.splitext(os.path.basename(i))[0]) + elif GetOrigExt(i) == ".py": + code += "### BEGIN %s\n" % i + code += ReadFile(i) + code += "### END %s\n" % i - oscmd(cmdstr) + WriteFile(target, code) ########################################################################################## # @@ -1804,7 +1796,7 @@ def RunGenPyCode(target, inputs, opts): def FreezePy(target, inputs, opts): assert len(inputs) > 0 - # Make sure this function isn't called before genpycode is run. + cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " " if sys.version_info >= (2, 6): cmdstr += "-B " @@ -1935,9 +1927,9 @@ def CompileAnything(target, inputs, opts, progress = None): if (origsuffix==".exe" and GetHost() != "windows"): os.system("chmod +x \"%s\"" % target) return - elif (target.endswith("pandac/PandaModules.py")): - ProgressOutput(progress, "Generating 'pandac' tree") - return RunGenPyCode(target, inputs, opts) + elif (target.endswith(".py")): + ProgressOutput(progress, "Generating", target) + return GenPyExtensions(target, inputs, opts) elif (infile.endswith(".py")): if (origsuffix==".exe"): ProgressOutput(progress, "Building frozen executable", target) @@ -1974,7 +1966,9 @@ def CompileAnything(target, inputs, opts, progress = None): return CompileLink(target, inputs, opts) elif (origsuffix==".in"): ProgressOutput(progress, "Building Interrogate database", target) - return CompileIgate(target, inputs, opts) + args = CompileIgate(target, inputs, opts) + ProgressOutput(progress, "Building C++ object", args[0]) + return CompileCxx(*args) elif (origsuffix==".plugin" and GetTarget() == "darwin"): ProgressOutput(progress, "Building plugin bundle", target) return CompileBundle(target, inputs, opts) @@ -2582,6 +2576,60 @@ if (PkgSkip("DIRECT")==0): if os.path.isfile(GetOutputDir() + '/direct/ffi/panda3d.pyc'): os.remove(GetOutputDir() + '/direct/ffi/panda3d.pyc') +# This used to exist; no longer. +if sys.platform == 'win32': + core_so = GetOutputDir() + '/panda3d/core.pyd' + direct_so = GetOutputDir() + '/panda3d/direct.pyd' +else: + core_so = GetOutputDir() + '/panda3d/core.so' + direct_so = GetOutputDir() + '/panda3d/direct.so' + +if os.path.isfile(core_so): + os.remove(core_so) +if os.path.isfile(direct_so): + os.remove(direct_so) + +# PandaModules is now deprecated; generate a shim for backward compatibility. +for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'): + if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'): + os.remove(fn) + +panda_modules = ['core'] +if not PkgSkip("PANDAPHYSICS"): + panda_modules.append('physics') +if not PkgSkip('PANDAFX'): + panda_modules.append('fx') +if not PkgSkip("DIRECT"): + panda_modules.append('direct') +if not PkgSkip("VISION"): + panda_modules.append('vision') +if not PkgSkip("SKEL"): + panda_modules.append('skel') +panda_modules.append('egg') +if not PkgSkip("AWESOMIUM"): + panda_modules.append('awesomium') +if not PkgSkip("ODE"): + panda_modules.append('ode') +if not PkgSkip("VRPN"): + panda_modules.append('vrpn') + +panda_modules_code = """ +"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead." + +print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead") +""" + +for module in panda_modules: + panda_modules_code += """ +try: + from panda3d.%s import * +except ImportError, err: + if "No module named %s" not in str(err): + raise""" % (module, module) + +ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code) +ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '') + ########################################################################################## # # Generate the PRC files into the ETC directory. @@ -3812,58 +3860,67 @@ if (not RUNTIME): if PkgSkip("FREETYPE")==0: TargetAdd('core_module.obj', input='libp3pnmtext.in') - TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core']) + TargetAdd('core_module.obj', opts=['IMOD:panda3d._core', 'ILIB:_core']) - TargetAdd('core.pyd', input='libp3downloader_igate.obj') - TargetAdd('core.pyd', input='p3express_ext_composite.obj') - TargetAdd('core.pyd', input='libp3express_igate.obj') + TargetAdd('_core.pyd', input='libp3downloader_igate.obj') + TargetAdd('_core.pyd', input='p3express_ext_composite.obj') + TargetAdd('_core.pyd', input='libp3express_igate.obj') - TargetAdd('core.pyd', input='libp3recorder_igate.obj') - TargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj') - TargetAdd('core.pyd', input='libp3pgraph_igate.obj') - TargetAdd('core.pyd', input='libp3movies_igate.obj') - TargetAdd('core.pyd', input='libp3grutil_igate.obj') - TargetAdd('core.pyd', input='libp3chan_igate.obj') - TargetAdd('core.pyd', input='libp3pstatclient_igate.obj') - TargetAdd('core.pyd', input='libp3char_igate.obj') - TargetAdd('core.pyd', input='libp3collide_igate.obj') - TargetAdd('core.pyd', input='libp3device_igate.obj') - TargetAdd('core.pyd', input='libp3dgraph_igate.obj') - TargetAdd('core.pyd', input='libp3display_igate.obj') - TargetAdd('core.pyd', input='libp3pipeline_igate.obj') - TargetAdd('core.pyd', input='libp3event_igate.obj') - TargetAdd('core.pyd', input='libp3gobj_igate.obj') - TargetAdd('core.pyd', input='libp3gsgbase_igate.obj') - TargetAdd('core.pyd', input='libp3linmath_igate.obj') - TargetAdd('core.pyd', input='libp3mathutil_igate.obj') - TargetAdd('core.pyd', input='libp3parametrics_igate.obj') - TargetAdd('core.pyd', input='libp3pnmimage_igate.obj') - TargetAdd('core.pyd', input='libp3text_igate.obj') - TargetAdd('core.pyd', input='libp3tform_igate.obj') - TargetAdd('core.pyd', input='libp3putil_igate.obj') - TargetAdd('core.pyd', input='libp3audio_igate.obj') - TargetAdd('core.pyd', input='libp3pgui_igate.obj') - TargetAdd('core.pyd', input='libp3net_igate.obj') - TargetAdd('core.pyd', input='libp3nativenet_igate.obj') - TargetAdd('core.pyd', input='libp3dxml_igate.obj') + TargetAdd('_core.pyd', input='libp3recorder_igate.obj') + TargetAdd('_core.pyd', input='libp3pgraphnodes_igate.obj') + TargetAdd('_core.pyd', input='libp3pgraph_igate.obj') + TargetAdd('_core.pyd', input='libp3movies_igate.obj') + TargetAdd('_core.pyd', input='libp3grutil_igate.obj') + TargetAdd('_core.pyd', input='libp3chan_igate.obj') + TargetAdd('_core.pyd', input='libp3pstatclient_igate.obj') + TargetAdd('_core.pyd', input='libp3char_igate.obj') + TargetAdd('_core.pyd', input='libp3collide_igate.obj') + TargetAdd('_core.pyd', input='libp3device_igate.obj') + TargetAdd('_core.pyd', input='libp3dgraph_igate.obj') + TargetAdd('_core.pyd', input='libp3display_igate.obj') + TargetAdd('_core.pyd', input='libp3pipeline_igate.obj') + TargetAdd('_core.pyd', input='libp3event_igate.obj') + TargetAdd('_core.pyd', input='libp3gobj_igate.obj') + TargetAdd('_core.pyd', input='libp3gsgbase_igate.obj') + TargetAdd('_core.pyd', input='libp3linmath_igate.obj') + TargetAdd('_core.pyd', input='libp3mathutil_igate.obj') + TargetAdd('_core.pyd', input='libp3parametrics_igate.obj') + TargetAdd('_core.pyd', input='libp3pnmimage_igate.obj') + TargetAdd('_core.pyd', input='libp3text_igate.obj') + TargetAdd('_core.pyd', input='libp3tform_igate.obj') + TargetAdd('_core.pyd', input='libp3putil_igate.obj') + TargetAdd('_core.pyd', input='libp3audio_igate.obj') + TargetAdd('_core.pyd', input='libp3pgui_igate.obj') + TargetAdd('_core.pyd', input='libp3net_igate.obj') + TargetAdd('_core.pyd', input='libp3nativenet_igate.obj') + TargetAdd('_core.pyd', input='libp3dxml_igate.obj') if PkgSkip("FREETYPE")==0: - TargetAdd('core.pyd', input="libp3pnmtext_igate.obj") + TargetAdd('_core.pyd', input="libp3pnmtext_igate.obj") - TargetAdd('core.pyd', input='p3putil_typedWritable_ext.obj') - TargetAdd('core.pyd', input='p3putil_pythonCallbackObject.obj') - TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj') - TargetAdd('core.pyd', input='p3event_pythonTask.obj') - TargetAdd('core.pyd', input='p3gobj_ext_composite.obj') - TargetAdd('core.pyd', input='p3pgraph_ext_composite.obj') - TargetAdd('core.pyd', input='p3display_graphicsStateGuardian_ext.obj') - TargetAdd('core.pyd', input='p3display_graphicsWindow_ext.obj') - TargetAdd('core.pyd', input='p3display_pythonGraphicsWindowProc.obj') + TargetAdd('_core.pyd', input='p3putil_typedWritable_ext.obj') + TargetAdd('_core.pyd', input='p3putil_pythonCallbackObject.obj') + TargetAdd('_core.pyd', input='p3pnmimage_pfmFile_ext.obj') + TargetAdd('_core.pyd', input='p3event_pythonTask.obj') + TargetAdd('_core.pyd', input='p3gobj_ext_composite.obj') + TargetAdd('_core.pyd', input='p3pgraph_ext_composite.obj') + TargetAdd('_core.pyd', input='p3display_graphicsStateGuardian_ext.obj') + TargetAdd('_core.pyd', input='p3display_graphicsWindow_ext.obj') + TargetAdd('_core.pyd', input='p3display_pythonGraphicsWindowProc.obj') - TargetAdd('core.pyd', input='core_module.obj') - TargetAdd('core.pyd', input='libp3tinyxml.ilb') - TargetAdd('core.pyd', input=COMMON_PANDA_LIBS) - TargetAdd('core.pyd', opts=['PYTHON', 'WINSOCK2']) + TargetAdd('_core.pyd', input='core_module.obj') + TargetAdd('_core.pyd', input='libp3tinyxml.ilb') + TargetAdd('_core.pyd', input=COMMON_PANDA_LIBS) + TargetAdd('_core.pyd', opts=['PYTHON', 'WINSOCK2']) + + OPTS=['DIR:direct/src/extensions_native'] + TargetAdd('panda3d/core.py', input='_core.pyd') + TargetAdd('panda3d/core.py', opts=OPTS, input='core_extensions.py') + TargetAdd('panda3d/core.py', opts=OPTS, input='NodePath_extensions.py') + TargetAdd('panda3d/core.py', opts=OPTS, input='Mat3_extensions.py') + TargetAdd('panda3d/core.py', opts=OPTS, input='VBase3_extensions.py') + TargetAdd('panda3d/core.py', opts=OPTS, input='VBase4_extensions.py') + TargetAdd('panda3d/core.py', opts=OPTS, input='HTTPChannel_extensions.py') # # DIRECTORY: panda/src/vision/ @@ -3885,7 +3942,7 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME): TargetAdd('vision_module.obj', input='libp3vision.in') TargetAdd('vision_module.obj', opts=OPTS) - TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core']) + TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d._core']) TargetAdd('vision.pyd', input='vision_module.obj') TargetAdd('vision.pyd', input='libp3vision_igate.obj') @@ -3915,7 +3972,7 @@ if (PkgSkip("ROCKET") == 0) and (not RUNTIME): TargetAdd('rocket_module.obj', input='libp3rocket.in') TargetAdd('rocket_module.obj', opts=OPTS) - TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core']) + TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d._core']) TargetAdd('rocket.pyd', input='rocket_module.obj') TargetAdd('rocket.pyd', input='libp3rocket_igate.obj') @@ -3942,7 +3999,7 @@ if PkgSkip("AWESOMIUM") == 0 and not RUNTIME: TargetAdd('awesomium_module.obj', input='libp3awesomium.in') TargetAdd('awesomium_module.obj', opts=OPTS) - TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core']) + TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d._core']) TargetAdd('awesomium.pyd', input='awesomium_module.obj') TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj') @@ -3975,7 +4032,7 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME): TargetAdd('libpandaskel.dll', opts=OPTS) TargetAdd('skel_module.obj', input='libp3skel.in') - TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core']) + TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d._core']) TargetAdd('skel.pyd', input='skel_module.obj') TargetAdd('skel.pyd', input='libp3skel_igate.obj') @@ -4013,7 +4070,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME): OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG'] TargetAdd('fx_module.obj', input='libp3distort.in') TargetAdd('fx_module.obj', opts=OPTS) - TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core']) + TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d._core']) TargetAdd('fx.pyd', input='fx_module.obj') TargetAdd('fx.pyd', input='libp3distort_igate.obj') @@ -4040,7 +4097,7 @@ if (PkgSkip("VRPN")==0 and not RUNTIME): TargetAdd('vrpn_module.obj', input='libp3vrpn.in') TargetAdd('vrpn_module.obj', opts=OPTS) - TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core']) + TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d._core']) TargetAdd('vrpn.pyd', input='vrpn_module.obj') TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj') @@ -4272,7 +4329,7 @@ if (not RUNTIME): TargetAdd('egg_module.obj', input='libp3egg2pg.in') TargetAdd('egg_module.obj', input='libp3egg.in') TargetAdd('egg_module.obj', opts=OPTS) - TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core']) + TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d._core']) TargetAdd('egg.pyd', input='egg_module.obj') TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj') @@ -4438,7 +4495,7 @@ if (PkgSkip("ODE")==0 and not RUNTIME): OPTS=['DIR:panda/metalibs/pandaode', 'ODE'] TargetAdd('ode_module.obj', input='libpandaode.in') TargetAdd('ode_module.obj', opts=OPTS) - TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core']) + TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d._core']) TargetAdd('ode.pyd', input='ode_module.obj') TargetAdd('ode.pyd', input='libpandaode_igate.obj') @@ -4475,7 +4532,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME): OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET'] TargetAdd('bullet_module.obj', input='libpandabullet.in') TargetAdd('bullet_module.obj', opts=OPTS) - TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core']) + TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d._core']) TargetAdd('bullet.pyd', input='bullet_module.obj') TargetAdd('bullet.pyd', input='libpandabullet_igate.obj') @@ -4513,7 +4570,7 @@ if (PkgSkip("PHYSX")==0): OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC'] TargetAdd('physx_module.obj', input='libpandaphysx.in') TargetAdd('physx_module.obj', opts=OPTS) - TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core']) + TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d._core']) TargetAdd('physx.pyd', input='physx_module.obj') TargetAdd('physx.pyd', input='libpandaphysx_igate.obj') @@ -4578,7 +4635,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): if (PkgSkip("PANDAPARTICLESYSTEM")==0): TargetAdd('physics_module.obj', input='libp3particlesystem.in') TargetAdd('physics_module.obj', opts=OPTS) - TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core']) + TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d._core']) TargetAdd('physics.pyd', input='physics_module.obj') TargetAdd('physics.pyd', input='libp3physics_igate.obj') @@ -4834,18 +4891,22 @@ if (PkgSkip("DIRECT")==0): TargetAdd('direct_module.obj', input='libp3interval.in') TargetAdd('direct_module.obj', input='libp3distributed.in') TargetAdd('direct_module.obj', opts=OPTS) - TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core']) + TargetAdd('direct_module.obj', opts=['IMOD:panda3d._direct', 'ILIB:_direct', 'IMPORT:panda3d._core']) - TargetAdd('direct.pyd', input='libp3dcparser_igate.obj') - TargetAdd('direct.pyd', input='libp3showbase_igate.obj') - TargetAdd('direct.pyd', input='libp3deadrec_igate.obj') - TargetAdd('direct.pyd', input='libp3interval_igate.obj') - TargetAdd('direct.pyd', input='libp3distributed_igate.obj') + TargetAdd('_direct.pyd', input='libp3dcparser_igate.obj') + TargetAdd('_direct.pyd', input='libp3showbase_igate.obj') + TargetAdd('_direct.pyd', input='libp3deadrec_igate.obj') + TargetAdd('_direct.pyd', input='libp3interval_igate.obj') + TargetAdd('_direct.pyd', input='libp3distributed_igate.obj') - TargetAdd('direct.pyd', input='direct_module.obj') - TargetAdd('direct.pyd', input='libp3direct.dll') - TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS) - TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI']) + TargetAdd('_direct.pyd', input='direct_module.obj') + TargetAdd('_direct.pyd', input='libp3direct.dll') + TargetAdd('_direct.pyd', input=COMMON_PANDA_LIBS) + TargetAdd('_direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI']) + + OPTS=['DIR:direct/src/extensions_native'] + TargetAdd('panda3d/direct.py', input='_direct.pyd') + TargetAdd('panda3d/direct.py', opts=OPTS, input='CInterval_extensions.py') # # DIRECTORY: direct/src/dcparse/ @@ -6043,7 +6104,7 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME): TargetAdd('ai_module.obj', input='libpandaai.in') TargetAdd('ai_module.obj', opts=OPTS) - TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core']) + TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d._core']) TargetAdd('ai.pyd', input='ai_module.obj') TargetAdd('ai.pyd', input='libpandaai_igate.obj') @@ -6051,35 +6112,6 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME): TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS) TargetAdd('ai.pyd', opts=['PYTHON']) -# -# Run genpycode -# - -if (PkgSkip("PYTHON")==0 and not RUNTIME): - # We're phasing out the concept of PandaModules, so do not - # add new libraries here. Only add new libraries when you've - # split them out of libpanda and need to maintain backward - # compatibility with old imports. See direct/src/ffi/panda3d.py - - TargetAdd('PandaModules.py', input='core.pyd') - if (PkgSkip("PANDAPHYSICS")==0): - TargetAdd('PandaModules.py', input='physics.pyd') - if (PkgSkip('PANDAFX')==0): - TargetAdd('PandaModules.py', input='fx.pyd') - if (PkgSkip("DIRECT")==0): - TargetAdd('PandaModules.py', input='direct.pyd') - if (PkgSkip("VISION")==0): - TargetAdd('PandaModules.py', input='vision.pyd') - if (PkgSkip("SKEL")==0): - TargetAdd('PandaModules.py', input='skel.pyd') - TargetAdd('PandaModules.py', input='egg.pyd') - if (PkgSkip("AWESOMIUM")==0): - TargetAdd('PandaModules.py', input='awesomium.pyd') - if (PkgSkip("ODE")==0): - TargetAdd('PandaModules.py', input='ode.pyd') - if (PkgSkip("VRPN")==0): - TargetAdd('PandaModules.py', input='vrpn.pyd') - # # Generate the models directory and samples directory # diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 3d45411016..a93b6cadd1 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -2694,17 +2694,20 @@ def SetOrigExt(x, v): ORIG_EXT[x] = v def CalcLocation(fn, ipath): + if fn.startswith("panda3d/") and fn.endswith(".py"): + return OUTPUTDIR + "/" + fn + if (fn.count("/")): return fn dllext = "" target = GetTarget() if (GetOptimize() <= 2 and target == 'windows'): dllext = "_d" - if (fn == "PandaModules.py"): return OUTPUTDIR+"/pandac/" + fn if (fn == "AndroidManifest.xml"): return OUTPUTDIR+"/"+fn if (fn.endswith(".cxx")): return CxxFindSource(fn, ipath) if (fn.endswith(".I")): return CxxFindSource(fn, ipath) if (fn.endswith(".h")): return CxxFindSource(fn, ipath) if (fn.endswith(".c")): return CxxFindSource(fn, ipath) + if (fn.endswith(".py")): return CxxFindSource(fn, ipath) if (fn.endswith(".yxx")): return CxxFindSource(fn, ipath) if (fn.endswith(".lxx")): return CxxFindSource(fn, ipath) if (fn.endswith(".pdef")):return CxxFindSource(fn, ipath) From 08fbfb1874a079caa7df955fbd9fef94887b321f Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 28 Jun 2015 14:04:16 +0200 Subject: [PATCH 026/203] Add missing file, update .gitignores --- contrib/.gitignore | 7 ++++- direct/.gitignore | 1 + .../src/extensions_native/core_extensions.py | 28 +++++++++++++++++++ makepanda/.gitignore | 1 + panda/.gitignore | 1 + 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 direct/src/extensions_native/core_extensions.py diff --git a/contrib/.gitignore b/contrib/.gitignore index 33fa81ab6b..aa93cd250a 100644 --- a/contrib/.gitignore +++ b/contrib/.gitignore @@ -1,4 +1,9 @@ +*.pyc +*.pyo /__init__.py -/built/ +# These are files that are generated within the source tree by the +# ppremake system. Makefile pp.dep +/built/ +Opt?-* diff --git a/direct/.gitignore b/direct/.gitignore index 97b7fbcf49..aa93cd250a 100644 --- a/direct/.gitignore +++ b/direct/.gitignore @@ -1,4 +1,5 @@ *.pyc +*.pyo /__init__.py # These are files that are generated within the source tree by the # ppremake system. diff --git a/direct/src/extensions_native/core_extensions.py b/direct/src/extensions_native/core_extensions.py new file mode 100644 index 0000000000..3380dc3cf3 --- /dev/null +++ b/direct/src/extensions_native/core_extensions.py @@ -0,0 +1,28 @@ +import sys + +main_dir = Filename() + +if sys.argv and sys.argv[0]: + main_dir = Filename.from_os_specific(sys.argv[0]) + +if main_dir.empty(): + # We must be running in the Python interpreter directly, so return the CWD. + main_dir = ExecutionEnvironment.get_cwd() +else: + main_dir.make_absolute() + main_dir = Filename(main_dir.get_dirname()) +ExecutionEnvironment.shadow_environment_variable('MAIN_DIR', main_dir.to_os_specific()) +del sys, main_dir + + +def Dtool_funcToMethod(func, cls, method_name=None): + """Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method. + The new method is accessible to any instance immediately.""" + #if sys.version_info < (3, 0): + # func.im_class = cls + func.im_func = func + func.im_self = None + if not method_name: + method_name = func.__name__ + cls.DtoolClassDict[method_name] = func; + diff --git a/makepanda/.gitignore b/makepanda/.gitignore index 94487b9516..c3667923e0 100644 --- a/makepanda/.gitignore +++ b/makepanda/.gitignore @@ -1 +1,2 @@ *.pyc +*.pyo diff --git a/panda/.gitignore b/panda/.gitignore index 3fbb4b2955..ec20cdb1ee 100644 --- a/panda/.gitignore +++ b/panda/.gitignore @@ -1,4 +1,5 @@ *.pyc +*.pyo # These are files that are generated within the source tree by the # ppremake system. Makefile From b71d47b96c4f4ace908484ef2e619ee7db65aa6a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 29 Jun 2015 17:34:08 +0200 Subject: [PATCH 027/203] Fix inability to import panda3d.dtoolconfig --- dtool/metalibs/dtoolconfig/pydtool.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dtool/metalibs/dtoolconfig/pydtool.cxx b/dtool/metalibs/dtoolconfig/pydtool.cxx index 7b3a017b34..6c0746b114 100644 --- a/dtool/metalibs/dtoolconfig/pydtool.cxx +++ b/dtool/metalibs/dtoolconfig/pydtool.cxx @@ -2489,6 +2489,8 @@ static struct PyModuleDef python_simple_module = { #ifdef _WIN32 extern "C" __declspec(dllexport) INIT_FUNC(); +#elif __GNUC__ >= 4 +extern "C" __attribute__((visibility("default"))) INIT_FUNC(); #else extern "C" INIT_FUNC(); #endif From 5625df0e5143be58dd342aaf0b6afc2beb2ac7b9 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 29 Jun 2015 20:37:33 +0100 Subject: [PATCH 028/203] panda3d/__init__.py should add 'bin' dir to PATH on Windows --- makepanda/makepanda.py | 20 ++++++++++++++++++++ makepanda/makepandacore.py | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 16932aedfe..f7ee0d5d2c 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2589,6 +2589,26 @@ if os.path.isfile(core_so): if os.path.isfile(direct_so): os.remove(direct_so) +# Write an appropriate panda3d/__init__.py +p3d_init = """"Python bindings for the Panda3D libraries" +""" + +if GetTarget() == 'windows': + p3d_init += """ +import os + +bindir = os.path.join(os.path.dirname(__file__), '..', 'bin') +if os.path.isfile(os.path.join(bindir, 'libpanda.dll')): + if not os.environ.get('PATH'): + os.environ['PATH'] = bindir + else: + os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH'] + +del os, bindir +""" + +ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init) + # PandaModules is now deprecated; generate a shim for backward compatibility. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'): if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'): diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index a93b6cadd1..c490f0eafb 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -1061,7 +1061,6 @@ def MakeBuildTree(): MakeDirectory(OUTPUTDIR + "/pandac") MakeDirectory(OUTPUTDIR + "/pandac/input") MakeDirectory(OUTPUTDIR + "/panda3d") - CreateFile(OUTPUTDIR + "/panda3d/__init__.py") if GetTarget() == 'darwin': MakeDirectory(OUTPUTDIR + "/Frameworks") From ddd68e133e90525c196af09636e573cb2c240c4e Mon Sep 17 00:00:00 2001 From: Michael Wass Date: Tue, 30 Jun 2015 07:33:54 -0400 Subject: [PATCH 029/203] makepanda.py: added more refs for PackageMaker --- makepanda/makepanda.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 23651b7d0d..097cadee1d 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6747,8 +6747,12 @@ def MakeInstallerOSX(): cmd = '/Developer/usr/bin/packagemaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate' elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"): cmd = '/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate' + elif os.path.exists("/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker"): + cmd = '/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate' elif os.path.exists("/Developer/Tools/packagemaker"): cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist' + elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"): + cmd = '/Applications/PackageMaker.app/Contents/MacOS/PackageMaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist' else: exit("PackageMaker could not be found!") oscmd(cmd) From 09f3817f03dd485513d827e5e464374646991f8b Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 30 Jun 2015 13:56:11 +0200 Subject: [PATCH 030/203] Fix assimp compile error (Missing BUILDING:ASSIMP) --- makepanda/makepanda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 23651b7d0d..47c9acb860 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -5240,7 +5240,7 @@ if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0): # DIRECTORY: pandatool/src/assimp # if (PkgSkip("PANDATOOL") == 0 and PkgSkip("ASSIMP")==0): - OPTS=['DIR:pandatool/src/assimp', 'ASSIMP', 'MODULE'] + OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE'] TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx') TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj') TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS) From f9d185acafd9aad3eed396b700a40e7b7719f684 Mon Sep 17 00:00:00 2001 From: Michael Wass Date: Tue, 30 Jun 2015 08:47:57 -0400 Subject: [PATCH 031/203] makepanda.py: Changed command in a .app ref --- makepanda/makepanda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 097cadee1d..f85d4aeffd 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6752,7 +6752,7 @@ def MakeInstallerOSX(): elif os.path.exists("/Developer/Tools/packagemaker"): cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist' elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"): - cmd = '/Applications/PackageMaker.app/Contents/MacOS/PackageMaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist' + cmd = '/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate' else: exit("PackageMaker could not be found!") oscmd(cmd) From 63e682055de1865f8e6244e1a42f583df0971086 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 30 Jun 2015 15:06:18 +0200 Subject: [PATCH 032/203] travis: add --verbose flag --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2a3437725a..bb0b07dd51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ compiler: - clang before_script: - sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libopenal-dev libode-dev nvidia-cg-toolkit -script: python makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT --installer --threads 2 +script: python makepanda/makepanda.py --everything --verbose --git-commit $TRAVIS_COMMIT --installer --threads 2 notifications: irc: channels: From c0f6588c885b21c886eaefad9e8d52c3b4f41c2f Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 30 Jun 2015 15:17:15 +0200 Subject: [PATCH 033/203] Separate libp3interrogatedb out of libp3dtoolconfig. This aids further in removing the core lib dependency on Python. --- makepanda/makepanda.py | 25 +++++++++++++++++++++++-- panda/src/express/memoryUsagePointers.h | 7 ------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index f7ee0d5d2c..c434c97c89 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -3131,6 +3131,10 @@ TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:DTOOLCONFIG'] TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx') TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx') +TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj') +TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj') +TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll') +TargetAdd('libp3interrogatedb.dll', opts=['PYTHON']) # # DIRECTORY: dtool/metalibs/dtoolconfig/ @@ -3139,8 +3143,6 @@ TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_co OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG'] TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx') TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj') -TargetAdd('libp3dtoolconfig.dll', input='p3interrogatedb_composite1.obj') -TargetAdd('libp3dtoolconfig.dll', input='p3interrogatedb_composite2.obj') TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj') TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj') TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj') @@ -3153,6 +3155,7 @@ if not PkgSkip("PYTHON"): TargetAdd('dtoolconfig.pyd', input='dtoolconfig_pydtool.obj') TargetAdd('dtoolconfig.pyd', input='libp3dtoolconfig.dll') TargetAdd('dtoolconfig.pyd', input='libp3dtool.dll') + TargetAdd('dtoolconfig.pyd', input='libp3interrogatedb.dll') TargetAdd('dtoolconfig.pyd', opts=['PYTHON']) # @@ -3177,12 +3180,14 @@ if (not RUNTIME): TargetAdd('interrogate.exe', input='interrogate_composite2.obj') TargetAdd('interrogate.exe', input='libp3cppParser.ilb') TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('interrogate.exe', input='libp3interrogatedb.dll') TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx') TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj') TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb') TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll') TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) if (not RTDIST): @@ -3190,6 +3195,7 @@ if (not RUNTIME): TargetAdd('parse_file.exe', input='parse_file_parse_file.obj') TargetAdd('parse_file.exe', input='libp3cppParser.ilb') TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('parse_file.exe', input='libp3interrogatedb.dll') TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) # @@ -3212,6 +3218,7 @@ if (not RTDIST and not RUNTIME): TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx') TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj') TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) + TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll') TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) # @@ -3930,6 +3937,7 @@ if (not RUNTIME): TargetAdd('_core.pyd', input='core_module.obj') TargetAdd('_core.pyd', input='libp3tinyxml.ilb') + TargetAdd('_core.pyd', input='libp3interrogatedb.dll') TargetAdd('_core.pyd', input=COMMON_PANDA_LIBS) TargetAdd('_core.pyd', opts=['PYTHON', 'WINSOCK2']) @@ -3967,6 +3975,7 @@ if (PkgSkip("VISION") == 0) and (not RUNTIME): TargetAdd('vision.pyd', input='vision_module.obj') TargetAdd('vision.pyd', input='libp3vision_igate.obj') TargetAdd('vision.pyd', input='libp3vision.dll') + TargetAdd('vision.pyd', input='libp3interrogatedb.dll') TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS) TargetAdd('vision.pyd', opts=['PYTHON']) @@ -3998,6 +4007,7 @@ if (PkgSkip("ROCKET") == 0) and (not RUNTIME): TargetAdd('rocket.pyd', input='libp3rocket_igate.obj') TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj') TargetAdd('rocket.pyd', input='libp3rocket.dll') + TargetAdd('rocket.pyd', input='libp3interrogatedb.dll') TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS) TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET']) @@ -4024,6 +4034,7 @@ if PkgSkip("AWESOMIUM") == 0 and not RUNTIME: TargetAdd('awesomium.pyd', input='awesomium_module.obj') TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj') TargetAdd('awesomium.pyd', input='libp3awesomium.dll') + TargetAdd('awesomium.pyd', input='libp3interrogatedb.dll') TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS) TargetAdd('awesomium.pyd', opts=['PYTHON']) @@ -4057,6 +4068,7 @@ if (PkgSkip('SKEL')==0) and (not RUNTIME): TargetAdd('skel.pyd', input='skel_module.obj') TargetAdd('skel.pyd', input='libp3skel_igate.obj') TargetAdd('skel.pyd', input='libpandaskel.dll') + TargetAdd('skel.pyd', input='libp3interrogatedb.dll') TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS) TargetAdd('skel.pyd', opts=['PYTHON']) @@ -4095,6 +4107,7 @@ if (PkgSkip('PANDAFX')==0) and (not RUNTIME): TargetAdd('fx.pyd', input='fx_module.obj') TargetAdd('fx.pyd', input='libp3distort_igate.obj') TargetAdd('fx.pyd', input='libpandafx.dll') + TargetAdd('fx.pyd', input='libp3interrogatedb.dll') TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS) TargetAdd('fx.pyd', opts=['PYTHON']) @@ -4122,6 +4135,7 @@ if (PkgSkip("VRPN")==0 and not RUNTIME): TargetAdd('vrpn.pyd', input='vrpn_module.obj') TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj') TargetAdd('vrpn.pyd', input='libp3vrpn.dll') + TargetAdd('vrpn.pyd', input='libp3interrogatedb.dll') TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS) TargetAdd('vrpn.pyd', opts=['PYTHON']) @@ -4356,6 +4370,7 @@ if (not RUNTIME): TargetAdd('egg.pyd', input='libp3egg_igate.obj') TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj') TargetAdd('egg.pyd', input='libpandaegg.dll') + TargetAdd('egg.pyd', input='libp3interrogatedb.dll') TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS) TargetAdd('egg.pyd', opts=['PYTHON']) @@ -4521,6 +4536,7 @@ if (PkgSkip("ODE")==0 and not RUNTIME): TargetAdd('ode.pyd', input='libpandaode_igate.obj') TargetAdd('ode.pyd', input='p3ode_ext_composite.obj') TargetAdd('ode.pyd', input='libpandaode.dll') + TargetAdd('ode.pyd', input='libp3interrogatedb.dll') TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS) TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE']) @@ -4557,6 +4573,7 @@ if (PkgSkip("BULLET")==0 and not RUNTIME): TargetAdd('bullet.pyd', input='bullet_module.obj') TargetAdd('bullet.pyd', input='libpandabullet_igate.obj') TargetAdd('bullet.pyd', input='libpandabullet.dll') + TargetAdd('bullet.pyd', input='libp3interrogatedb.dll') TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS) TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET']) @@ -4595,6 +4612,7 @@ if (PkgSkip("PHYSX")==0): TargetAdd('physx.pyd', input='physx_module.obj') TargetAdd('physx.pyd', input='libpandaphysx_igate.obj') TargetAdd('physx.pyd', input='libpandaphysx.dll') + TargetAdd('physx.pyd', input='libp3interrogatedb.dll') TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS) TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC']) @@ -4662,6 +4680,7 @@ if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME): if (PkgSkip("PANDAPARTICLESYSTEM")==0): TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj') TargetAdd('physics.pyd', input='libpandaphysics.dll') + TargetAdd('physics.pyd', input='libp3interrogatedb.dll') TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS) TargetAdd('physics.pyd', opts=['PYTHON']) @@ -4921,6 +4940,7 @@ if (PkgSkip("DIRECT")==0): TargetAdd('_direct.pyd', input='direct_module.obj') TargetAdd('_direct.pyd', input='libp3direct.dll') + TargetAdd('_direct.pyd', input='libp3interrogatedb.dll') TargetAdd('_direct.pyd', input=COMMON_PANDA_LIBS) TargetAdd('_direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI']) @@ -6129,6 +6149,7 @@ if (PkgSkip("CONTRIB")==0 and not RUNTIME): TargetAdd('ai.pyd', input='ai_module.obj') TargetAdd('ai.pyd', input='libpandaai_igate.obj') TargetAdd('ai.pyd', input='libpandaai.dll') + TargetAdd('ai.pyd', input='libp3interrogatedb.dll') TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS) TargetAdd('ai.pyd', opts=['PYTHON']) diff --git a/panda/src/express/memoryUsagePointers.h b/panda/src/express/memoryUsagePointers.h index ceab784752..2512ea9f00 100644 --- a/panda/src/express/memoryUsagePointers.h +++ b/panda/src/express/memoryUsagePointers.h @@ -24,13 +24,6 @@ #include "referenceCount.h" #include "pvector.h" -#ifdef HAVE_PYTHON - -#undef _POSIX_C_SOURCE -#include - -#endif // HAVE_PYTHON - //////////////////////////////////////////////////////////////////// // Class : MemoryUsagePointers // Description : This is a list of pointers returned by a MemoryUsage From dd17fd864b40bd0fce781adc3baa79f78c6f6565 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 30 Jun 2015 16:16:35 +0200 Subject: [PATCH 034/203] Properly separate dtoolconfig and interrogatedb --- dtool/metalibs/dtoolconfig/pydtool.cxx | 11 +- dtool/src/dtoolbase/dtoolsymbols.h | 8 + .../src/dtoolutil/p3dtoolutil_composite2.cxx | 1 + .../vector_int.cxx | 4 +- .../{interrogatedb => dtoolutil}/vector_int.h | 4 +- .../src/interrogatedb/config_interrogatedb.h | 2 +- dtool/src/interrogatedb/dtool_super_base.cxx | 2 +- dtool/src/interrogatedb/extension.h | 4 +- dtool/src/interrogatedb/indexRemapper.h | 2 +- .../src/interrogatedb/interrogateComponent.h | 2 +- dtool/src/interrogatedb/interrogateDatabase.h | 2 +- dtool/src/interrogatedb/interrogateElement.h | 2 +- dtool/src/interrogatedb/interrogateFunction.h | 2 +- .../interrogateFunctionWrapper.h | 2 +- dtool/src/interrogatedb/interrogateMakeSeq.h | 2 +- dtool/src/interrogatedb/interrogateManifest.h | 2 +- dtool/src/interrogatedb/interrogateType.h | 2 +- .../src/interrogatedb/interrogate_interface.h | 262 +++++++++--------- dtool/src/interrogatedb/interrogate_request.h | 4 +- .../p3interrogatedb_composite2.cxx | 1 - dtool/src/interrogatedb/py_panda.cxx | 2 +- dtool/src/interrogatedb/py_panda.h | 78 +++--- makepanda/makepanda.py | 46 +-- 23 files changed, 233 insertions(+), 214 deletions(-) rename dtool/src/{interrogatedb => dtoolutil}/vector_int.cxx (91%) rename dtool/src/{interrogatedb => dtoolutil}/vector_int.h (95%) diff --git a/dtool/metalibs/dtoolconfig/pydtool.cxx b/dtool/metalibs/dtoolconfig/pydtool.cxx index 7b3a017b34..bde03f4197 100644 --- a/dtool/metalibs/dtoolconfig/pydtool.cxx +++ b/dtool/metalibs/dtoolconfig/pydtool.cxx @@ -2475,20 +2475,22 @@ static PyMethodDef python_simple_funcs[] = { #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef python_simple_module = { PyModuleDef_HEAD_INIT, - "dtoolconfig", + "interrogatedb", NULL, -1, python_simple_funcs, NULL, NULL, NULL, NULL }; -#define INIT_FUNC PyObject *PyInit_dtoolconfig +#define INIT_FUNC PyObject *PyInit_interrogatedb #else -#define INIT_FUNC void initdtoolconfig +#define INIT_FUNC void initinterrogatedb #endif #ifdef _WIN32 extern "C" __declspec(dllexport) INIT_FUNC(); +#elif __GNUC__ >= 4 +extern "C" __attribute__((visibility("default"))) INIT_FUNC(); #else extern "C" INIT_FUNC(); #endif @@ -2497,7 +2499,6 @@ INIT_FUNC() { #if PY_MAJOR_VERSION >= 3 return PyModule_Create(&python_simple_module); #else - Py_InitModule("dtoolconfig", python_simple_funcs); + Py_InitModule("interrogatedb", python_simple_funcs); #endif } - diff --git a/dtool/src/dtoolbase/dtoolsymbols.h b/dtool/src/dtoolbase/dtoolsymbols.h index 02e976b936..cb4cd7993e 100644 --- a/dtool/src/dtoolbase/dtoolsymbols.h +++ b/dtool/src/dtoolbase/dtoolsymbols.h @@ -86,6 +86,14 @@ #define EXPTP_DTOOLCONFIG IMPORT_TEMPL #endif +#ifdef BUILDING_INTERROGATEDB + #define EXPCL_INTERROGATEDB EXPORT_CLASS + #define EXPTP_INTERROGATEDB EXPORT_TEMPL +#else + #define EXPCL_INTERROGATEDB IMPORT_CLASS + #define EXPTP_INTERROGATEDB IMPORT_TEMPL +#endif + #ifdef BUILDING_MISC #define EXPCL_MISC EXPORT_CLASS #define EXPTP_MISC EXPORT_TEMPL diff --git a/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx b/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx index 289ce8f1e9..2adf532173 100644 --- a/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx +++ b/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx @@ -8,5 +8,6 @@ #include "stringDecoder.cxx" #include "textEncoder.cxx" #include "unicodeLatinMap.cxx" +#include "vector_int.cxx" #include "vector_string.cxx" #include "win32ArgParser.cxx" diff --git a/dtool/src/interrogatedb/vector_int.cxx b/dtool/src/dtoolutil/vector_int.cxx similarity index 91% rename from dtool/src/interrogatedb/vector_int.cxx rename to dtool/src/dtoolutil/vector_int.cxx index 6e829fcd63..4ec1769281 100644 --- a/dtool/src/interrogatedb/vector_int.cxx +++ b/dtool/src/dtoolutil/vector_int.cxx @@ -14,8 +14,8 @@ #include "vector_int.h" -#define EXPCL EXPCL_DTOOLCONFIG -#define EXPTP EXPTP_DTOOLCONFIG +#define EXPCL EXPCL_DTOOL +#define EXPTP EXPTP_DTOOL #define TYPE int #define NAME vector_int diff --git a/dtool/src/interrogatedb/vector_int.h b/dtool/src/dtoolutil/vector_int.h similarity index 95% rename from dtool/src/interrogatedb/vector_int.h rename to dtool/src/dtoolutil/vector_int.h index 65ee50a4a5..af0a7dd981 100644 --- a/dtool/src/interrogatedb/vector_int.h +++ b/dtool/src/dtoolutil/vector_int.h @@ -26,8 +26,8 @@ // rather than defining the vector again. //////////////////////////////////////////////////////////////////// -#define EXPCL EXPCL_DTOOLCONFIG -#define EXPTP EXPTP_DTOOLCONFIG +#define EXPCL EXPCL_DTOOL +#define EXPTP EXPTP_DTOOL #define TYPE int #define NAME vector_int diff --git a/dtool/src/interrogatedb/config_interrogatedb.h b/dtool/src/interrogatedb/config_interrogatedb.h index e088787b9d..6dd0995532 100644 --- a/dtool/src/interrogatedb/config_interrogatedb.h +++ b/dtool/src/interrogatedb/config_interrogatedb.h @@ -19,7 +19,7 @@ #include "notifyCategoryProxy.h" #include "configVariableSearchPath.h" -NotifyCategoryDecl(interrogatedb, EXPCL_DTOOLCONFIG, EXPTP_DTOOLCONFIG); +NotifyCategoryDecl(interrogatedb, EXPCL_INTERROGATEDB, EXPTP_INTERROGATEDB); extern ConfigVariableSearchPath interrogatedb_path; diff --git a/dtool/src/interrogatedb/dtool_super_base.cxx b/dtool/src/interrogatedb/dtool_super_base.cxx index 84334cf4c8..7cdcd21221 100644 --- a/dtool/src/interrogatedb/dtool_super_base.cxx +++ b/dtool/src/interrogatedb/dtool_super_base.cxx @@ -30,7 +30,7 @@ PyMethodDef Dtool_Methods_DTOOL_SUPER_BASE[] = { { NULL, NULL } }; -EXPCL_DTOOLCONFIG void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module) { +EXPCL_INTERROGATEDB void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module) { static bool initdone = false; if (!initdone) { diff --git a/dtool/src/interrogatedb/extension.h b/dtool/src/interrogatedb/extension.h index 0d41ef2c60..57728f98bf 100644 --- a/dtool/src/interrogatedb/extension.h +++ b/dtool/src/interrogatedb/extension.h @@ -24,7 +24,7 @@ // be used from the extension method. //////////////////////////////////////////////////////////////////// template -class EXPCL_DTOOLCONFIG ExtensionBase { +class EXPCL_INTERROGATEDB ExtensionBase { public: T * _this; }; @@ -36,7 +36,7 @@ public: // a specialization of this class template. //////////////////////////////////////////////////////////////////// template -class EXPCL_DTOOLCONFIG Extension : public ExtensionBase { +class EXPCL_INTERROGATEDB Extension : public ExtensionBase { }; //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogatedb/indexRemapper.h b/dtool/src/interrogatedb/indexRemapper.h index da2efc023f..61aa67ccc5 100644 --- a/dtool/src/interrogatedb/indexRemapper.h +++ b/dtool/src/interrogatedb/indexRemapper.h @@ -30,7 +30,7 @@ // only reason it exists is because Microsoft can't // export STL map outside of the DLL. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG IndexRemapper { +class EXPCL_INTERROGATEDB IndexRemapper { public: IndexRemapper(); ~IndexRemapper(); diff --git a/dtool/src/interrogatedb/interrogateComponent.h b/dtool/src/interrogatedb/interrogateComponent.h index 6ad6bcd806..e1820806d3 100644 --- a/dtool/src/interrogatedb/interrogateComponent.h +++ b/dtool/src/interrogatedb/interrogateComponent.h @@ -30,7 +30,7 @@ class IndexRemapper; // interrogate database. This includes types, // functions, and function wrappers. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateComponent { +class EXPCL_INTERROGATEDB InterrogateComponent { public: INLINE InterrogateComponent(InterrogateModuleDef *def = NULL); INLINE InterrogateComponent(const InterrogateComponent ©); diff --git a/dtool/src/interrogatedb/interrogateDatabase.h b/dtool/src/interrogatedb/interrogateDatabase.h index 8a6a313802..893fa23ba4 100644 --- a/dtool/src/interrogatedb/interrogateDatabase.h +++ b/dtool/src/interrogatedb/interrogateDatabase.h @@ -35,7 +35,7 @@ class IndexRemapper; // Description : This stores all of the interrogate data and handles // reading the data from a disk file when necessary. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateDatabase { +class EXPCL_INTERROGATEDB InterrogateDatabase { private: InterrogateDatabase(); diff --git a/dtool/src/interrogatedb/interrogateElement.h b/dtool/src/interrogatedb/interrogateElement.h index 863e502545..52d4f25b28 100644 --- a/dtool/src/interrogatedb/interrogateElement.h +++ b/dtool/src/interrogatedb/interrogateElement.h @@ -26,7 +26,7 @@ class IndexRemapper; // Description : An internal representation of a data element, like a // data member or a global variable. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateElement : public InterrogateComponent { +class EXPCL_INTERROGATEDB InterrogateElement : public InterrogateComponent { public: INLINE InterrogateElement(InterrogateModuleDef *def = NULL); INLINE InterrogateElement(const InterrogateElement ©); diff --git a/dtool/src/interrogatedb/interrogateFunction.h b/dtool/src/interrogatedb/interrogateFunction.h index 676eb53cf7..04132814f8 100644 --- a/dtool/src/interrogatedb/interrogateFunction.h +++ b/dtool/src/interrogatedb/interrogateFunction.h @@ -29,7 +29,7 @@ class CPPInstance; // Class : InterrogateFunction // Description : An internal representation of a function. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateFunction : public InterrogateComponent { +class EXPCL_INTERROGATEDB InterrogateFunction : public InterrogateComponent { public: InterrogateFunction(InterrogateModuleDef *def = NULL); InterrogateFunction(const InterrogateFunction ©); diff --git a/dtool/src/interrogatedb/interrogateFunctionWrapper.h b/dtool/src/interrogatedb/interrogateFunctionWrapper.h index 4eeae4d600..282b989961 100644 --- a/dtool/src/interrogatedb/interrogateFunctionWrapper.h +++ b/dtool/src/interrogatedb/interrogateFunctionWrapper.h @@ -27,7 +27,7 @@ class IndexRemapper; // Class : InterrogateFunctionWrapper // Description : An internal representation of a callable function. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateFunctionWrapper : public InterrogateComponent { +class EXPCL_INTERROGATEDB InterrogateFunctionWrapper : public InterrogateComponent { public: INLINE InterrogateFunctionWrapper(InterrogateModuleDef *def = NULL); INLINE InterrogateFunctionWrapper(const InterrogateFunctionWrapper ©); diff --git a/dtool/src/interrogatedb/interrogateMakeSeq.h b/dtool/src/interrogatedb/interrogateMakeSeq.h index 5ce472d4bf..bd991f71ca 100644 --- a/dtool/src/interrogatedb/interrogateMakeSeq.h +++ b/dtool/src/interrogatedb/interrogateMakeSeq.h @@ -26,7 +26,7 @@ class IndexRemapper; // Description : Represents a synthetic method created via the // MAKE_SEQ() macro. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateMakeSeq : public InterrogateComponent { +class EXPCL_INTERROGATEDB InterrogateMakeSeq : public InterrogateComponent { public: INLINE InterrogateMakeSeq(InterrogateModuleDef *def = NULL); INLINE InterrogateMakeSeq(const InterrogateMakeSeq ©); diff --git a/dtool/src/interrogatedb/interrogateManifest.h b/dtool/src/interrogatedb/interrogateManifest.h index d6d5d00192..4011868953 100644 --- a/dtool/src/interrogatedb/interrogateManifest.h +++ b/dtool/src/interrogatedb/interrogateManifest.h @@ -25,7 +25,7 @@ class IndexRemapper; // Class : InterrogateManifest // Description : An internal representation of a manifest constant. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateManifest : public InterrogateComponent { +class EXPCL_INTERROGATEDB InterrogateManifest : public InterrogateComponent { public: INLINE InterrogateManifest(InterrogateModuleDef *def = NULL); INLINE InterrogateManifest(const InterrogateManifest ©); diff --git a/dtool/src/interrogatedb/interrogateType.h b/dtool/src/interrogatedb/interrogateType.h index 365c2a2d40..5a6a88b311 100644 --- a/dtool/src/interrogatedb/interrogateType.h +++ b/dtool/src/interrogatedb/interrogateType.h @@ -29,7 +29,7 @@ class CPPScope; // Class : InterrogateType // Description : An internal representation of a type. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOLCONFIG InterrogateType : public InterrogateComponent { +class EXPCL_INTERROGATEDB InterrogateType : public InterrogateComponent { public: InterrogateType(InterrogateModuleDef *def = NULL); InterrogateType(const InterrogateType ©); diff --git a/dtool/src/interrogatedb/interrogate_interface.h b/dtool/src/interrogatedb/interrogate_interface.h index c1e615556f..9cbe879339 100644 --- a/dtool/src/interrogatedb/interrogate_interface.h +++ b/dtool/src/interrogatedb/interrogate_interface.h @@ -87,9 +87,9 @@ enum AtomicToken { AT_longlong = 8 }; -EXPCL_DTOOLCONFIG void interrogate_add_search_directory(const char *dirname); -EXPCL_DTOOLCONFIG void interrogate_add_search_path(const char *pathstring); -EXPCL_DTOOLCONFIG bool interrogate_error_flag(); +EXPCL_INTERROGATEDB void interrogate_add_search_directory(const char *dirname); +EXPCL_INTERROGATEDB void interrogate_add_search_path(const char *pathstring); +EXPCL_INTERROGATEDB bool interrogate_error_flag(); ////////////////////////////////////////////////////////////////////////// // @@ -107,23 +107,23 @@ EXPCL_DTOOLCONFIG bool interrogate_error_flag(); // (whatever type interrogate thinks it is), as returned by the getter // function given by interrogate_manifest_getter(). -EXPCL_DTOOLCONFIG int interrogate_number_of_manifests(); -EXPCL_DTOOLCONFIG ManifestIndex interrogate_get_manifest(int n); -EXPCL_DTOOLCONFIG ManifestIndex interrogate_get_manifest_by_name(const char *manifest_name); -EXPCL_DTOOLCONFIG const char *interrogate_manifest_name(ManifestIndex manifest); -EXPCL_DTOOLCONFIG const char *interrogate_manifest_definition(ManifestIndex manifest); -EXPCL_DTOOLCONFIG bool interrogate_manifest_has_type(ManifestIndex manifest); -EXPCL_DTOOLCONFIG TypeIndex interrogate_manifest_get_type(ManifestIndex manifest); -EXPCL_DTOOLCONFIG bool interrogate_manifest_has_getter(ManifestIndex manifest); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_manifest_getter(ManifestIndex manifest); +EXPCL_INTERROGATEDB int interrogate_number_of_manifests(); +EXPCL_INTERROGATEDB ManifestIndex interrogate_get_manifest(int n); +EXPCL_INTERROGATEDB ManifestIndex interrogate_get_manifest_by_name(const char *manifest_name); +EXPCL_INTERROGATEDB const char *interrogate_manifest_name(ManifestIndex manifest); +EXPCL_INTERROGATEDB const char *interrogate_manifest_definition(ManifestIndex manifest); +EXPCL_INTERROGATEDB bool interrogate_manifest_has_type(ManifestIndex manifest); +EXPCL_INTERROGATEDB TypeIndex interrogate_manifest_get_type(ManifestIndex manifest); +EXPCL_INTERROGATEDB bool interrogate_manifest_has_getter(ManifestIndex manifest); +EXPCL_INTERROGATEDB FunctionIndex interrogate_manifest_getter(ManifestIndex manifest); // An exception is made for manifest constants that have an integer // type value, since these are so common. The scripting language can // query these values directly, which saves having to generate a // wrapper function for each stupid little manifest. In this case, // there will be no getter function available. -EXPCL_DTOOLCONFIG bool interrogate_manifest_has_int_value(ManifestIndex manifest); -EXPCL_DTOOLCONFIG int interrogate_manifest_get_int_value(ManifestIndex manifest); +EXPCL_INTERROGATEDB bool interrogate_manifest_has_int_value(ManifestIndex manifest); +EXPCL_INTERROGATEDB int interrogate_manifest_get_int_value(ManifestIndex manifest); ////////////////////////////////////////////////////////////////////////// @@ -136,12 +136,12 @@ EXPCL_DTOOLCONFIG int interrogate_manifest_get_int_value(ManifestIndex manifest) // elements. Interrogate automatically generates a getter function // and, if possible, a setter function. -EXPCL_DTOOLCONFIG const char *interrogate_element_name(ElementIndex element); -EXPCL_DTOOLCONFIG const char *interrogate_element_scoped_name(ElementIndex element); -EXPCL_DTOOLCONFIG bool interrogate_element_has_comment(ElementIndex element); -EXPCL_DTOOLCONFIG const char *interrogate_element_comment(ElementIndex element); -EXPCL_DTOOLCONFIG ElementIndex interrogate_get_element_by_name(const char *element_name); -EXPCL_DTOOLCONFIG ElementIndex interrogate_get_element_by_scoped_name(const char *element_name); +EXPCL_INTERROGATEDB const char *interrogate_element_name(ElementIndex element); +EXPCL_INTERROGATEDB const char *interrogate_element_scoped_name(ElementIndex element); +EXPCL_INTERROGATEDB bool interrogate_element_has_comment(ElementIndex element); +EXPCL_INTERROGATEDB const char *interrogate_element_comment(ElementIndex element); +EXPCL_INTERROGATEDB ElementIndex interrogate_get_element_by_name(const char *element_name); +EXPCL_INTERROGATEDB ElementIndex interrogate_get_element_by_scoped_name(const char *element_name); // Be careful with this function. The element's bare type is not // likely to be directly useful to the scripting language. This is a @@ -151,12 +151,12 @@ EXPCL_DTOOLCONFIG ElementIndex interrogate_get_element_by_scoped_name(const char // scripting language can't handle directly, e.g. a Node, while the // getter will return (and the setter accept) a pointer to a Node, // which is what the scripting language actually works with. -EXPCL_DTOOLCONFIG TypeIndex interrogate_element_type(ElementIndex element); +EXPCL_INTERROGATEDB TypeIndex interrogate_element_type(ElementIndex element); -EXPCL_DTOOLCONFIG bool interrogate_element_has_getter(ElementIndex element); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_element_getter(ElementIndex element); -EXPCL_DTOOLCONFIG bool interrogate_element_has_setter(ElementIndex element); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_element_setter(ElementIndex element); +EXPCL_INTERROGATEDB bool interrogate_element_has_getter(ElementIndex element); +EXPCL_INTERROGATEDB FunctionIndex interrogate_element_getter(ElementIndex element); +EXPCL_INTERROGATEDB bool interrogate_element_has_setter(ElementIndex element); +EXPCL_INTERROGATEDB FunctionIndex interrogate_element_setter(ElementIndex element); ////////////////////////////////////////////////////////////////////////// // @@ -166,8 +166,8 @@ EXPCL_DTOOLCONFIG FunctionIndex interrogate_element_setter(ElementIndex element) // This is the list of global data elements. -EXPCL_DTOOLCONFIG int interrogate_number_of_globals(); -EXPCL_DTOOLCONFIG ElementIndex interrogate_get_global(int n); +EXPCL_INTERROGATEDB int interrogate_number_of_globals(); +EXPCL_INTERROGATEDB ElementIndex interrogate_get_global(int n); ////////////////////////////////////////////////////////////////////////// // @@ -183,16 +183,16 @@ EXPCL_DTOOLCONFIG ElementIndex interrogate_get_global(int n); // These are the global (nonmember) functions that appear outside of // any class definition. -EXPCL_DTOOLCONFIG int interrogate_number_of_global_functions(); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_get_global_function(int n); +EXPCL_INTERROGATEDB int interrogate_number_of_global_functions(); +EXPCL_INTERROGATEDB FunctionIndex interrogate_get_global_function(int n); // This can be used to traverse through *all* the functions known to // interrogate. It's usually not what you want, since this includes // global functions, class methods, and synthesized functions like // upcasts and downcasts. You probably want to use instead // interrogate_number_of_global_functions(), above. -EXPCL_DTOOLCONFIG int interrogate_number_of_functions(); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_get_function(int n); +EXPCL_INTERROGATEDB int interrogate_number_of_functions(); +EXPCL_INTERROGATEDB FunctionIndex interrogate_get_function(int n); // This is the function's name. It is not unique; it may be shared // between multiple different functions that have the same name but @@ -200,42 +200,42 @@ EXPCL_DTOOLCONFIG FunctionIndex interrogate_get_function(int n); // Two different classes might also have member functions that have // the same name, or the same name as a global function (but also see // the scoped_name, below). -EXPCL_DTOOLCONFIG const char *interrogate_function_name(FunctionIndex function); +EXPCL_INTERROGATEDB const char *interrogate_function_name(FunctionIndex function); // The scoped name is the function name prefixed with the name of the // class that includes the function, if the function is a class // method. If it is a global function, the scoped name is the same as // the name returned above. In the absence of C++ function // overloading, this name will be unique to each function. -EXPCL_DTOOLCONFIG const char *interrogate_function_scoped_name(FunctionIndex function); +EXPCL_INTERROGATEDB const char *interrogate_function_scoped_name(FunctionIndex function); // This returns the C++ comment written for the function, either in // the header file or in the .C file, or both. -EXPCL_DTOOLCONFIG bool interrogate_function_has_comment(FunctionIndex function); -EXPCL_DTOOLCONFIG const char *interrogate_function_comment(FunctionIndex function); +EXPCL_INTERROGATEDB bool interrogate_function_has_comment(FunctionIndex function); +EXPCL_INTERROGATEDB const char *interrogate_function_comment(FunctionIndex function); // This defines the function prototype as it appears in the C++ // source, useful primarily for documentation purposes. -EXPCL_DTOOLCONFIG const char *interrogate_function_prototype(FunctionIndex function); +EXPCL_INTERROGATEDB const char *interrogate_function_prototype(FunctionIndex function); // This can be used to determine the class that the function is a // method for, if the function is a class method. -EXPCL_DTOOLCONFIG bool interrogate_function_is_method(FunctionIndex function); -EXPCL_DTOOLCONFIG TypeIndex interrogate_function_class(FunctionIndex function); +EXPCL_INTERROGATEDB bool interrogate_function_is_method(FunctionIndex function); +EXPCL_INTERROGATEDB TypeIndex interrogate_function_class(FunctionIndex function); // This returns the module name reported for the function, if // available. -EXPCL_DTOOLCONFIG bool interrogate_function_has_module_name(FunctionIndex function); -EXPCL_DTOOLCONFIG const char *interrogate_function_module_name(FunctionIndex function); +EXPCL_INTERROGATEDB bool interrogate_function_has_module_name(FunctionIndex function); +EXPCL_INTERROGATEDB const char *interrogate_function_module_name(FunctionIndex function); // This returns the library name reported for the function, if // available. -EXPCL_DTOOLCONFIG bool interrogate_function_has_library_name(FunctionIndex function); -EXPCL_DTOOLCONFIG const char *interrogate_function_library_name(FunctionIndex function); +EXPCL_INTERROGATEDB bool interrogate_function_has_library_name(FunctionIndex function); +EXPCL_INTERROGATEDB const char *interrogate_function_library_name(FunctionIndex function); // This is true for virtual member functions. It's not likely that // this will be important to the scripting language. -EXPCL_DTOOLCONFIG bool interrogate_function_is_virtual(FunctionIndex function); +EXPCL_INTERROGATEDB bool interrogate_function_is_virtual(FunctionIndex function); // The actual callable function interface is defined via one or more @@ -246,11 +246,11 @@ EXPCL_DTOOLCONFIG bool interrogate_function_is_virtual(FunctionIndex function); // calling convention or the Python calling convention. The set of // wrappers that will actually be available depends on the parameters // passed to the interrogate command line. -EXPCL_DTOOLCONFIG int interrogate_function_number_of_c_wrappers(FunctionIndex function); -EXPCL_DTOOLCONFIG FunctionWrapperIndex interrogate_function_c_wrapper(FunctionIndex function, int n); +EXPCL_INTERROGATEDB int interrogate_function_number_of_c_wrappers(FunctionIndex function); +EXPCL_INTERROGATEDB FunctionWrapperIndex interrogate_function_c_wrapper(FunctionIndex function, int n); -EXPCL_DTOOLCONFIG int interrogate_function_number_of_python_wrappers(FunctionIndex function); -EXPCL_DTOOLCONFIG FunctionWrapperIndex interrogate_function_python_wrapper(FunctionIndex function, int n); +EXPCL_INTERROGATEDB int interrogate_function_number_of_python_wrappers(FunctionIndex function); +EXPCL_INTERROGATEDB FunctionWrapperIndex interrogate_function_python_wrapper(FunctionIndex function, int n); ////////////////////////////////////////////////////////////////////////// // @@ -273,17 +273,17 @@ EXPCL_DTOOLCONFIG FunctionWrapperIndex interrogate_function_python_wrapper(Funct // Don't confuse this with the unique_name, below. The two are // related, but not identical. -EXPCL_DTOOLCONFIG const char *interrogate_wrapper_name(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB const char *interrogate_wrapper_name(FunctionWrapperIndex wrapper); // This returns true if -fnames was given to interrogate, making the // wrapper function callable directly by its name. -EXPCL_DTOOLCONFIG bool interrogate_wrapper_is_callable_by_name(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB bool interrogate_wrapper_is_callable_by_name(FunctionWrapperIndex wrapper); // This returns the C++ comment written for the function wrapper, // usually from the .cpp file. There may be a different comment for // each overload of a given function. -EXPCL_DTOOLCONFIG bool interrogate_wrapper_has_comment(FunctionWrapperIndex wrapper); -EXPCL_DTOOLCONFIG const char *interrogate_wrapper_comment(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB bool interrogate_wrapper_has_comment(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB const char *interrogate_wrapper_comment(FunctionWrapperIndex wrapper); // Every function wrapper has zero or more parameters and may or may // not have a return value. Each parameter has a type and may or may @@ -293,8 +293,8 @@ EXPCL_DTOOLCONFIG const char *interrogate_wrapper_comment(FunctionWrapperIndex w // its first parameter, it is a static member function, also called a // class method.) -EXPCL_DTOOLCONFIG bool interrogate_wrapper_has_return_value(FunctionWrapperIndex wrapper); -EXPCL_DTOOLCONFIG TypeIndex interrogate_wrapper_return_type(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB bool interrogate_wrapper_has_return_value(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB TypeIndex interrogate_wrapper_return_type(FunctionWrapperIndex wrapper); // Sometimes interrogate must synthesize a wrapper that allocates its // return value from the free store. Other times (especially if @@ -309,15 +309,15 @@ EXPCL_DTOOLCONFIG TypeIndex interrogate_wrapper_return_type(FunctionWrapperIndex // that for the class). Otherwise, this function will return false, // and the scripting language should *not* call any destructor on this // value. -EXPCL_DTOOLCONFIG bool interrogate_wrapper_caller_manages_return_value(FunctionWrapperIndex wrapper); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_wrapper_return_value_destructor(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB bool interrogate_wrapper_caller_manages_return_value(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB FunctionIndex interrogate_wrapper_return_value_destructor(FunctionWrapperIndex wrapper); // These define the parameters of the function. -EXPCL_DTOOLCONFIG int interrogate_wrapper_number_of_parameters(FunctionWrapperIndex wrapper); -EXPCL_DTOOLCONFIG TypeIndex interrogate_wrapper_parameter_type(FunctionWrapperIndex wrapper, int n); -EXPCL_DTOOLCONFIG bool interrogate_wrapper_parameter_has_name(FunctionWrapperIndex wrapper, int n); -EXPCL_DTOOLCONFIG const char *interrogate_wrapper_parameter_name(FunctionWrapperIndex wrapper, int n); -EXPCL_DTOOLCONFIG bool interrogate_wrapper_parameter_is_this(FunctionWrapperIndex wrapper, int n); +EXPCL_INTERROGATEDB int interrogate_wrapper_number_of_parameters(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB TypeIndex interrogate_wrapper_parameter_type(FunctionWrapperIndex wrapper, int n); +EXPCL_INTERROGATEDB bool interrogate_wrapper_parameter_has_name(FunctionWrapperIndex wrapper, int n); +EXPCL_INTERROGATEDB const char *interrogate_wrapper_parameter_name(FunctionWrapperIndex wrapper, int n); +EXPCL_INTERROGATEDB bool interrogate_wrapper_parameter_is_this(FunctionWrapperIndex wrapper, int n); // This returns a pointer to a function that may be called to invoke // the function, if the -fptrs option to return function pointers was @@ -327,8 +327,8 @@ EXPCL_DTOOLCONFIG bool interrogate_wrapper_parameter_is_this(FunctionWrapperInde // These two functions may be called without forcing a load of the // complete interrogate database. -EXPCL_DTOOLCONFIG bool interrogate_wrapper_has_pointer(FunctionWrapperIndex wrapper); -EXPCL_DTOOLCONFIG void *interrogate_wrapper_pointer(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB bool interrogate_wrapper_has_pointer(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB void *interrogate_wrapper_pointer(FunctionWrapperIndex wrapper); // This function will return a name that is guaranteed to be unique to // this particular function wrapper, and that will (usually) be @@ -339,7 +339,7 @@ EXPCL_DTOOLCONFIG void *interrogate_wrapper_pointer(FunctionWrapperIndex wrapper // The unique name is an ugly hashed name, not safe for human // consumption. Its sole purpose is to provide some consistent way to // identify function wrappers between sessions. -EXPCL_DTOOLCONFIG const char *interrogate_wrapper_unique_name(FunctionWrapperIndex wrapper); +EXPCL_INTERROGATEDB const char *interrogate_wrapper_unique_name(FunctionWrapperIndex wrapper); // This function provides a reverse-lookup on the above unique name, // returning the wrapper index corresponding to the given name. It @@ -349,7 +349,7 @@ EXPCL_DTOOLCONFIG const char *interrogate_wrapper_unique_name(FunctionWrapperInd // This function may be called without forcing a load of the complete // interrogate database. -EXPCL_DTOOLCONFIG FunctionWrapperIndex interrogate_get_wrapper_by_unique_name(const char *unique_name); +EXPCL_INTERROGATEDB FunctionWrapperIndex interrogate_get_wrapper_by_unique_name(const char *unique_name); ////////////////////////////////////////////////////////////////////////// // @@ -364,14 +364,14 @@ EXPCL_DTOOLCONFIG FunctionWrapperIndex interrogate_get_wrapper_by_unique_name(co // get_things(). // The class of which the make_seq is a method. -EXPCL_DTOOLCONFIG TypeIndex interrogate_make_seq_class(MakeSeqIndex make_seq); +EXPCL_INTERROGATEDB TypeIndex interrogate_make_seq_class(MakeSeqIndex make_seq); // The name of the syntheized method, e.g. "get_things" -EXPCL_DTOOLCONFIG const char *interrogate_make_seq_seq_name(MakeSeqIndex make_seq); +EXPCL_INTERROGATEDB const char *interrogate_make_seq_seq_name(MakeSeqIndex make_seq); // The name of the real method that returns the length, e.g. "get_num_things" -EXPCL_DTOOLCONFIG const char *interrogate_make_seq_num_name(MakeSeqIndex make_seq); +EXPCL_INTERROGATEDB const char *interrogate_make_seq_num_name(MakeSeqIndex make_seq); // The name of the real method that returns the nth element, e.g. "get_thing" -EXPCL_DTOOLCONFIG const char *interrogate_make_seq_element_name(MakeSeqIndex make_seq); +EXPCL_INTERROGATEDB const char *interrogate_make_seq_element_name(MakeSeqIndex make_seq); ////////////////////////////////////////////////////////////////////////// @@ -393,16 +393,16 @@ EXPCL_DTOOLCONFIG const char *interrogate_make_seq_element_name(MakeSeqIndex mak // classes. These types are necessary to fully define all of the // function parameters, but need not themselves be wrapped. -EXPCL_DTOOLCONFIG int interrogate_number_of_global_types(); -EXPCL_DTOOLCONFIG TypeIndex interrogate_get_global_type(int n); -EXPCL_DTOOLCONFIG int interrogate_number_of_types(); -EXPCL_DTOOLCONFIG TypeIndex interrogate_get_type(int n); -EXPCL_DTOOLCONFIG TypeIndex interrogate_get_type_by_name(const char *type_name); -EXPCL_DTOOLCONFIG TypeIndex interrogate_get_type_by_scoped_name(const char *type_name); -EXPCL_DTOOLCONFIG TypeIndex interrogate_get_type_by_true_name(const char *type_name); -EXPCL_DTOOLCONFIG const char *interrogate_type_name(TypeIndex type); -EXPCL_DTOOLCONFIG const char *interrogate_type_scoped_name(TypeIndex type); -EXPCL_DTOOLCONFIG const char *interrogate_type_true_name(TypeIndex type); +EXPCL_INTERROGATEDB int interrogate_number_of_global_types(); +EXPCL_INTERROGATEDB TypeIndex interrogate_get_global_type(int n); +EXPCL_INTERROGATEDB int interrogate_number_of_types(); +EXPCL_INTERROGATEDB TypeIndex interrogate_get_type(int n); +EXPCL_INTERROGATEDB TypeIndex interrogate_get_type_by_name(const char *type_name); +EXPCL_INTERROGATEDB TypeIndex interrogate_get_type_by_scoped_name(const char *type_name); +EXPCL_INTERROGATEDB TypeIndex interrogate_get_type_by_true_name(const char *type_name); +EXPCL_INTERROGATEDB const char *interrogate_type_name(TypeIndex type); +EXPCL_INTERROGATEDB const char *interrogate_type_scoped_name(TypeIndex type); +EXPCL_INTERROGATEDB const char *interrogate_type_true_name(TypeIndex type); // A given type might be a nested type, meaning it is entirely defined // within (and scoped within) some different C++ class. In this case, @@ -410,32 +410,32 @@ EXPCL_DTOOLCONFIG const char *interrogate_type_true_name(TypeIndex type); // within the class, while the scoped_name() will return the // fully-qualified name of the type, and is_nested() and outer_class() // can be used to determine the class it is nested within. -EXPCL_DTOOLCONFIG bool interrogate_type_is_nested(TypeIndex type); -EXPCL_DTOOLCONFIG TypeIndex interrogate_type_outer_class(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_nested(TypeIndex type); +EXPCL_INTERROGATEDB TypeIndex interrogate_type_outer_class(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_has_comment(TypeIndex type); -EXPCL_DTOOLCONFIG const char *interrogate_type_comment(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_has_comment(TypeIndex type); +EXPCL_INTERROGATEDB const char *interrogate_type_comment(TypeIndex type); // This returns the module name reported for the type, if available. -EXPCL_DTOOLCONFIG bool interrogate_type_has_module_name(TypeIndex type); -EXPCL_DTOOLCONFIG const char *interrogate_type_module_name(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_has_module_name(TypeIndex type); +EXPCL_INTERROGATEDB const char *interrogate_type_module_name(TypeIndex type); // This returns the library name reported for the type, if available. -EXPCL_DTOOLCONFIG bool interrogate_type_has_library_name(TypeIndex type); -EXPCL_DTOOLCONFIG const char *interrogate_type_library_name(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_has_library_name(TypeIndex type); +EXPCL_INTERROGATEDB const char *interrogate_type_library_name(TypeIndex type); // If interrogate_type_is_atomic() returns true, the type is one of // the basic C types enumerated in AtomicToken, above. The type may // then be further modified by one or more of unsigned, signed, long, // longlong, or short. However, it will not be a pointer. -EXPCL_DTOOLCONFIG bool interrogate_type_is_atomic(TypeIndex type); -EXPCL_DTOOLCONFIG AtomicToken interrogate_type_atomic_token(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_unsigned(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_signed(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_long(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_longlong(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_short(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_atomic(TypeIndex type); +EXPCL_INTERROGATEDB AtomicToken interrogate_type_atomic_token(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_unsigned(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_signed(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_long(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_longlong(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_short(TypeIndex type); // If interrogate_type_is_wrapped() returns true, this is a composite // type "wrapped" around some simpler type, for instance a pointer to @@ -444,21 +444,21 @@ EXPCL_DTOOLCONFIG bool interrogate_type_is_short(TypeIndex type); // they use multiple wrappers. A const char pointer, for example, is // represented as a pointer wrapper around a const wrapper around an // atomic char.) -EXPCL_DTOOLCONFIG bool interrogate_type_is_wrapped(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_pointer(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_const(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_typedef(TypeIndex type); -EXPCL_DTOOLCONFIG TypeIndex interrogate_type_wrapped_type(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_wrapped(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_pointer(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_const(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_typedef(TypeIndex type); +EXPCL_INTERROGATEDB TypeIndex interrogate_type_wrapped_type(TypeIndex type); // If interrogate_type_is_enum() returns true, this is an enumerated // type, which means it may take any one of a number of named integer // values. -EXPCL_DTOOLCONFIG bool interrogate_type_is_enum(TypeIndex type); -EXPCL_DTOOLCONFIG int interrogate_type_number_of_enum_values(TypeIndex type); -EXPCL_DTOOLCONFIG const char *interrogate_type_enum_value_name(TypeIndex type, int n); -EXPCL_DTOOLCONFIG const char *interrogate_type_enum_value_scoped_name(TypeIndex type, int n); -EXPCL_DTOOLCONFIG const char *interrogate_type_enum_value_comment(TypeIndex type, int n); -EXPCL_DTOOLCONFIG int interrogate_type_enum_value(TypeIndex type, int n); +EXPCL_INTERROGATEDB bool interrogate_type_is_enum(TypeIndex type); +EXPCL_INTERROGATEDB int interrogate_type_number_of_enum_values(TypeIndex type); +EXPCL_INTERROGATEDB const char *interrogate_type_enum_value_name(TypeIndex type, int n); +EXPCL_INTERROGATEDB const char *interrogate_type_enum_value_scoped_name(TypeIndex type, int n); +EXPCL_INTERROGATEDB const char *interrogate_type_enum_value_comment(TypeIndex type, int n); +EXPCL_INTERROGATEDB int interrogate_type_enum_value(TypeIndex type, int n); // If none of the above is true, the type is some extension type. It // may be a struct, class, or union (and the distinction between these @@ -466,19 +466,19 @@ EXPCL_DTOOLCONFIG int interrogate_type_enum_value(TypeIndex type, int n); // any case, it may contain zero or more constructors, zero or one // destructor, zero or more member functions, and zero or more data // members; all of the remaining type functions may apply. -EXPCL_DTOOLCONFIG bool interrogate_type_is_struct(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_class(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_is_union(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_struct(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_class(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_union(TypeIndex type); // If is_fully_defined() returns false, this class/struct was a // forward reference, and we really don't know anything about it. (In // this case, it will appear to have no methods or members.) -EXPCL_DTOOLCONFIG bool interrogate_type_is_fully_defined(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_fully_defined(TypeIndex type); // If is_unpublished() returns false, the class/struct is unknown // because it was not marked to be published (or, in promiscuous mode, // it is a protected or private nested class). -EXPCL_DTOOLCONFIG bool interrogate_type_is_unpublished(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_is_unpublished(TypeIndex type); // Otherwise, especially if the type is a struct or class, we may have // a number of member functions, including zero or more constructors @@ -499,36 +499,36 @@ EXPCL_DTOOLCONFIG bool interrogate_type_is_unpublished(TypeIndex type); // same function index as the one returned by the ancestor class, and // interrogate_type_destructor_is_inherited() will return true for // this class. -EXPCL_DTOOLCONFIG int interrogate_type_number_of_constructors(TypeIndex type); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_type_get_constructor(TypeIndex type, int n); -EXPCL_DTOOLCONFIG bool interrogate_type_has_destructor(TypeIndex type); -EXPCL_DTOOLCONFIG bool interrogate_type_destructor_is_inherited(TypeIndex type); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_type_get_destructor(TypeIndex type); +EXPCL_INTERROGATEDB int interrogate_type_number_of_constructors(TypeIndex type); +EXPCL_INTERROGATEDB FunctionIndex interrogate_type_get_constructor(TypeIndex type, int n); +EXPCL_INTERROGATEDB bool interrogate_type_has_destructor(TypeIndex type); +EXPCL_INTERROGATEDB bool interrogate_type_destructor_is_inherited(TypeIndex type); +EXPCL_INTERROGATEDB FunctionIndex interrogate_type_get_destructor(TypeIndex type); // This is the set of exposed data elements in the struct or class. -EXPCL_DTOOLCONFIG int interrogate_type_number_of_elements(TypeIndex type); -EXPCL_DTOOLCONFIG ElementIndex interrogate_type_get_element(TypeIndex type, int n); +EXPCL_INTERROGATEDB int interrogate_type_number_of_elements(TypeIndex type); +EXPCL_INTERROGATEDB ElementIndex interrogate_type_get_element(TypeIndex type, int n); // This is the set of exposed member functions in the struct or class. -EXPCL_DTOOLCONFIG int interrogate_type_number_of_methods(TypeIndex type); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_type_get_method(TypeIndex type, int n); +EXPCL_INTERROGATEDB int interrogate_type_number_of_methods(TypeIndex type); +EXPCL_INTERROGATEDB FunctionIndex interrogate_type_get_method(TypeIndex type, int n); // This is the set of MAKE_SEQ wrappers in the struct or class. -EXPCL_DTOOLCONFIG int interrogate_type_number_of_make_seqs(TypeIndex type); -EXPCL_DTOOLCONFIG MakeSeqIndex interrogate_type_get_make_seq(TypeIndex type, int n); +EXPCL_INTERROGATEDB int interrogate_type_number_of_make_seqs(TypeIndex type); +EXPCL_INTERROGATEDB MakeSeqIndex interrogate_type_get_make_seq(TypeIndex type, int n); // A C++ class may also define a number of explicit cast operators, // which define how to convert an object of this type to an object of // some other type (the type can be inferred by the return type of the // cast function). This is not related to upcast and downcast, // defined below. -EXPCL_DTOOLCONFIG int interrogate_type_number_of_casts(TypeIndex type); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_type_get_cast(TypeIndex type, int n); +EXPCL_INTERROGATEDB int interrogate_type_number_of_casts(TypeIndex type); +EXPCL_INTERROGATEDB FunctionIndex interrogate_type_get_cast(TypeIndex type, int n); // A C++ class may inherit from zero or more base classes. This // defines the list of base classes for this particular type. -EXPCL_DTOOLCONFIG int interrogate_type_number_of_derivations(TypeIndex type); -EXPCL_DTOOLCONFIG TypeIndex interrogate_type_get_derivation(TypeIndex type, int n); +EXPCL_INTERROGATEDB int interrogate_type_number_of_derivations(TypeIndex type); +EXPCL_INTERROGATEDB TypeIndex interrogate_type_get_derivation(TypeIndex type, int n); // For each base class, we might need to define an explicit upcast or // downcast operation to convert the pointer to the derived class to @@ -544,8 +544,8 @@ EXPCL_DTOOLCONFIG TypeIndex interrogate_type_get_derivation(TypeIndex type, int // class. If this returns false, you may simply use the same pointer // as either a derived class pointer or a base class pointer without // any extra step. -EXPCL_DTOOLCONFIG bool interrogate_type_derivation_has_upcast(TypeIndex type, int n); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_type_get_upcast(TypeIndex type, int n); +EXPCL_INTERROGATEDB bool interrogate_type_derivation_has_upcast(TypeIndex type, int n); +EXPCL_INTERROGATEDB FunctionIndex interrogate_type_get_upcast(TypeIndex type, int n); // Although it is always possible to upcast a pointer to a base class, // it is not always possible to downcast from a base class to the @@ -555,14 +555,14 @@ EXPCL_DTOOLCONFIG FunctionIndex interrogate_type_get_upcast(TypeIndex type, int // way as upcasting. (Of course, it is the caller's responsibility to // guarantee that the pointer actually represents an object of the // type being downcast to.) -EXPCL_DTOOLCONFIG bool interrogate_type_derivation_downcast_is_impossible(TypeIndex type, int n); -EXPCL_DTOOLCONFIG bool interrogate_type_derivation_has_downcast(TypeIndex type, int n); -EXPCL_DTOOLCONFIG FunctionIndex interrogate_type_get_downcast(TypeIndex type, int n); +EXPCL_INTERROGATEDB bool interrogate_type_derivation_downcast_is_impossible(TypeIndex type, int n); +EXPCL_INTERROGATEDB bool interrogate_type_derivation_has_downcast(TypeIndex type, int n); +EXPCL_INTERROGATEDB FunctionIndex interrogate_type_get_downcast(TypeIndex type, int n); // A C++ class may also define any number of nested types--classes or // enums defined within the scope of this class. -EXPCL_DTOOLCONFIG int interrogate_type_number_of_nested_types(TypeIndex type); -EXPCL_DTOOLCONFIG TypeIndex interrogate_type_get_nested_type(TypeIndex type, int n); +EXPCL_INTERROGATEDB int interrogate_type_number_of_nested_types(TypeIndex type); +EXPCL_INTERROGATEDB TypeIndex interrogate_type_get_nested_type(TypeIndex type, int n); #ifdef __cplusplus } diff --git a/dtool/src/interrogatedb/interrogate_request.h b/dtool/src/interrogatedb/interrogate_request.h index 063b04f2ec..06d8bfb1a4 100644 --- a/dtool/src/interrogatedb/interrogate_request.h +++ b/dtool/src/interrogatedb/interrogate_request.h @@ -39,7 +39,7 @@ extern "C" { * data available, but doesn't allow matching the database information * up with any compiled-in function wrappers or anything. */ -EXPCL_DTOOLCONFIG void interrogate_request_database(const char *database_filename); +EXPCL_INTERROGATEDB void interrogate_request_database(const char *database_filename); @@ -74,7 +74,7 @@ typedef struct { * This includes all of the function pointers and/or unique names that * might be compiled in. */ -EXPCL_DTOOLCONFIG void interrogate_request_module(InterrogateModuleDef *def); +EXPCL_INTERROGATEDB void interrogate_request_module(InterrogateModuleDef *def); #ifdef __cplusplus } diff --git a/dtool/src/interrogatedb/p3interrogatedb_composite2.cxx b/dtool/src/interrogatedb/p3interrogatedb_composite2.cxx index e56075e2d0..c6b6c61362 100644 --- a/dtool/src/interrogatedb/p3interrogatedb_composite2.cxx +++ b/dtool/src/interrogatedb/p3interrogatedb_composite2.cxx @@ -5,7 +5,6 @@ #include "interrogate_interface.cxx" #include "interrogate_request.cxx" #include "py_panda.cxx" -#include "vector_int.cxx" diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 755f0760e6..0278a84ce1 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -848,7 +848,7 @@ PyObject *map_deepcopy_to_copy(PyObject *self, PyObject *args) { // to whether the indicated value will fit. //////////////////////////////////////////////////////////////////// #if PY_MAJOR_VERSION < 3 -EXPCL_DTOOLCONFIG PyObject * +EXPCL_INTERROGATEDB PyObject * PyLongOrInt_FromUnsignedLong(unsigned long value) { if ((long)value < 0) { return PyLong_FromUnsignedLong(value); diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 5a78786aa4..d7bd7b7ca5 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -187,7 +187,7 @@ struct Dtool_PyInstDef { //////////////////////////////////////////////////////////////////////// // A Offset Dictionary Defining How to read the Above Object.. //////////////////////////////////////////////////////////////////////// -extern EXPCL_DTOOLCONFIG PyMemberDef standard_type_members[]; +extern EXPCL_INTERROGATEDB PyMemberDef standard_type_members[]; //////////////////////////////////////////////////////////////////////// // The Class Definition Structor For a Dtool python type. @@ -281,7 +281,7 @@ static void Dtool_FreeInstance_##CLASS_NAME(PyObject *self) {\ //////////////////////////////////////////////////////////////////////// /// Simple Recognition Functions.. //////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG bool DtoolCanThisBeAPandaInstance(PyObject *self); +EXPCL_INTERROGATEDB bool DtoolCanThisBeAPandaInstance(PyObject *self); /////////////////////////////////////////////////////////////////////////////// // ** HACK ** allert.. @@ -291,15 +291,15 @@ EXPCL_DTOOLCONFIG bool DtoolCanThisBeAPandaInstance(PyObject *self); // /////////////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG void RegisterNamedClass(const string &name, Dtool_PyTypedObject &otype); -EXPCL_DTOOLCONFIG void RegisterRuntimeTypedClass(Dtool_PyTypedObject &otype); +EXPCL_INTERROGATEDB void RegisterNamedClass(const string &name, Dtool_PyTypedObject &otype); +EXPCL_INTERROGATEDB void RegisterRuntimeTypedClass(Dtool_PyTypedObject &otype); -EXPCL_DTOOLCONFIG Dtool_PyTypedObject *LookupNamedClass(const string &name); -EXPCL_DTOOLCONFIG Dtool_PyTypedObject *LookupRuntimeTypedClass(TypeHandle handle); +EXPCL_INTERROGATEDB Dtool_PyTypedObject *LookupNamedClass(const string &name); +EXPCL_INTERROGATEDB Dtool_PyTypedObject *LookupRuntimeTypedClass(TypeHandle handle); /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG Dtool_PyTypedObject *Dtool_RuntimeTypeDtoolType(int type); +EXPCL_INTERROGATEDB Dtool_PyTypedObject *Dtool_RuntimeTypeDtoolType(int type); //////////////////////////////////////////////////////////////////////// // Function : DTOOL_Call_ExtractThisPointerForType @@ -309,15 +309,15 @@ EXPCL_DTOOLCONFIG Dtool_PyTypedObject *Dtool_RuntimeTypeDtoolType(int type); // with these as the generated code depends on how this is set // up.. //////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject *classdef, void **answer); +EXPCL_INTERROGATEDB void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject *classdef, void **answer); -EXPCL_DTOOLCONFIG void *DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, int param, const string &function_name, bool const_ok, bool report_errors); +EXPCL_INTERROGATEDB void *DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, int param, const string &function_name, bool const_ok, bool report_errors); -EXPCL_DTOOLCONFIG void *DTOOL_Call_GetPointerThis(PyObject *self); +EXPCL_INTERROGATEDB void *DTOOL_Call_GetPointerThis(PyObject *self); -EXPCL_DTOOLCONFIG bool Dtool_Call_ExtractThisPointer(PyObject *self, Dtool_PyTypedObject &classdef, void **answer); +EXPCL_INTERROGATEDB bool Dtool_Call_ExtractThisPointer(PyObject *self, Dtool_PyTypedObject &classdef, void **answer); -EXPCL_DTOOLCONFIG bool Dtool_Call_ExtractThisPointer_NonConst(PyObject *self, Dtool_PyTypedObject &classdef, +EXPCL_INTERROGATEDB bool Dtool_Call_ExtractThisPointer_NonConst(PyObject *self, Dtool_PyTypedObject &classdef, void **answer, const char *method_name); template INLINE bool DTOOL_Call_ExtractThisPointer(PyObject *self, T *&into) { @@ -338,15 +338,15 @@ template INLINE bool DTOOL_Call_ExtractThisPointer(PyObject *self, T *& // _PyErr_OCCURRED is an undocumented inline version of PyErr_Occurred. #define Dtool_CheckErrorOccurred() (_PyErr_OCCURRED() != NULL) #else -EXPCL_DTOOLCONFIG bool Dtool_CheckErrorOccurred(); +EXPCL_INTERROGATEDB bool Dtool_CheckErrorOccurred(); #endif -EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_AssertionError(); -EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_TypeError(const char *message); -EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_ArgTypeError(PyObject *obj, int param, const char *function_name, const char *type_name); -EXPCL_DTOOLCONFIG PyObject *Dtool_Raise_AttributeError(PyObject *obj, const char *attribute); +EXPCL_INTERROGATEDB PyObject *Dtool_Raise_AssertionError(); +EXPCL_INTERROGATEDB PyObject *Dtool_Raise_TypeError(const char *message); +EXPCL_INTERROGATEDB PyObject *Dtool_Raise_ArgTypeError(PyObject *obj, int param, const char *function_name, const char *type_name); +EXPCL_INTERROGATEDB PyObject *Dtool_Raise_AttributeError(PyObject *obj, const char *attribute); -EXPCL_DTOOLCONFIG PyObject *_Dtool_Raise_BadArgumentsError(); +EXPCL_INTERROGATEDB PyObject *_Dtool_Raise_BadArgumentsError(); #ifdef NDEBUG // Define it to a function that just prints a generic message. #define Dtool_Raise_BadArgumentsError(x) _Dtool_Raise_BadArgumentsError() @@ -355,9 +355,9 @@ EXPCL_DTOOLCONFIG PyObject *_Dtool_Raise_BadArgumentsError(); #define Dtool_Raise_BadArgumentsError(x) Dtool_Raise_TypeError("Arguments must match:\n" x) #endif -EXPCL_DTOOLCONFIG PyObject *_Dtool_Return_None(); -EXPCL_DTOOLCONFIG PyObject *Dtool_Return_Bool(bool value); -EXPCL_DTOOLCONFIG PyObject *_Dtool_Return(PyObject *value); +EXPCL_INTERROGATEDB PyObject *_Dtool_Return_None(); +EXPCL_INTERROGATEDB PyObject *Dtool_Return_Bool(bool value); +EXPCL_INTERROGATEDB PyObject *_Dtool_Return(PyObject *value); #ifdef NDEBUG #define Dtool_Return_None() (_PyErr_OCCURRED() != NULL ? NULL : (Py_INCREF(Py_None), Py_None)) @@ -373,13 +373,13 @@ EXPCL_DTOOLCONFIG PyObject *_Dtool_Return(PyObject *value); // this function relies on the behavior of typed objects in the panda system. // //////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG PyObject *DTool_CreatePyInstanceTyped(void *local_this_in, Dtool_PyTypedObject &known_class_type, bool memory_rules, bool is_const, int RunTimeType); +EXPCL_INTERROGATEDB PyObject *DTool_CreatePyInstanceTyped(void *local_this_in, Dtool_PyTypedObject &known_class_type, bool memory_rules, bool is_const, int RunTimeType); //////////////////////////////////////////////////////////////////////// // DTool_CreatePyInstance .. wrapper function to finalize the existance of a general // dtool py instance.. //////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG PyObject *DTool_CreatePyInstance(void *local_this, Dtool_PyTypedObject &in_classdef, bool memory_rules, bool is_const); +EXPCL_INTERROGATEDB PyObject *DTool_CreatePyInstance(void *local_this, Dtool_PyTypedObject &in_classdef, bool memory_rules, bool is_const); // These template methods allow use when the Dtool_PyTypedObject is not known. // They require a get_class_type() to be defined for the class. @@ -450,7 +450,7 @@ Define_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME) /////////////////////////////////////////////////////////////////////////////// /// Th Finalizer for simple instances.. /////////////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG int DTool_PyInit_Finalize(PyObject *self, void *This, Dtool_PyTypedObject *type, bool memory_rules, bool is_const); +EXPCL_INTERROGATEDB int DTool_PyInit_Finalize(PyObject *self, void *This, Dtool_PyTypedObject *type, bool memory_rules, bool is_const); /////////////////////////////////////////////////////////////////////////////// /// A heler function to glu methed definition together .. that can not be done at @@ -459,7 +459,7 @@ EXPCL_DTOOLCONFIG int DTool_PyInit_Finalize(PyObject *self, void *This, Dtool_Py /////////////////////////////////////////////////////////////////////////////// typedef std::map MethodDefmap; -EXPCL_DTOOLCONFIG void Dtool_Accum_MethDefs(PyMethodDef in[], MethodDefmap &themap); +EXPCL_INTERROGATEDB void Dtool_Accum_MethDefs(PyMethodDef in[], MethodDefmap &themap); /////////////////////////////////////////////////////////////////////////////// //// We need a way to runtime merge compile units into a python "Module" .. this is done with the @@ -471,9 +471,9 @@ struct LibraryDef { /////////////////////////////////////////////////////////////////////////////// #if PY_MAJOR_VERSION >= 3 -EXPCL_DTOOLCONFIG PyObject *Dtool_PyModuleInitHelper(LibraryDef *defs[], PyModuleDef *module_def); +EXPCL_INTERROGATEDB PyObject *Dtool_PyModuleInitHelper(LibraryDef *defs[], PyModuleDef *module_def); #else -EXPCL_DTOOLCONFIG PyObject *Dtool_PyModuleInitHelper(LibraryDef *defs[], const char *modulename); +EXPCL_INTERROGATEDB PyObject *Dtool_PyModuleInitHelper(LibraryDef *defs[], const char *modulename); #endif /////////////////////////////////////////////////////////////////////////////// @@ -484,16 +484,16 @@ EXPCL_DTOOLCONFIG PyObject *Dtool_PyModuleInitHelper(LibraryDef *defs[], const c // Required to support fom historical inharatence in the for of "is this instance of".. // /////////////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG PyObject *Dtool_BorrowThisReference(PyObject *self, PyObject *args); +EXPCL_INTERROGATEDB PyObject *Dtool_BorrowThisReference(PyObject *self, PyObject *args); ////////////////////////////////////////////////////////////////////////////////////////////// // We do expose a dictionay for dtool classes .. this should be removed at some point.. ////////////////////////////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG PyObject *Dtool_AddToDictionary(PyObject *self1, PyObject *args); +EXPCL_INTERROGATEDB PyObject *Dtool_AddToDictionary(PyObject *self1, PyObject *args); /////////////////////////////////////////////////////////////////////////////////// -EXPCL_DTOOLCONFIG Py_hash_t DTOOL_PyObject_HashPointer(PyObject *obj); +EXPCL_INTERROGATEDB Py_hash_t DTOOL_PyObject_HashPointer(PyObject *obj); /* Compare v to w. Return -1 if v < w or exception (PyErr_Occurred() true in latter case). @@ -503,28 +503,28 @@ EXPCL_DTOOLCONFIG Py_hash_t DTOOL_PyObject_HashPointer(PyObject *obj); XXX of error. */ -EXPCL_DTOOLCONFIG int DTOOL_PyObject_ComparePointers(PyObject *v1, PyObject *v2); -EXPCL_DTOOLCONFIG int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2); +EXPCL_INTERROGATEDB int DTOOL_PyObject_ComparePointers(PyObject *v1, PyObject *v2); +EXPCL_INTERROGATEDB int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2); -EXPCL_DTOOLCONFIG PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op); +EXPCL_INTERROGATEDB PyObject *DTOOL_PyObject_RichCompare(PyObject *v1, PyObject *v2, int op); -EXPCL_DTOOLCONFIG PyObject * +EXPCL_INTERROGATEDB PyObject * copy_from_make_copy(PyObject *self, PyObject *noargs); -EXPCL_DTOOLCONFIG PyObject * +EXPCL_INTERROGATEDB PyObject * copy_from_copy_constructor(PyObject *self, PyObject *noargs); -EXPCL_DTOOLCONFIG PyObject * +EXPCL_INTERROGATEDB PyObject * map_deepcopy_to_copy(PyObject *self, PyObject *args); #if PY_MAJOR_VERSION < 3 // In the Python 3 case, it is defined as a macro, at the beginning of this file. -EXPCL_DTOOLCONFIG PyObject * +EXPCL_INTERROGATEDB PyObject * PyLongOrInt_FromUnsignedLong(unsigned long value); #endif -EXPCL_DTOOLCONFIG extern struct Dtool_PyTypedObject Dtool_DTOOL_SUPER_BASE; -EXPCL_DTOOLCONFIG extern void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module); +EXPCL_INTERROGATEDB extern struct Dtool_PyTypedObject Dtool_DTOOL_SUPER_BASE; +EXPCL_INTERROGATEDB extern void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module); #define Dtool_Ptr_DTOOL_SUPER_BASE (&Dtool_DTOOL_SUPER_BASE) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index c434c97c89..25af974fcb 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2580,14 +2580,18 @@ if (PkgSkip("DIRECT")==0): if sys.platform == 'win32': core_so = GetOutputDir() + '/panda3d/core.pyd' direct_so = GetOutputDir() + '/panda3d/direct.pyd' + dtoolconfig_so = GetOutputDir() + '/panda3d/dtoolconfig.pyd' else: core_so = GetOutputDir() + '/panda3d/core.so' direct_so = GetOutputDir() + '/panda3d/direct.so' + dtoolconfig_so = GetOutputDir() + '/panda3d/dtoolconfig.so' if os.path.isfile(core_so): os.remove(core_so) if os.path.isfile(direct_so): os.remove(direct_so) +if os.path.isfile(dtoolconfig_so): + os.remove(dtoolconfig_so) # Write an appropriate panda3d/__init__.py p3d_init = """"Python bindings for the Panda3D libraries" @@ -3124,18 +3128,6 @@ TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx') OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG'] TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx') -# -# DIRECTORY: dtool/src/interrogatedb/ -# - -OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:DTOOLCONFIG'] -TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx') -TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx') -TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj') -TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj') -TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll') -TargetAdd('libp3interrogatedb.dll', opts=['PYTHON']) - # # DIRECTORY: dtool/metalibs/dtoolconfig/ # @@ -3149,14 +3141,32 @@ TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj') TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll') TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER']) +# +# DIRECTORY: dtool/src/interrogatedb/ +# + +OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB'] +TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx') +TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx') +TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj') +TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj') +TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll') +TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll') +TargetAdd('libp3interrogatedb.dll', opts=['PYTHON']) + if not PkgSkip("PYTHON"): + # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb + # stuff, so it has been renamed appropriately. OPTS=['DIR:dtool/metalibs/dtoolconfig'] - TargetAdd('dtoolconfig_pydtool.obj', opts=OPTS, input="pydtool.cxx") - TargetAdd('dtoolconfig.pyd', input='dtoolconfig_pydtool.obj') - TargetAdd('dtoolconfig.pyd', input='libp3dtoolconfig.dll') - TargetAdd('dtoolconfig.pyd', input='libp3dtool.dll') - TargetAdd('dtoolconfig.pyd', input='libp3interrogatedb.dll') - TargetAdd('dtoolconfig.pyd', opts=['PYTHON']) + TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx") + TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj') + TargetAdd('interrogatedb.pyd', input='libp3dtool.dll') + TargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll') + TargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll') + TargetAdd('interrogatedb.pyd', opts=['PYTHON']) + + # Make a stub file importing the new one for backward compatibility. + TargetAdd('panda3d/dtoolconfig.py', input='interrogatedb.pyd') # # DIRECTORY: dtool/src/pystub/ From 41b44683b6269653d05ab9fcf43810f576dba210 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 3 Jul 2015 19:38:10 +0200 Subject: [PATCH 035/203] Compile with older versions of Assimp --- pandatool/src/assimp/assimpLoader.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index 3ae5be3dc0..7b87b574cb 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -630,7 +630,9 @@ load_light(const aiLight &light) { plight->set_transform(TransformState::make_pos_quat_scale(pos, quat, LVecBase3(1, 1, 1))); break; } - case aiLightSource_AMBIENT: + // This is a somewhat recent addition to Assimp, so let's be kind to + // those that don't have an up-to-date version of Assimp. + case 0x4: //aiLightSource_AMBIENT: // This is handled below. break; From 7026854cc2c118e238fed1bfa2e1f01f6a75e969 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 5 Jul 2015 16:07:08 +0200 Subject: [PATCH 036/203] Fixes to get the C binding generator to work --- dtool/src/cppparser/cppArrayType.cxx | 11 ++-- dtool/src/cppparser/cppBison.yxx | 10 ++-- dtool/src/cppparser/cppType.cxx | 6 +++ dtool/src/cppparser/cppTypedefType.cxx | 2 +- dtool/src/interrogate/functionRemap.cxx | 50 +++++++++++++++---- dtool/src/interrogate/functionRemap.h | 4 +- dtool/src/interrogate/interfaceMaker.cxx | 8 +-- dtool/src/interrogate/interfaceMakerC.cxx | 18 +++++-- .../interfaceMakerPythonNative.cxx | 19 +++---- dtool/src/interrogate/interrogateBuilder.cxx | 6 +++ .../parameterRemapBasicStringPtrToString.cxx | 16 +++++- .../parameterRemapBasicStringRefToString.cxx | 16 +++++- .../parameterRemapBasicStringToString.cxx | 18 +++++-- .../parameterRemapBasicStringToString.h | 2 +- .../interrogate/parameterRemapToString.cxx | 2 +- dtool/src/parser-inc/iostream | 6 ++- dtool/src/parser-inc/stdint.h | 2 +- dtool/src/parser-inc/stdtypedefs.h | 4 +- panda/src/downloader/httpClient.h | 3 +- panda/src/downloader/stringStream.h | 2 + panda/src/egg/eggGroup.I | 2 +- panda/src/pgraph/geomNode.h | 2 +- 22 files changed, 153 insertions(+), 56 deletions(-) diff --git a/dtool/src/cppparser/cppArrayType.cxx b/dtool/src/cppparser/cppArrayType.cxx index 4b044fb766..fa23f26e0f 100644 --- a/dtool/src/cppparser/cppArrayType.cxx +++ b/dtool/src/cppparser/cppArrayType.cxx @@ -217,11 +217,11 @@ is_equal(const CPPDeclaration *other) const { if (*_bounds != *ot->_bounds) { return false; } - } else if (_bounds == NULL || ot->_bounds == NULL) { + } else if ((_bounds == NULL) != (ot->_bounds == NULL)) { return false; } - return _element_type == ot->_element_type; + return *_element_type == *ot->_element_type; } @@ -241,10 +241,13 @@ is_less(const CPPDeclaration *other) const { if (*_bounds != *ot->_bounds) { return *_bounds < *ot->_bounds; } - } else if (_bounds == NULL || ot->_bounds == NULL) { + } else if ((_bounds == NULL) != (ot->_bounds == NULL)) { return _bounds < ot->_bounds; } - return _element_type < ot->_element_type; + if (*_element_type != *ot->_element_type) { + return *_element_type < *ot->_element_type; + } + return false; } diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 87c4f5cd17..644fcac1de 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -724,7 +724,7 @@ typedef_declaration: inst->_storage_class |= (current_storage_class | $1); current_scope->add_declaration(inst, global_scope, current_lexer, @2); CPPTypedefType *typedef_type = new CPPTypedefType(inst->_type, inst->_ident, current_scope); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, @2); + current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @2); } } } @@ -735,13 +735,13 @@ typedef_instance_identifiers: { CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); + current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); } | instance_identifier maybe_initialize ',' typedef_instance_identifiers { CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); + current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); } ; @@ -751,14 +751,14 @@ typedef_const_instance_identifiers: $1->add_modifier(IIT_const); CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); + current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); } | instance_identifier maybe_initialize ',' typedef_const_instance_identifiers { $1->add_modifier(IIT_const); CPPType *target_type = current_type; CPPTypedefType *typedef_type = new CPPTypedefType(target_type, $1, current_scope, @1.file); - current_scope->add_declaration(typedef_type, global_scope, current_lexer, @1); + current_scope->add_declaration(CPPType::new_type(typedef_type), global_scope, current_lexer, @1); } ; diff --git a/dtool/src/cppparser/cppType.cxx b/dtool/src/cppparser/cppType.cxx index daceeb1d26..c94cfbd759 100644 --- a/dtool/src/cppparser/cppType.cxx +++ b/dtool/src/cppparser/cppType.cxx @@ -323,6 +323,12 @@ new_type(CPPType *type) { return type; } + // If this triggers, we probably messed up by defining is_less() + // incorrectly; they provide a relative ordering even though they + // are equal to each other. Or, we provided an is_equal() that + // gives false negatives. + assert(**result.first == *type); + // The insertion has not taken place; thus, there was previously // another equivalent type declared. if (*result.first != type) { diff --git a/dtool/src/cppparser/cppTypedefType.cxx b/dtool/src/cppparser/cppTypedefType.cxx index 89924b3cc1..1cc31e4b4e 100644 --- a/dtool/src/cppparser/cppTypedefType.cxx +++ b/dtool/src/cppparser/cppTypedefType.cxx @@ -381,7 +381,7 @@ is_equal(const CPPDeclaration *other) const { const CPPTypedefType *ot = ((CPPDeclaration *)other)->as_typedef_type(); assert(ot != NULL); - return (_type == ot->_type) && (*_ident == *ot->_ident); + return (*_type == *ot->_type) && (*_ident == *ot->_ident); } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 25a2848112..4206931d13 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -94,9 +94,29 @@ get_parameter_name(int n) const { // Access: Public // Description: Writes a sequence of commands to the given output // stream to call the wrapped function. The parameter -// values are taken from pexprs, if it is nonempty, or -// are assumed to be simply the names of the parameters, -// if it is empty. +// values are assumed to be simply the names of the +// parameters. +// +// The return value is the expression to return, if we +// are returning a value, or the empty string if we +// return nothing. +//////////////////////////////////////////////////////////////////// +string FunctionRemap:: +call_function(ostream &out, int indent_level, bool convert_result, + const string &container) const { + vector_string pexprs; + for (int i = 0; i < _parameters.size(); ++i) { + pexprs.push_back(get_parameter_name(i)); + } + return call_function(out, indent_level, convert_result, container, pexprs); +} + +//////////////////////////////////////////////////////////////////// +// Function: FunctionRemap::call_function +// Access: Public +// Description: Writes a sequence of commands to the given output +// stream to call the wrapped function. The parameter +// values are taken from pexprs. // // The return value is the expression to return, if we // are returning a value, or the empty string if we @@ -219,7 +239,7 @@ call_function(ostream &out, int indent_level, bool convert_result, string call = get_call_str(container, pexprs); if (!convert_result) { - return_expr = get_call_str(container, pexprs); + return_expr = call; } else { //if (_return_type->return_value_should_be_simple()) { @@ -371,23 +391,35 @@ get_call_str(const string &container, const vector_string &pexprs) const { // Getters and setters are a special case. if (_type == T_getter) { - if (!container.empty()) { + if (_has_this && !container.empty()) { call << "(" << container << ")->" << _expression; } else { call << _expression; } } else if (_type == T_setter) { - if (!container.empty()) { - call << "(" << container << ")->" << _expression; + string expr; + if (_has_this && !container.empty()) { + expr = "(" + container + ")->" + _expression; } else { - call << _expression; + expr = _expression; + } + + // It's not possible to assign arrays in C++, we have to copy them. + CPPArrayType *array_type = _parameters[_first_true_parameter]._remap->get_orig_type()->as_array_type(); + if (array_type != NULL) { + call << "std::copy(" << expr << ", " << expr << " + " << *array_type->_bounds << ", "; + } else { + call << expr << " = "; } - call << " = "; _parameters[_first_true_parameter]._remap->pass_parameter(call, get_parameter_expr(_first_true_parameter, pexprs)); + if (array_type != NULL) { + call << ')'; + } + } else { const char *separator = ""; diff --git a/dtool/src/interrogate/functionRemap.h b/dtool/src/interrogate/functionRemap.h index 969aa3b969..6a4477ba56 100644 --- a/dtool/src/interrogate/functionRemap.h +++ b/dtool/src/interrogate/functionRemap.h @@ -52,9 +52,11 @@ public: ~FunctionRemap(); string get_parameter_name(int n) const; + string call_function(ostream &out, int indent_level, + bool convert_result, const string &container) const; string call_function(ostream &out, int indent_level, bool convert_result, const string &container, - const vector_string &pexprs = vector_string()) const; + const vector_string &pexprs) const; void write_orig_prototype(ostream &out, int indent_level, bool local=false, int num_default_args=0) const; diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index 03398895b8..b8ec0c7c7f 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -442,8 +442,8 @@ remap_parameter(CPPType *struct_type, CPPType *param_type) { return new ParameterRemapEnumToInt(param_type); */ - } else if (TypeManager::is_const_simple(param_type)) { - return new ParameterRemapConstToNonConst(param_type); + //} else if (TypeManager::is_const_simple(param_type)) { + // return new ParameterRemapConstToNonConst(param_type); } else if (TypeManager::is_const_ref_to_simple(param_type)) { return new ParameterRemapReferenceToConcrete(param_type); @@ -833,9 +833,9 @@ manage_return_value(ostream &out, int indent_level, indent(out, indent_level) << "if (" << return_expr << " != (" - << remap->_return_type->get_new_type()->get_local_name(&parser) << ")0) {\n"; + << remap->_return_type->get_new_type()->get_local_name(&parser) << ")NULL) {\n"; indent(out, indent_level + 2) - << return_expr << "->ref();\n"; + << "(" << return_expr << ")->ref();\n"; indent(out, indent_level) << "}\n"; output_ref(out, indent_level, remap, "refcount"); diff --git a/dtool/src/interrogate/interfaceMakerC.cxx b/dtool/src/interrogate/interfaceMakerC.cxx index a1019241ed..c693bf7689 100644 --- a/dtool/src/interrogate/interfaceMakerC.cxx +++ b/dtool/src/interrogate/interfaceMakerC.cxx @@ -173,13 +173,17 @@ write_function_for(ostream &out, InterfaceMaker::Function *func) { void InterfaceMakerC:: write_function_instance(ostream &out, InterfaceMaker::Function *func, FunctionRemap *remap) { + if (remap->_extension || (remap->_flags & FunctionRemap::F_explicit_self)) { + return; + } + out << "/*\n" << " * C wrapper for\n" << " * "; remap->write_orig_prototype(out, 0); out << "\n" << " */\n"; - + if (!output_function_names) { // If we're not saving the function names, don't export it from // the library. @@ -192,17 +196,17 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func, if (generate_spam) { write_spam_message(out, remap); } - - string return_expr = + + string return_expr = remap->call_function(out, 2, true, "param0"); return_expr = manage_return_value(out, 2, remap, return_expr); if (!return_expr.empty()) { out << " return " << return_expr << ";\n"; } - + out << "}\n\n"; } - + //////////////////////////////////////////////////////////////////// // Function: InterfaceMakerC::write_function_header // Access: Private @@ -212,6 +216,10 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func, void InterfaceMakerC:: write_function_header(ostream &out, InterfaceMaker::Function *func, FunctionRemap *remap, bool newline) { + if (remap->_extension || (remap->_flags & FunctionRemap::F_explicit_self)) { + return; + } + if (remap->_void_return) { out << "void"; } else { diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 9bae13353f..f0990dd0d8 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -4748,8 +4748,7 @@ write_function_instance(ostream &out, FunctionRemap *remap, << "PyUnicode_AsWideChar(" << param_name << ", " << param_name << "_str, " << param_name << "_len);\n" << "#endif\n"; - pexpr_string = "std::wstring(" + - param_name + "_str, " + param_name + "_len)"; + pexpr_string = param_name + "_str, " + param_name + "_len"; extra_cleanup << "#if PY_VERSION_HEX >= 0x03030000\n" @@ -4774,8 +4773,7 @@ write_function_instance(ostream &out, FunctionRemap *remap, << "PyUnicode_AsWideChar(" << param_name << ", " << param_name << "_str, " << param_name << "_len);\n" << "#endif\n"; - pexpr_string = "&std::wstring(" + - param_name + "_str, " + param_name + "_len)"; + pexpr_string = param_name + "_str, " + param_name + "_len"; extra_cleanup << "#if PY_VERSION_HEX >= 0x03030000\n" @@ -4822,13 +4820,12 @@ write_function_instance(ostream &out, FunctionRemap *remap, + "_str, &" + param_name + "_len"; } - if (TypeManager::is_const_ptr_to_basic_string_char(orig_type)) { - pexpr_string = "&std::string(" + - param_name + "_str, " + param_name + "_len)"; - } else { - pexpr_string = "std::string(" + - param_name + "_str, " + param_name + "_len)"; - } +// if (TypeManager::is_const_ptr_to_basic_string_char(orig_type)) { +// pexpr_string = "&std::string(" + +// param_name + "_str, " + param_name + "_len)"; +// } else { + pexpr_string = param_name + "_str, " + param_name + "_len"; +// } expected_params += "str"; } // Remember to clear the TypeError that any of the above methods raise. diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 6563132bf4..e6babb17f7 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1537,6 +1537,12 @@ get_getter(CPPType *expr_type, string expression, assert(expr_type != (CPPType *)NULL); } + // We can't return an array from a function, but we can decay it + // into a pointer. + while (expr_type->get_subtype() == CPPDeclaration::ST_array) { + expr_type = CPPType::new_type(new CPPPointerType(expr_type->as_array_type()->_element_type)); + } + // Make up a CPPFunctionType. CPPParameterList *params = new CPPParameterList; CPPFunctionType *ftype = new CPPFunctionType(expr_type, params, 0); diff --git a/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx b/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx index bb111935b2..42ae0ecd5e 100644 --- a/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx +++ b/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx @@ -23,6 +23,12 @@ ParameterRemapBasicStringPtrToString:: ParameterRemapBasicStringPtrToString(CPPType *orig_type) : ParameterRemapToString(orig_type) { + static CPPType *const_char_star_type = (CPPType *)NULL; + if (const_char_star_type == (CPPType *)NULL) { + const_char_star_type = parser.parse_type("const char *"); + } + + _new_type = const_char_star_type; } //////////////////////////////////////////////////////////////////// @@ -34,7 +40,7 @@ ParameterRemapBasicStringPtrToString(CPPType *orig_type) : //////////////////////////////////////////////////////////////////// void ParameterRemapBasicStringPtrToString:: pass_parameter(ostream &out, const string &variable_name) { - out << "&" << variable_name; + out << "&std::string(" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// @@ -58,6 +64,12 @@ ParameterRemapBasicWStringPtrToWString:: ParameterRemapBasicWStringPtrToWString(CPPType *orig_type) : ParameterRemapToWString(orig_type) { + static CPPType *const_wchar_star_type = (CPPType *)NULL; + if (const_wchar_star_type == (CPPType *)NULL) { + const_wchar_star_type = parser.parse_type("const wchar_t *"); + } + + _new_type = const_wchar_star_type; } //////////////////////////////////////////////////////////////////// @@ -69,7 +81,7 @@ ParameterRemapBasicWStringPtrToWString(CPPType *orig_type) : //////////////////////////////////////////////////////////////////// void ParameterRemapBasicWStringPtrToWString:: pass_parameter(ostream &out, const string &variable_name) { - out << "&" << variable_name; + out << "&std::wstring(" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx b/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx index 6025d395c6..4e264c45d3 100644 --- a/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx +++ b/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx @@ -23,6 +23,12 @@ ParameterRemapBasicStringRefToString:: ParameterRemapBasicStringRefToString(CPPType *orig_type) : ParameterRemapToString(orig_type) { + static CPPType *const_char_star_type = (CPPType *)NULL; + if (const_char_star_type == (CPPType *)NULL) { + const_char_star_type = parser.parse_type("const char *"); + } + + _new_type = const_char_star_type; } //////////////////////////////////////////////////////////////////// @@ -34,7 +40,7 @@ ParameterRemapBasicStringRefToString(CPPType *orig_type) : //////////////////////////////////////////////////////////////////// void ParameterRemapBasicStringRefToString:: pass_parameter(ostream &out, const string &variable_name) { - out << variable_name; + out << "std::string(" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// @@ -58,6 +64,12 @@ ParameterRemapBasicWStringRefToWString:: ParameterRemapBasicWStringRefToWString(CPPType *orig_type) : ParameterRemapToWString(orig_type) { + static CPPType *const_wchar_star_type = (CPPType *)NULL; + if (const_wchar_star_type == (CPPType *)NULL) { + const_wchar_star_type = parser.parse_type("const wchar_t *"); + } + + _new_type = const_wchar_star_type; } //////////////////////////////////////////////////////////////////// @@ -69,7 +81,7 @@ ParameterRemapBasicWStringRefToWString(CPPType *orig_type) : //////////////////////////////////////////////////////////////////// void ParameterRemapBasicWStringRefToWString:: pass_parameter(ostream &out, const string &variable_name) { - out << variable_name; + out << "std::wstring(" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogate/parameterRemapBasicStringToString.cxx b/dtool/src/interrogate/parameterRemapBasicStringToString.cxx index 3fdcc44042..3cd22933a9 100644 --- a/dtool/src/interrogate/parameterRemapBasicStringToString.cxx +++ b/dtool/src/interrogate/parameterRemapBasicStringToString.cxx @@ -24,6 +24,12 @@ ParameterRemapBasicStringToString:: ParameterRemapBasicStringToString(CPPType *orig_type) : ParameterRemapToString(orig_type) { + static CPPType *const_char_star_type = (CPPType *)NULL; + if (const_char_star_type == (CPPType *)NULL) { + const_char_star_type = parser.parse_type("const char *"); + } + + _new_type = const_char_star_type; } //////////////////////////////////////////////////////////////////// @@ -35,7 +41,7 @@ ParameterRemapBasicStringToString(CPPType *orig_type) : //////////////////////////////////////////////////////////////////// void ParameterRemapBasicStringToString:: pass_parameter(ostream &out, const string &variable_name) { - out << variable_name; + out << "std::string(" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// @@ -73,8 +79,14 @@ get_return_expr(const string &expression) { //////////////////////////////////////////////////////////////////// ParameterRemapBasicWStringToWString:: ParameterRemapBasicWStringToWString(CPPType *orig_type) : - ParameterRemapToString(orig_type) + ParameterRemapToWString(orig_type) { + static CPPType *const_wchar_star_type = (CPPType *)NULL; + if (const_wchar_star_type == (CPPType *)NULL) { + const_wchar_star_type = parser.parse_type("const wchar_t *"); + } + + _new_type = const_wchar_star_type; } //////////////////////////////////////////////////////////////////// @@ -86,7 +98,7 @@ ParameterRemapBasicWStringToWString(CPPType *orig_type) : //////////////////////////////////////////////////////////////////// void ParameterRemapBasicWStringToWString:: pass_parameter(ostream &out, const string &variable_name) { - out << variable_name; + out << "std::wstring(" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogate/parameterRemapBasicStringToString.h b/dtool/src/interrogate/parameterRemapBasicStringToString.h index 877ebad035..63678a8354 100644 --- a/dtool/src/interrogate/parameterRemapBasicStringToString.h +++ b/dtool/src/interrogate/parameterRemapBasicStringToString.h @@ -39,7 +39,7 @@ public: // Description : Maps a concrete basic_string to an atomic // string. //////////////////////////////////////////////////////////////////// -class ParameterRemapBasicWStringToWString : public ParameterRemapToString { +class ParameterRemapBasicWStringToWString : public ParameterRemapToWString { public: ParameterRemapBasicWStringToWString(CPPType *orig_type); diff --git a/dtool/src/interrogate/parameterRemapToString.cxx b/dtool/src/interrogate/parameterRemapToString.cxx index 362cd89691..fd41c9bbe3 100644 --- a/dtool/src/interrogate/parameterRemapToString.cxx +++ b/dtool/src/interrogate/parameterRemapToString.cxx @@ -35,7 +35,7 @@ ParameterRemapToString(CPPType *orig_type) : const_char_star_type = parser.parse_type("const char *"); } - if (TypeManager::is_const(orig_type)) { + if (TypeManager::is_const_char_pointer(orig_type) || TypeManager::is_string(orig_type)) { _new_type = const_char_star_type; } else { _new_type = char_star_type; diff --git a/dtool/src/parser-inc/iostream b/dtool/src/parser-inc/iostream index 5cd485d04d..5da002182a 100644 --- a/dtool/src/parser-inc/iostream +++ b/dtool/src/parser-inc/iostream @@ -59,6 +59,10 @@ __published: bool bad() const; void clear(); }; + +// We actually want to wrap streampos as streamoff. +#define streampos streamoff + class ostream : virtual public ios { __published: void put(char c); @@ -104,6 +108,6 @@ extern istream cin; extern ostream cout; extern ostream cerr; -typedef int streampos; +typedef long streamoff; #endif diff --git a/dtool/src/parser-inc/stdint.h b/dtool/src/parser-inc/stdint.h index 060dbf82e7..11fba7a776 100644 --- a/dtool/src/parser-inc/stdint.h +++ b/dtool/src/parser-inc/stdint.h @@ -15,7 +15,7 @@ #ifndef _STDINT_H #define _STDINT_H -#ifdef _LP64 +#if defined(_LP64) || defined(_WIN64) #define __WORDSIZE 64 #else #define __WORDSIZE 32 diff --git a/dtool/src/parser-inc/stdtypedefs.h b/dtool/src/parser-inc/stdtypedefs.h index 56d95508f7..345eda1fd0 100644 --- a/dtool/src/parser-inc/stdtypedefs.h +++ b/dtool/src/parser-inc/stdtypedefs.h @@ -20,8 +20,8 @@ #ifndef STDTYPEDEFS_H #define STDTYPEDEFS_H #ifndef __APPLE__ -typedef unsigned int size_t; -typedef int ssize_t; +typedef unsigned long size_t; +typedef long ssize_t; typedef int off_t; typedef unsigned int time_t; typedef int clock_t; diff --git a/panda/src/downloader/httpClient.h b/panda/src/downloader/httpClient.h index 5d6b0c8aea..cabc03c924 100644 --- a/panda/src/downloader/httpClient.h +++ b/panda/src/downloader/httpClient.h @@ -77,7 +77,6 @@ PUBLISHED: void clear_direct_host(); void add_direct_host(const string &hostname); - void get_proxies_for_url(const URLSpec &url, pvector &proxies) const; string get_proxies_for_url(const URLSpec &url) const; void set_username(const string &server, const string &realm, const string &username); @@ -134,6 +133,8 @@ PUBLISHED: static HTTPClient *get_global_ptr(); public: + void get_proxies_for_url(const URLSpec &url, pvector &proxies) const; + SSL_CTX *get_ssl_ctx(); private: diff --git a/panda/src/downloader/stringStream.h b/panda/src/downloader/stringStream.h index 366f0d1394..d90314c46e 100644 --- a/panda/src/downloader/stringStream.h +++ b/panda/src/downloader/stringStream.h @@ -34,6 +34,8 @@ PUBLISHED: INLINE string get_data(); INLINE void set_data(const string &data); + +public: INLINE void swap_data(pvector &data); private: diff --git a/panda/src/egg/eggGroup.I b/panda/src/egg/eggGroup.I index 64bc0c843d..f88d7c40c0 100644 --- a/panda/src/egg/eggGroup.I +++ b/panda/src/egg/eggGroup.I @@ -1018,7 +1018,7 @@ tag_end() const { //////////////////////////////////////////////////////////////////// // Function: EggGroup::tag_size -// Access: Published +// Access: Public // Description: Returns the number of elements between tag_begin() // and tag_end(). // diff --git a/panda/src/pgraph/geomNode.h b/panda/src/pgraph/geomNode.h index 285783df99..cfdbd85e2c 100644 --- a/panda/src/pgraph/geomNode.h +++ b/panda/src/pgraph/geomNode.h @@ -36,7 +36,7 @@ class GraphicsStateGuardianBase; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_PGRAPH GeomNode : public PandaNode { PUBLISHED: - GeomNode(const string &name); + explicit GeomNode(const string &name); protected: GeomNode(const GeomNode ©); From f67ee228bf11ae6adfa90d21ad1ee06ea961c15b Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 5 Jul 2015 20:39:34 +0200 Subject: [PATCH 037/203] Fix error in cg-glsl-version --- panda/src/gobj/shader.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 95a2fff67d..68bf6ebd1c 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -1485,15 +1485,14 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, ultimate = CG_PROFILE_UNKNOWN; }; - cgGetError(); - if (type == ST_fragment && caps._bug_list.count(SBUG_ati_draw_buffers)) { compiler_args[nargs++] = "-po"; compiler_args[nargs++] = "ATI_draw_buffers"; } char version_arg[16]; - if (!cg_glsl_version.empty() && cgGetProfileProperty((CGprofile) active, CG_IS_GLSL_PROFILE)) { + if (!cg_glsl_version.empty() && active != CG_PROFILE_UNKNOWN && + cgGetProfileProperty((CGprofile) active, CG_IS_GLSL_PROFILE)) { snprintf(version_arg, 16, "version=%s", cg_glsl_version.c_str()); compiler_args[nargs++] = "-po"; compiler_args[nargs++] = version_arg; @@ -1501,6 +1500,8 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, compiler_args[nargs] = 0; + cgGetError(); + if ((active != (int)CG_PROFILE_UNKNOWN) && (active != ultimate)) { // Print out some debug information about what we're doing. if (shader_cat.is_debug()) { @@ -1566,6 +1567,11 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, return prog; } + if (shader_cat.is_debug()) { + shader_cat.debug() + << "Compilation with ultimate profile failed: " << cgGetErrorString(err) << "\n"; + } + if (prog != 0) { cgDestroyProgram(prog); } From fe058dfb3270492b9dd6887db15b03ce4eb4b145 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 10:29:44 +0200 Subject: [PATCH 038/203] Don't store two references to X11 Cursor, or we double free at shutdown --- panda/src/x11display/x11GraphicsWindow.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 5195b8ac5d..5e4e7ee88c 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -2146,7 +2146,6 @@ get_cursor(const Filename &filename) { } fi = _cursor_filenames.find(resolved); if (fi != _cursor_filenames.end()) { - _cursor_filenames[filename] = (*fi).second; return fi->second; } From 69b8d6a4b505d4ac5d55983a35415f3e6856396c Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 10:31:33 +0200 Subject: [PATCH 039/203] Fix memory leak in tuple-returning getters --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 30bb59d8a5..ec7e84adfe 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -6113,7 +6113,7 @@ write_make_seq(ostream &out, Object *obj, const std::string &ClassName, << " return NULL;\n" << " }\n" << "\n" - << " PyObject *getter = PyObject_GetAttrString(self, \"" << element_name << "\");\n" + << " PyObject *getter = PyDict_GetItemString(Dtool_" << ClassName << "._PyType.tp_dict, \"" << element_name << "\");\n" << " if (getter == (PyObject *)NULL) {\n" << " return NULL;\n" << " }\n" @@ -6127,7 +6127,7 @@ write_make_seq(ostream &out, Object *obj, const std::string &ClassName, << "#else\n" << " PyObject *index = PyInt_FromSsize_t(i);\n" << "#endif\n" - << " PyObject *value = PyObject_CallFunctionObjArgs(getter, index, NULL);\n" + << " PyObject *value = PyObject_CallFunctionObjArgs(getter, self, index, NULL);\n" << " PyTuple_SET_ITEM(tuple, i, value);\n" << " Py_DECREF(index);\n" << " }\n" From 7c2822515b2e2251501fb272e18192d1bb05b853 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 14:19:46 +0200 Subject: [PATCH 040/203] Remove dependency on X11/Intrinsic.h --- panda/src/display/get_x11.h | 1 - panda/src/x11display/x11GraphicsWindow.cxx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/panda/src/display/get_x11.h b/panda/src/display/get_x11.h index 7ea150a963..edb9bbf5b7 100644 --- a/panda/src/display/get_x11.h +++ b/panda/src/display/get_x11.h @@ -52,7 +52,6 @@ struct XVisualInfo; #include #include #include -#include #ifdef HAVE_XRANDR #include diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 5e4e7ee88c..785ab51ff0 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -1180,7 +1180,7 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) { nassertv(next_set_data < max_set_data); // Add the process ID as a convenience for other applications. - Cardinal pid = getpid(); + PN_int32 pid = getpid(); XChangeProperty(_display, _xwindow, x11_pipe->_net_wm_pid, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1); From 214d799d826ea81fdbdd36f4fba182482081bb5d Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 14:52:08 +0200 Subject: [PATCH 041/203] Add optional "other" NodePath argument for get_tight_bounds() --- panda/src/pgraph/nodePath.cxx | 18 +++++++++++++++--- panda/src/pgraph/nodePath.h | 3 ++- panda/src/pgraph/nodePath_ext.cxx | 5 +++-- panda/src/pgraph/nodePath_ext.h | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index 828179f603..20a2f90ab4 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -6191,20 +6191,32 @@ write_bounds(ostream &out) const { // than the bounding volume returned by get_bounds() // (but it is more expensive to compute). // +// The bounding box is computed relative to the parent +// node's coordinate system by default. You can +// optionally specify a different NodePath to compute +// the bounds relative to. Note that the box is always +// axis-aligned against the given NodePath's coordinate +// system, so you might get a differently sized box +// depending on which node you pass. +// // The return value is true if any points are within the // bounding volume, or false if none are. //////////////////////////////////////////////////////////////////// bool NodePath:: calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, - Thread *current_thread) const { + const NodePath &other, Thread *current_thread) const { min_point.set(0.0f, 0.0f, 0.0f); max_point.set(0.0f, 0.0f, 0.0f); nassertr_always(!is_empty(), false); + CPT(TransformState) transform = TransformState::make_identity(); + if (!other.is_empty()) { + transform = get_transform(other)->compose(get_transform()->get_inverse()); + } + bool found_any = false; node()->calc_tight_bounds(min_point, max_point, found_any, - TransformState::make_identity(), - current_thread); + MOVE(transform), current_thread); return found_any; } diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 68a5196550..4e7a098601 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -876,9 +876,10 @@ PUBLISHED: void force_recompute_bounds(); void write_bounds(ostream &out) const; bool calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, + const NodePath &other = NodePath(), Thread *current_thread = Thread::get_current_thread()) const; - EXTENSION(PyObject *get_tight_bounds() const); + EXTENSION(PyObject *get_tight_bounds(const NodePath &other = NodePath()) const); // void analyze() const; diff --git a/panda/src/pgraph/nodePath_ext.cxx b/panda/src/pgraph/nodePath_ext.cxx index b5cc7dbd51..d38164d3ba 100644 --- a/panda/src/pgraph/nodePath_ext.cxx +++ b/panda/src/pgraph/nodePath_ext.cxx @@ -240,14 +240,15 @@ py_decode_NodePath_from_bam_stream_persist(PyObject *unpickler, const string &da // objects. This is a convenience function for Python // users, among which the use of calc_tight_bounds // may be confusing. +// // Returns None if calc_tight_bounds returned false. //////////////////////////////////////////////////////////////////// PyObject *Extension:: -get_tight_bounds() const { +get_tight_bounds(const NodePath &other) const { LPoint3 *min_point = new LPoint3; LPoint3 *max_point = new LPoint3; - if (_this->calc_tight_bounds(*min_point, *max_point)) { + if (_this->calc_tight_bounds(*min_point, *max_point, other)) { #ifdef STDFLOAT_DOUBLE PyObject *min_inst = DTool_CreatePyInstance((void*) min_point, Dtool_LPoint3d, true, false); PyObject *max_inst = DTool_CreatePyInstance((void*) max_point, Dtool_LPoint3d, true, false); diff --git a/panda/src/pgraph/nodePath_ext.h b/panda/src/pgraph/nodePath_ext.h index 00983a9de1..67afe2a383 100644 --- a/panda/src/pgraph/nodePath_ext.h +++ b/panda/src/pgraph/nodePath_ext.h @@ -48,7 +48,7 @@ public: INLINE bool has_net_python_tag(const string &key) const; NodePath find_net_python_tag(const string &key) const; - PyObject *get_tight_bounds() const; + PyObject *get_tight_bounds(const NodePath &other = NodePath()) const; }; BEGIN_PUBLISH From 2514ca29d8d27a7454e0080969a7714dc1db3b00 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 15:52:57 +0200 Subject: [PATCH 042/203] Fix config error when DirectGuiBase is imported before ShowBase --- direct/src/gui/DirectGuiBase.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index 2d8c8241e7..d2e36dcd31 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -632,7 +632,7 @@ class DirectGuiBase(DirectObject.DirectObject): """ # Need to tack on gui item specific id gEvent = event + self.guiId - if base.config.GetBool('debug-directgui-msgs', False): + if get_config_showbase().GetBool('debug-directgui-msgs', False): from direct.showbase.PythonUtil import StackTrace print gEvent print StackTrace() @@ -655,7 +655,7 @@ def setGuiGridSpacing(spacing): # this should trigger off of __dev__, but it's not available at this point. # __debug__ works because the production client is not __debug__ and the # production AI doesn't create any GUI. -if config.GetBool('record-gui-creation-stack', __debug__): +if get_config_showbase().GetBool('record-gui-creation-stack', __debug__): # this will help track down the code that created DirectGui objects # call obj.printCreationStackTrace() to figure out what code created it DirectGuiBase = recordCreationStackStr(DirectGuiBase) @@ -668,8 +668,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath): # Determine the default initial state for inactive (or # unclickable) components. If we are in edit mode, these are # actually clickable by default. - #guiEdit = base.config.GetBool('direct-gui-edit', 0) - guiEdit = config.GetBool('direct-gui-edit', 0) + guiEdit = get_config_showbase().GetBool('direct-gui-edit', 0) if guiEdit: inactiveInitState = DGG.NORMAL else: From 1088cdedc87c4171354e3345bc366301bc30031f Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 23:31:14 +0200 Subject: [PATCH 043/203] Fix mac and static build issues --- dtool/src/prc/notifyCategoryProxy.h | 13 ++++++++++++- makepanda/makepanda.py | 5 +++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dtool/src/prc/notifyCategoryProxy.h b/dtool/src/prc/notifyCategoryProxy.h index 4349b4a04b..9e3c239c5e 100644 --- a/dtool/src/prc/notifyCategoryProxy.h +++ b/dtool/src/prc/notifyCategoryProxy.h @@ -127,6 +127,16 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro #ifdef CPPPARSER #define NotifyCategoryDecl(basename, expcl, exptp) +#elif defined(WIN32_VC) +// MSVC's rules for extern template classes differ slightly. +#define NotifyCategoryDecl(basename, expcl, exptp) \ + class expcl NotifyCategoryGetCategory_ ## basename { \ + public: \ + NotifyCategoryGetCategory_ ## basename(); \ + static NotifyCategory *get_category(); \ + }; \ + EXPORT_TEMPLATE_CLASS(expcl, exptp, NotifyCategoryProxy); \ + extern expcl NotifyCategoryProxy basename ## _cat; #else #define NotifyCategoryDecl(basename, expcl, exptp) \ class expcl NotifyCategoryGetCategory_ ## basename { \ @@ -134,7 +144,7 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro NotifyCategoryGetCategory_ ## basename(); \ static NotifyCategory *get_category(); \ }; \ - exptp template class expcl NotifyCategoryProxy; \ + EXPORT_TEMPLATE_CLASS(expcl, extern, NotifyCategoryProxy); \ extern expcl NotifyCategoryProxy basename ## _cat; #endif @@ -161,6 +171,7 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro #else #define NotifyCategoryDefName(basename, actual_name, parent_category) \ + template class NotifyCategoryProxy; \ NotifyCategoryProxy basename ## _cat; \ static NotifyCategoryGetCategory_ ## basename force_init_ ## basename ## _cat; \ NotifyCategoryGetCategory_ ## basename:: \ diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 5cc0313bd3..5a4d39a7fb 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1155,7 +1155,8 @@ def CompileCxx(obj,src,opts): if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val for x in ipath: cmd += ' -I' + x - cmd += ' -fvisibility=hidden' + if not GetLinkAllStatic(): + cmd += ' -fvisibility=hidden' # Mac-specific flags. if GetTarget() == "darwin": @@ -3227,8 +3228,8 @@ if (not RTDIST and not RUNTIME): OPTS=['DIR:dtool/src/test_interrogate'] TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx') TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj') - TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll') + TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) # From ef9908c2777085067676e40254f89264eb201069 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Jul 2015 02:51:48 +0200 Subject: [PATCH 044/203] More robust Cg support on non-NVIDIA card + automatically enable hardware skinning in Shader Generator --- panda/src/display/graphicsStateGuardian.cxx | 23 +- panda/src/display/standardMunger.cxx | 15 +- panda/src/glstuff/glCgShaderContext_src.cxx | 495 +++++++++++++++--- panda/src/glstuff/glCgShaderContext_src.h | 21 + .../glstuff/glGraphicsStateGuardian_src.cxx | 12 + .../src/glstuff/glGraphicsStateGuardian_src.h | 5 + panda/src/gobj/shader.I | 2 +- panda/src/gobj/shader.cxx | 197 ++++--- panda/src/gobj/shader.h | 10 +- panda/src/pgraph/cullableObject.cxx | 12 + panda/src/pgraph/renderState.h | 4 +- panda/src/pgraph/shaderAttrib.cxx | 1 + panda/src/pgraphnodes/shaderGenerator.cxx | 74 ++- panda/src/pgraphnodes/shaderGenerator.h | 4 +- 14 files changed, 659 insertions(+), 216 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index cfe260277e..a3979a6c2c 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -814,17 +814,12 @@ dispatch_compute(int num_groups_x, int num_groups_y, int num_groups_z) { //////////////////////////////////////////////////////////////////// PT(GeomMunger) GraphicsStateGuardian:: get_geom_munger(const RenderState *state, Thread *current_thread) { - // We can cast the RenderState to a non-const object because we are - // only updating a cache within the RenderState, not really changing - // any of its properties. - RenderState *nc_state = ((RenderState *)state); - // Before we even look up the map, see if the _last_mi value points // to this GSG. This is likely because we tend to visit the same // state multiple times during a frame. Also, this might well be // the only GSG in the world anyway. - if (!nc_state->_mungers.empty()) { - RenderState::Mungers::const_iterator mi = nc_state->_last_mi; + if (!state->_mungers.empty()) { + RenderState::Mungers::const_iterator mi = state->_last_mi; if (!(*mi).first.was_deleted() && (*mi).first == this) { if ((*mi).second->is_registered()) { return (*mi).second; @@ -833,23 +828,23 @@ get_geom_munger(const RenderState *state, Thread *current_thread) { } // Nope, we have to look it up in the map. - RenderState::Mungers::iterator mi = nc_state->_mungers.find(this); - if (mi != nc_state->_mungers.end() && !(*mi).first.was_deleted()) { + RenderState::Mungers::iterator mi = state->_mungers.find(this); + if (mi != state->_mungers.end() && !(*mi).first.was_deleted()) { if ((*mi).second->is_registered()) { - nc_state->_last_mi = mi; + state->_last_mi = mi; return (*mi).second; } // This GeomMunger is no longer registered. Remove it from the // map. - nc_state->_mungers.erase(mi); + state->_mungers.erase(mi); } // Nothing in the map; create a new entry. - PT(GeomMunger) munger = make_geom_munger(nc_state, current_thread); + PT(GeomMunger) munger = make_geom_munger(state, current_thread); nassertr(munger != (GeomMunger *)NULL && munger->is_registered(), munger); - mi = nc_state->_mungers.insert(RenderState::Mungers::value_type(this, munger)).first; - nc_state->_last_mi = mi; + mi = state->_mungers.insert(RenderState::Mungers::value_type(this, munger)).first; + state->_last_mi = mi; return munger; } diff --git a/panda/src/display/standardMunger.cxx b/panda/src/display/standardMunger.cxx index 5dc6c03d13..85ddd0f3e1 100644 --- a/panda/src/display/standardMunger.cxx +++ b/panda/src/display/standardMunger.cxx @@ -131,7 +131,8 @@ munge_data_impl(const GeomVertexData *data) { } GeomVertexAnimationSpec animation = new_data->get_format()->get_animation(); - if (_shader_skinning) { + if (_shader_skinning || (_auto_shader && hardware_animated_vertices && + !basic_shaders_only && animation.get_animation_type() == AT_panda)) { animation.set_hardware(4, true); } else if (hardware_animated_vertices && @@ -387,7 +388,17 @@ munge_state_impl(const RenderState *state) { } if (shader_state->_generated_shader == NULL) { // Cache the generated ShaderAttrib on the shader state. - shader_state->_generated_shader = shader_generator->synthesize_shader(shader_state); + GeomVertexAnimationSpec spec; + + // Currently we overload this flag to request vertex animation + // for the shader generator. + const ShaderAttrib *sattr; + shader_state->get_attrib_def(sattr); + if (sattr->get_flag(ShaderAttrib::F_hardware_skinning)) { + spec.set_hardware(4, true); + } + + shader_state->_generated_shader = shader_generator->synthesize_shader(shader_state, spec); } munged_state = munged_state->set_attrib(shader_state->_generated_shader); } diff --git a/panda/src/glstuff/glCgShaderContext_src.cxx b/panda/src/glstuff/glCgShaderContext_src.cxx index 69f40aca60..47fc97f586 100644 --- a/panda/src/glstuff/glCgShaderContext_src.cxx +++ b/panda/src/glstuff/glCgShaderContext_src.cxx @@ -41,6 +41,11 @@ CLP(CgShaderContext):: CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext(s) { _glgsg = glgsg; _cg_program = 0; + _glsl_program = 0; + _has_divisor = false; + _color_attrib_index = CA_color; + _transform_table_param = 0; + _slider_table_param = 0; nassertv(s->get_language() == Shader::SL_Cg); @@ -53,6 +58,21 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte return; } + _transform_table_param = cgGetNamedParameter(_cg_program, "tbl_transforms"); + if (_transform_table_param) { + _transform_table_size = cgGetArraySize(_transform_table_param, 0); + } + + _slider_table_param = cgGetNamedParameter(_cg_program, "tbl_sliders"); + if (_slider_table_param) { + _slider_table_size = cgGetArraySize(_slider_table_param, 0); + } + + if (GLCAT.is_debug()) { + GLCAT.debug() + << "Loading Cg shader " << s->get_filename() << "\n"; + } + // Load the program. if (_cg_program == 0) { const char *str = cgGetErrorString(cgGetError()); @@ -73,6 +93,214 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte } } + if (_cg_program != 0) { + if (cgGetProgramProfile(_cg_program) == CG_PROFILE_GLSLC) { + _glsl_program = cgGLGetProgramID(_cg_program); + + // Sometimes it fails to link, and Cg fails to propagate the error. + GLint link_status; + _glgsg->_glGetProgramiv(_glsl_program, GL_LINK_STATUS, &link_status); + if (link_status != GL_TRUE) { + release_resources(); + } + } + } + + if (_cg_program == 0) { + return; + } + + // We don't use cgGLSetParameterPointer to set the vertex attributes any + // longer, since it is buggy on non-NVIDIA hardware and doesn't allow explicit + // control over some parameters. Instead, we have to figure out ourselves how + // to map the input varyings to OpenGL vertex attributes. + // + // We use positive indices to indicate generic vertex attributes, and negative + // indices to indicate conventional vertex attributes (ie. glVertexPointer). + int nvarying = _shader->_var_spec.size(); + for (int i = 0; i < nvarying; ++i) { + Shader::ShaderVarSpec &bind = _shader->_var_spec[i]; + CGparameter p = _cg_parameter_map[i]; + if (p == 0) { + bind._id._seqno = CA_unknown; + continue; + } + + GLint loc = CA_unknown; + CGresource res = cgGetParameterResource(p); + + if (cgGetParameterBaseResource(p) == CG_ATTR0) { + // The Cg toolkit claims that it is bound to a generic vertex attribute. + if (_glsl_program != 0) { + // This is where the Cg glslv compiler lies, making the stupid assumption + // that we're using an NVIDIA card where generic attributes are aliased + // with conventional vertex attributes. Instead, it always uses + // conventional attributes in this case. Correct this. + int index = cgGetParameterResourceIndex(p); + switch (index) { + case 0: // gl_Vertex + loc = CA_vertex; + break; + case 2: // gl_Normal + loc = CA_normal; + break; + case 3: // gl_Color + loc = CA_color; + break; + case 4: // gl_SecondaryColor + loc = CA_secondary_color; + break; + case 1: // glWeightPointerARB? + case 5: // gl_FogCoord + case 6: // PSIZE? + case 7: // BLENDINDICES + GLCAT.error() + << "Cg varying " << cgGetParameterName(p) << " is bound to " + "unrecognized attribute " << index << "\n"; + loc = CA_unknown; + break; + default: + loc = CA_texcoord + (index - 8); + break; + } + } else { + loc = cgGetParameterResourceIndex(p); + + if (loc != 0 && bind._id._name == "vtx_position") { + // We really have to bind the vertex position to attribute 0, since + // OpenGL will hide the model if attribute 0 is not enabled, and we + // can only ever be sure that vtx_position is bound. + GLCAT.warning() + << "CG varying vtx_position is bound to generic attribute " << loc + << "instead of 0. Use ATTR0 semantic to prevent this.\n"; + } + } + + } else if (res == CG_GLSL_ATTRIB || _glsl_program != 0) { + // With cg-glsl-version 130 and higher, no conventional attributes are + // used, but it instead uses specially named variables. + // A bit of guesswork is involved here; Cg seems to mostly use the + // semantics as attribute names in GLSL, with a few exceptions. + const char *attribname = NULL; + switch (res) { + case CG_POSITION0: + attribname = "cg_Vertex"; + break; + case CG_NORMAL0: + attribname = "NORMAL"; + break; + case CG_COLOR0: + case CG_DIFFUSE0: + attribname = "COLOR"; + break; + case CG_COLOR1: + case CG_SPECULAR0: + attribname = "SPECULAR"; + break; + default: + // Everything else appears to be named after the semantic string. + attribname = cgGetParameterSemantic(p); + } + loc = _glgsg->_glGetAttribLocation(_glsl_program, attribname); + + if (bind._id._name == "vtx_color") { + _color_attrib_index = loc; + } + + if (loc == -1) { + const char *resource = cgGetParameterResourceName(p); + if (!resource) { + resource = "unknown"; + } + GLCAT.error() + << "Could not find Cg varying " << cgGetParameterName(p); + if (attribname) { + GLCAT.error(false) << " : " << attribname; + } + GLCAT.error(false) << " (" << resource << ") in the compiled GLSL program.\n"; + + } else if (loc != 0 && bind._id._name == "vtx_position") { + // We really have to bind the vertex position to attribute 0, since + // OpenGL will hide the model if attribute 0 is not enabled, and we + // can only ever be sure that vtx_position is bound. + GLCAT.warning() + << "CG varying vtx_position is bound to generic attribute " << loc + << "instead of 0. Use ATTR0 semantic to prevent this.\n"; + } + + } else if (cgGetParameterBaseResource(p) == CG_TEXCOORD0) { + // A conventional texture coordinate set. + loc = CA_texcoord + cgGetParameterResourceIndex(p); + + } else { + // Some other conventional vertex attribute. + switch (res) { + case CG_POSITION0: + loc = CA_vertex; + break; + case CG_NORMAL0: + loc = CA_normal; + break; + case CG_COLOR0: + case CG_DIFFUSE0: + loc = CA_color; + break; + case CG_COLOR1: + case CG_SPECULAR0: + loc = CA_secondary_color; + break; + default: + GLCAT.error() + << "Cg varying " << cgGetParameterName(p); + if (cgGetParameterSemantic(p)) { + GLCAT.error(false) << " : " << cgGetParameterSemantic(p); + } + GLCAT.error(false) << " has an unrecognized resource"; + if (cgGetParameterResourceName(p)) { + GLCAT.error(false) << " (" << cgGetParameterResourceName(p) << ")"; + } + GLCAT.error(false) << ".\n"; + loc = CA_unknown; + } + } + +#ifndef NDEBUG + if (GLCAT.is_debug()) { + GLCAT.debug() + << "Cg varying " << cgGetParameterName(p); + + const char *semantic = cgGetParameterSemantic(p); + if (semantic) { + GLCAT.debug(false) << " : " << semantic; + } + + if (loc == CA_unknown) { + GLCAT.debug(false) + << " is not bound to a vertex attribute\n"; + + } else if (loc >= 0) { + GLCAT.debug(false) + << " is bound to generic attribute " << loc << "\n"; + + } else { + const char *resource = cgGetParameterResourceName(p); + if (!resource) { + resource = "unknown"; + } + GLCAT.debug(false) + << " is bound to a conventional attribute (" << resource << ")\n"; + } + } + if (loc == CA_unknown) { + // Suggest fix to developer. + GLCAT.error() << "Try using a different semantic.\n"; + } +#endif + + // Abuse the seqno field to store the GLSL attribute location. + bind._id._seqno = loc; + } + _glgsg->report_my_gl_errors(); } @@ -385,6 +613,58 @@ issue_parameters(int altered) { _glgsg->report_my_gl_errors(); } +//////////////////////////////////////////////////////////////////// +// Function: CgGLShaderContext::update_transform_table +// Access: Public +// Description: Changes the active transform table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(CgShaderContext):: +update_transform_table(const TransformTable *table) { + LMatrix4f *matrices = (LMatrix4f *)alloca(_transform_table_size * 64); + + int i = 0; + if (table != NULL) { + int num_transforms = min(_transform_table_size, (long)table->get_num_transforms()); + for (; i < num_transforms; ++i) { +#ifdef STDFLOAT_DOUBLE + LMatrix4 matrix; + table->get_transform(i)->get_matrix(matrix); + matrices[i] = LCAST(float, matrix); +#else + table->get_transform(i)->get_matrix(matrices[i]); +#endif + } + } + for (; i < _transform_table_size; ++i) { + matrices[i] = LMatrix4f::ident_mat(); + } + + cgGLSetMatrixParameterArrayfc(_transform_table_param, 0, + _transform_table_size, (float *)matrices); +} + +//////////////////////////////////////////////////////////////////// +// Function: CgGLShaderContext::update_slider_table +// Access: Public +// Description: Changes the active slider table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(CgShaderContext):: +update_slider_table(const SliderTable *table) { + float *sliders = (float *)alloca(_slider_table_size * 4); + memset(sliders, 0, _slider_table_size * 4); + + if (table != NULL) { + int num_sliders = min(_slider_table_size, (long)table->get_num_sliders()); + for (int i = 0; i < num_sliders; ++i) { + sliders[i] = table->get_slider(i)->get_slider(); + } + } + + cgGLSetParameterArray4f(_slider_table_param, 0, _slider_table_size, sliders); +} + //////////////////////////////////////////////////////////////////// // Function: GLCgShaderContext::disable_shader_vertex_arrays // Access: Public @@ -396,27 +676,35 @@ disable_shader_vertex_arrays() { return; } - for (int i=0; i<(int)_shader->_var_spec.size(); i++) { - CGparameter p = _cg_parameter_map[_shader->_var_spec[i]._id._seqno]; - if (p == 0) continue; + for (int i = 0; i < (int)_shader->_var_spec.size(); ++i) { + GLint p = _shader->_var_spec[i]._id._seqno; - if (cgGetParameterBaseResource(p) == CG_ATTR0) { - int index = cgGetParameterResourceIndex(p); - if (index >= 8) { - _glgsg->_glClientActiveTexture(GL_TEXTURE0 + (index - 8)); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - - } else if (index == 0) { - glDisableClientState(GL_VERTEX_ARRAY); - - } else if (index == 2) { - glDisableClientState(GL_NORMAL_ARRAY); - - } else if (index == 3) { - glDisableClientState(GL_COLOR_ARRAY); + if (p >= 0) { + _glgsg->_glDisableVertexAttribArray(p); + if (_has_divisor) { + _glgsg->_glVertexAttribDivisor(p, 0); } } else { - cgGLDisableClientState(p); + switch (p) { + case CA_unknown: + break; + case CA_vertex: + glDisableClientState(GL_VERTEX_ARRAY); + break; + case CA_normal: + glDisableClientState(GL_NORMAL_ARRAY); + break; + case CA_color: + glDisableClientState(GL_COLOR_ARRAY); + break; + case CA_secondary_color: + glDisableClientState(GL_SECONDARY_COLOR_ARRAY); + break; + default: + _glgsg->_glClientActiveTexture(GL_TEXTURE0 + (p - CA_texcoord)); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + break; + } } } @@ -458,12 +746,9 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { int start, stride, num_values; int nvarying = _shader->_var_spec.size(); for (int i = 0; i < nvarying; ++i) { - if (_cg_parameter_map[_shader->_var_spec[i]._id._seqno] == 0) { - continue; - } - - InternalName *name = _shader->_var_spec[i]._name; - int texslot = _shader->_var_spec[i]._append_uv; + const Shader::ShaderVarSpec &bind = _shader->_var_spec[i]; + InternalName *name = bind._name; + int texslot = bind._append_uv; if (texslot >= 0 && texslot < _glgsg->_state_texture->get_num_on_stages()) { TextureStage *stage = _glgsg->_state_texture->get_on_stage(texslot); InternalName *texname = stage->get_texcoord_name(); @@ -474,84 +759,146 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { name = name->append(texname->get_basename()); } } - if (_glgsg->_data_reader->get_array_info(name, - array_reader, num_values, numeric_type, - start, stride)) { + GLint p = bind._id._seqno; + + // Don't apply vertex colors if they are disabled with a ColorAttrib. + int num_elements, element_stride, divisor; + bool normalized; + if ((p != _color_attrib_index || _glgsg->_vertex_colors_enabled) && + _glgsg->_data_reader->get_array_info(name, array_reader, + num_values, numeric_type, + normalized, start, stride, divisor, + num_elements, element_stride)) { const unsigned char *client_pointer; if (!_glgsg->setup_array_data(client_pointer, array_reader, force)) { return false; } + client_pointer += start; - CGparameter p = _cg_parameter_map[_shader->_var_spec[i]._id._seqno]; + // We don't use cgGLSetParameterPointer because it is very buggy and + // limited in the options we can set.start + GLenum type = _glgsg->get_numeric_type(numeric_type); + if (p >= 0) { + _glgsg->_glEnableVertexAttribArray(p); - if (numeric_type == GeomEnums::NT_packed_dabc) { - // Yes, this is a thing. - num_values = GL_BGRA; - } + if (bind._integer) { + _glgsg->_glVertexAttribIPointer(p, num_values, type, + stride, client_pointer); + } else if (numeric_type == GeomEnums::NT_packed_dabc) { + // GL_BGRA is a special accepted value available since OpenGL 3.2. + // It requires us to pass GL_TRUE for normalized. + _glgsg->_glVertexAttribPointer(p, GL_BGRA, GL_UNSIGNED_BYTE, + GL_TRUE, stride, client_pointer); + } else { + _glgsg->_glVertexAttribPointer(p, num_values, type, + normalized, stride, client_pointer); + } - // cgGLSetParameterPointer is just stupidly bugged on every level. - // Sigh. This seems to work on both NVIDIA and AMD cards now. - if (cgGetParameterBaseResource(p) == CG_ATTR0) { - int index = cgGetParameterResourceIndex(p); - switch (index) { - case 0: // gl_Vertex - glVertexPointer(num_values, _glgsg->get_numeric_type(numeric_type), - stride, client_pointer + start); + if (_glgsg->_supports_vertex_attrib_divisor) { + _glgsg->_glVertexAttribDivisor(p, divisor); + _has_divisor = true; + } + + } else { + // It's a conventional vertex attribute. Ugh. + switch (p) { + case CA_unknown: + break; + + case CA_vertex: + glVertexPointer(num_values, type, stride, client_pointer); glEnableClientState(GL_VERTEX_ARRAY); break; - case 2: // gl_Normal - glNormalPointer(_glgsg->get_numeric_type(numeric_type), - stride, client_pointer + start); + case CA_normal: + glNormalPointer(type, stride, client_pointer); glEnableClientState(GL_NORMAL_ARRAY); break; - case 3: // gl_Color - glColorPointer(num_values, _glgsg->get_numeric_type(numeric_type), - stride, client_pointer + start); + case CA_color: + glColorPointer(num_values, type, stride, client_pointer); glEnableClientState(GL_COLOR_ARRAY); break; - case 4: // gl_SecondaryColor - //glSecondaryColorPointer(num_values, _glgsg->get_numeric_type(numeric_type), - // stride, client_pointer + start); - //glEnableClientState(GL_SECONDARY_COLOR_ARRAY); - //break; - case 5: // gl_FogCoord - case 6: // PSIZE? - case 7: // BLENDINDICES? - case 1: // glWeightPointerARB? - GLCAT.error() - << "Unable to bind " << *name << " to " - << cgGetParameterResourceName(p) << "\n"; + case CA_secondary_color: + _glgsg->_glSecondaryColorPointer(num_values, type, + stride, client_pointer); + glEnableClientState(GL_SECONDARY_COLOR_ARRAY); break; default: - _glgsg->_glClientActiveTexture(GL_TEXTURE0 + (index - 8)); - glTexCoordPointer(num_values, _glgsg->get_numeric_type(numeric_type), - stride, client_pointer + start); + _glgsg->_glClientActiveTexture(GL_TEXTURE0 + (p - CA_texcoord)); + glTexCoordPointer(num_values, type, stride, client_pointer); glEnableClientState(GL_TEXTURE_COORD_ARRAY); break; } - } else { - if (name == InternalName::get_normal() && num_values == 4) { - // In some cases, the normals are aligned to 4 values. We tell - // it to use three values exactly, otherwise we get the error: - // An unsupported GL extension was required to perform this operation. - num_values = 3; - } - cgGLSetParameterPointer(p, num_values, - _glgsg->get_numeric_type(numeric_type), - stride, client_pointer + start); - cgGLEnableClientState(p); } } else { - CGparameter p = _cg_parameter_map[_shader->_var_spec[i]._id._seqno]; - cgGLDisableClientState(p); + // There is no vertex column with this name; disable the attribute array. + if (p == 0) { + //NOTE: if we disable attribute 0 in compatibility profile, the object + // will disappear. In GLSL we fix this by forcing the vertex column + // to be at 0, but we don't have control over that with Cg. So, we + // work around this by just binding something silly to 0. + // This breaks flat colors, but it's better than invisible objects? + _glgsg->_glEnableVertexAttribArray(0); + if (bind._integer) { + _glgsg->_glVertexAttribIPointer(0, 4, GL_INT, 0, 0); + } else { + _glgsg->_glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0); + } + + } else if (p > 0) { + _glgsg->_glDisableVertexAttribArray(p); + + if (p == _color_attrib_index) { +#ifdef STDFLOAT_DOUBLE + _glgsg->_glVertexAttrib4dv(p, _glgsg->_scene_graph_color.get_data()); +#else + _glgsg->_glVertexAttrib4fv(p, _glgsg->_scene_graph_color.get_data()); +#endif + } + } else { + switch (p) { + case CA_unknown: + break; + case CA_vertex: + glDisableClientState(GL_VERTEX_ARRAY); + break; + case CA_normal: + glDisableClientState(GL_NORMAL_ARRAY); + break; + case CA_color: + glDisableClientState(GL_COLOR_ARRAY); +#ifdef STDFLOAT_DOUBLE + glColor4dv(_glgsg->_scene_graph_color.get_data()); +#else + glColor4fv(_glgsg->_scene_graph_color.get_data()); +#endif + break; + case CA_secondary_color: + glDisableClientState(GL_SECONDARY_COLOR_ARRAY); + break; + default: + _glgsg->_glClientActiveTexture(GL_TEXTURE0 + (p - CA_texcoord)); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + break; + } + } } } } + if (_transform_table_param) { + const TransformTable *table = _glgsg->_data_reader->get_transform_table(); + update_transform_table(table); + } + + if (_slider_table_param) { + const SliderTable *table = _glgsg->_data_reader->get_slider_table(); + update_slider_table(table); + } + cg_report_errors(); _glgsg->report_my_gl_errors(); diff --git a/panda/src/glstuff/glCgShaderContext_src.h b/panda/src/glstuff/glCgShaderContext_src.h index 16dd9bcdb2..da1f0bea78 100644 --- a/panda/src/glstuff/glCgShaderContext_src.h +++ b/panda/src/glstuff/glCgShaderContext_src.h @@ -41,6 +41,8 @@ public: void bind(bool reissue_parameters = true); void unbind(); void issue_parameters(int altered); + void update_transform_table(const TransformTable *table); + void update_slider_table(const SliderTable *table); void disable_shader_vertex_arrays(); bool update_shader_vertex_arrays(ShaderContext *prev, bool force); void disable_shader_texture_bindings(); @@ -50,13 +52,32 @@ public: INLINE bool uses_custom_vertex_arrays(void); INLINE bool uses_custom_texture_bindings(void); + // Special values for location to indicate conventional attrib slots. + enum ConventionalAttrib { + CA_unknown = -1, + CA_vertex = -2, + CA_normal = -3, + CA_color = -4, + CA_secondary_color = -5, + CA_texcoord = -32, + }; + private: CGprogram _cg_program; + GLuint _glsl_program; + + GLint _color_attrib_index; + CGparameter _transform_table_param; + CGparameter _slider_table_param; + long _transform_table_size; + long _slider_table_size; pvector _cg_parameter_map; CLP(GraphicsStateGuardian) *_glgsg; + bool _has_divisor; + void release_resources(); public: diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index c330776394..47a6910216 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -599,6 +599,17 @@ reset() { } #endif +#ifndef OPENGLES + if (is_at_least_gl_version(1, 4)) { + _glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) + get_extension_func("glSecondaryColorPointer"); + + } else if (has_extension("GL_EXT_secondary_color")) { + _glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) + get_extension_func("glSecondaryColorPointerEXT"); + } +#endif + #ifdef OPENGLES_2 _supports_vertex_blend = false; #else @@ -7121,6 +7132,7 @@ get_extension_func(const char *name) { #endif #ifdef EXPECT_GL_VERSION_1_4 { "glPointParameterfv", (void *)&glPointParameterfv }, + { "glSecondaryColorPointer", (void *)&glSecondaryColorPointer }, #endif #ifdef EXPECT_GL_VERSION_1_5 { "glBeginQuery", (void *)&glBeginQuery }, diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index d65c6477af..08753fd7fb 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -103,6 +103,7 @@ typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); @@ -662,6 +663,10 @@ public: bool _explicit_primitive_restart; #endif +#ifndef OPENGLES + PFNGLSECONDARYCOLORPOINTERPROC _glSecondaryColorPointer; +#endif + bool _supports_vertex_blend; PFNGLWEIGHTPOINTERARBPROC _glWeightPointer; PFNGLVERTEXBLENDARBPROC _glVertexBlend; diff --git a/panda/src/gobj/shader.I b/panda/src/gobj/shader.I index 1c00d40197..eccb05d79f 100644 --- a/panda/src/gobj/shader.I +++ b/panda/src/gobj/shader.I @@ -49,7 +49,7 @@ get_filename(const ShaderType &type) const { } else { // Um, better than nothing? - return _filename._vertex; + return _filename._fragment; } } diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 68bf6ebd1c..8f1cc70d33 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -553,6 +553,7 @@ cg_recurse_parameters(CGparameter parameter, const ShaderType &type, ShaderArgClass arg_subclass = arg_class; CGenum vbl = cgGetParameterVariability(parameter); + CGtype base_type = cgGetParameterBaseType(parameter); if ((vbl==CG_VARYING)||(vbl==CG_UNIFORM)) { switch (cgGetParameterType(parameter)) { @@ -567,16 +568,28 @@ cg_recurse_parameters(CGparameter parameter, const ShaderType &type, arg_dim[0] = cgGetArraySize(parameter, 0); + // Fall through default: { arg_dim[1] = cgGetParameterRows(parameter); arg_dim[2] = cgGetParameterColumns(parameter); - ShaderArgId id; - id._name = cgGetParameterName(parameter); - id._type = type; - id._seqno = -1; - success &= compile_parameter(id, arg_class, arg_subclass, arg_type, - arg_dir, (vbl == CG_VARYING), arg_dim, shader_cat.get_safe_ptr()); break; + ShaderArgInfo p; + p._id._name = cgGetParameterName(parameter); + p._id._type = type; + p._id._seqno = -1; + p._class = arg_class; + p._subclass = arg_subclass; + p._type = arg_type; + p._direction = arg_dir; + p._varying = (vbl == CG_VARYING); + p._integer = (base_type == CG_UINT || base_type == CG_INT || + base_type == CG_ULONG || base_type == CG_LONG || + base_type == CG_USHORT || base_type == CG_SHORT || + base_type == CG_UCHAR || base_type == CG_CHAR); + p._cat = shader_cat.get_safe_ptr(); + + success &= compile_parameter(p, arg_dim); + break; } } } @@ -601,24 +614,7 @@ cg_recurse_parameters(CGparameter parameter, const ShaderType &type, // an error message onto the error messages. //////////////////////////////////////////////////////////////////// bool Shader:: -compile_parameter(const ShaderArgId &arg_id, - const ShaderArgClass &arg_class, - const ShaderArgClass &arg_subclass, - const ShaderArgType &arg_type, - const ShaderArgDir &arg_direction, - bool arg_varying, - int *arg_dim, - NotifyCategory *arg_cat) -{ - ShaderArgInfo p; - p._id = arg_id; - p._class = arg_class; - p._subclass = arg_subclass; - p._type = arg_type; - p._direction = arg_direction; - p._varying = arg_varying; - p._cat = arg_cat; - +compile_parameter(ShaderArgInfo &p, int *arg_dim) { if (p._id._name.size() == 0) return true; if (p._id._name[0] == '$') return true; @@ -650,9 +646,9 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderVarSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._append_uv = -1; - bind._integer = false; + bind._integer = p._integer; if (pieces.size() == 2) { if (pieces[1] == "position") { @@ -685,6 +681,24 @@ compile_parameter(const ShaderArgId &arg_id, _var_spec.push_back(bind); return true; } + } else if (pieces.size() == 3) { + if (pieces[1] == "transform") { + if (pieces[2] == "blend") { + bind._name = InternalName::get_transform_blend(); + _var_spec.push_back(bind); + return true; + } + if (pieces[2] == "index") { + bind._name = InternalName::get_transform_index(); + _var_spec.push_back(bind); + return true; + } + if (pieces[2] == "weight") { + bind._name = InternalName::get_transform_weight(); + _var_spec.push_back(bind); + return true; + } + } } bind._name = InternalName::get_root(); @@ -793,7 +807,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._func = SMF_compose; int next = 1; @@ -856,7 +870,7 @@ compile_parameter(const ShaderArgId &arg_id, if (!cp_errchk_parameter_float(p,16,16)) { return false; } - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_transpose; bind._func = SMF_first; bind._part[0] = SMO_attr_material; @@ -867,7 +881,7 @@ compile_parameter(const ShaderArgId &arg_id, if (!cp_errchk_parameter_float(p,3,4)) { return false; } - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_attr_color; @@ -878,7 +892,7 @@ compile_parameter(const ShaderArgId &arg_id, if (!cp_errchk_parameter_float(p,3,4)) { return false; } - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_attr_colorscale; @@ -889,7 +903,7 @@ compile_parameter(const ShaderArgId &arg_id, if (!cp_errchk_parameter_float(p,3,4)) { return false; } - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_attr_fog; @@ -900,7 +914,7 @@ compile_parameter(const ShaderArgId &arg_id, if (!cp_errchk_parameter_float(p,3,4)) { return false; } - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_attr_fogcolor; @@ -940,7 +954,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_alight_x; @@ -961,7 +975,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_satten_x; @@ -981,7 +995,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_transpose; int next = 1; pieces.push_back(""); @@ -1023,7 +1037,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_whole; bind._func = SMF_first; bind._part[0] = SMO_texmat_x; @@ -1044,7 +1058,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_plane_x; @@ -1065,7 +1079,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_clipplane_x; @@ -1087,7 +1101,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[1] = SMO_identity; @@ -1136,7 +1150,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderTexSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._name = 0; bind._stage = atoi(pieces[1].c_str()); switch (p._type) { @@ -1168,7 +1182,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_texpad_x; @@ -1188,7 +1202,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; } ShaderMatSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._piece = SMP_row3; bind._func = SMF_first; bind._part[0] = SMO_texpix_x; @@ -1200,6 +1214,11 @@ compile_parameter(const ShaderArgId &arg_id, return true; } + if (pieces[0] == "tbl") { + // Handled elsewhere. + return true; + } + if (pieces[0] == "l") { // IMPLEMENT THE ERROR CHECKING return true; // Cg handles this automatically. @@ -1235,7 +1254,7 @@ compile_parameter(const ShaderArgId &arg_id, return false; ShaderPtrSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._arg = kinputname; bind._info = p; bind._dep[0] = SSD_general | SSD_shaderinputs; @@ -1253,7 +1272,7 @@ compile_parameter(const ShaderArgId &arg_id, switch (p._type) { case SAT_sampler1d: { ShaderTexSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._name = kinputname; bind._desired_type = Texture::TT_1d_texture; _tex_spec.push_back(bind); @@ -1261,7 +1280,7 @@ compile_parameter(const ShaderArgId &arg_id, } case SAT_sampler2d: { ShaderTexSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._name = kinputname; bind._desired_type = Texture::TT_2d_texture; _tex_spec.push_back(bind); @@ -1269,7 +1288,7 @@ compile_parameter(const ShaderArgId &arg_id, } case SAT_sampler3d: { ShaderTexSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._name = kinputname; bind._desired_type = Texture::TT_3d_texture; _tex_spec.push_back(bind); @@ -1277,7 +1296,7 @@ compile_parameter(const ShaderArgId &arg_id, } case SAT_sampler2dArray: { ShaderTexSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._name = kinputname; bind._desired_type = Texture::TT_2d_texture_array; _tex_spec.push_back(bind); @@ -1285,7 +1304,7 @@ compile_parameter(const ShaderArgId &arg_id, } case SAT_samplercube: { ShaderTexSpec bind; - bind._id = arg_id; + bind._id = p._id; bind._name = kinputname; bind._desired_type = Texture::TT_cube_map; _tex_spec.push_back(bind); @@ -1385,7 +1404,8 @@ cg_parameter_type(CGparameter p) { default: return SAT_unknown; } case CG_PARAMETERCLASS_ARRAY: return SAT_unknown; - default: return SAT_unknown; + default: + return SAT_unknown; } } @@ -1531,6 +1551,12 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, if (shader_cat.is_debug()) { shader_cat.debug() << "Compilation with active profile failed: " << cgGetErrorString(err) << "\n"; + if (err == CG_COMPILER_ERROR) { + const char *listing = cgGetLastListing(context); + if (listing != NULL) { + shader_cat.debug(false) << listing; + } + } } } @@ -1632,19 +1658,19 @@ cg_compile_shader(const ShaderCaps &caps, CGcontext context) { shader_cat.debug() << "Cg vertex profile: " << cgGetProfileString((CGprofile)_cg_vprofile) << "\n"; vertex_program = cgGetProgramString(_cg_vprogram, CG_COMPILED_PROGRAM); - shader_cat.debug() << vertex_program << "\n"; + shader_cat.spam() << vertex_program << "\n"; } if (_cg_fprogram != 0) { shader_cat.debug() << "Cg fragment profile: " << cgGetProfileString((CGprofile)_cg_fprofile) << "\n"; fragment_program = cgGetProgramString(_cg_fprogram, CG_COMPILED_PROGRAM); - shader_cat.debug() << fragment_program << "\n"; + shader_cat.spam() << fragment_program << "\n"; } if (_cg_gprogram != 0) { shader_cat.debug() << "Cg geometry profile: " << cgGetProfileString((CGprofile)_cg_gprofile) << "\n"; geometry_program = cgGetProgramString(_cg_gprogram, CG_COMPILED_PROGRAM); - shader_cat.debug() << geometry_program << "\n"; + shader_cat.spam() << geometry_program << "\n"; } } @@ -1745,17 +1771,18 @@ cg_analyze_shader(const ShaderCaps &caps) { } } - // Assign sequence numbers to all parameters. + // Assign sequence numbers to all parameters. GLCgShaderContext relies + // on the fact that the varyings start at seqno 0. int seqno = 0; + for (int i=0; i<(int)_var_spec.size(); i++) { + _var_spec[i]._id._seqno = seqno++; + } for (int i=0; i<(int)_mat_spec.size(); i++) { _mat_spec[i]._id._seqno = seqno++; } for (int i=0; i<(int)_tex_spec.size(); i++) { _tex_spec[i]._id._seqno = seqno++; } - for (int i=0; i<(int)_var_spec.size(); i++) { - _var_spec[i]._id._seqno = seqno++; - } for (int i=0; i<(int)_ptr_spec.size(); i++) { _ptr_spec[i]._id._seqno = seqno++; @@ -1955,7 +1982,7 @@ cg_compile_for(const ShaderCaps &caps, CGcontext context, const char *resource = cgGetParameterResourceName(p); if (resource != NULL) { shader_cat.debug() << "Texture parameter " << id._name - << " is bound to resource " << resource << "\n"; + << " is bound to resource " << resource << "\n"; } } map[id._seqno] = p; @@ -1967,48 +1994,18 @@ cg_compile_for(const ShaderCaps &caps, CGcontext context, const char *resource = cgGetParameterResourceName(p); if (shader_cat.is_debug() && resource != NULL) { - shader_cat.debug() - << "Varying parameter " << id._name << " is bound to resource " - << cgGetParameterResourceName(p) << "\n"; + if (cgGetParameterResource(p) == CG_GLSL_ATTRIB) { + shader_cat.debug() + << "Varying parameter " << id._name << " is bound to GLSL attribute " + << resource << "\n"; + } else { + shader_cat.debug() + << "Varying parameter " << id._name << " is bound to resource " + << resource << " (" << cgGetParameterResource(p) + << ", index " << cgGetParameterResourceIndex(p) << ")\n"; + } } - if (cgGetParameterBaseResource(p) == CG_UNDEFINED) { - // I really don't know what this means, but it happens when I - // use the NORMAL0 semantic instead of NORMAL, or POSITION0 - // instead of POSITION, etc. Not catching this results in a - // continuous stream of errors at the renderer side. - shader_cat.error() - << "Varying parameter " << id._name; - - const char *semantic = cgGetParameterSemantic(p); - if (semantic != NULL) { - shader_cat.error(false) << " : " << semantic; - } - if (resource != NULL) { - shader_cat.error(false) << " (bound to resource " << resource << ")"; - } - shader_cat.error(false) << " is invalid!\n"; - -#ifndef NDEBUG - // Let's try to give the developer a hint... - if (semantic != NULL) { - if (strcmp(semantic, "POSITION0") == 0) { - shader_cat.error() << "Try using the semantic POSITION instead of POSITION0.\n"; - } else if (strcmp(semantic, "NORMAL0") == 0) { - shader_cat.error() << "Try using the semantic NORMAL instead of NORMAL0.\n"; - } else if (strcmp(semantic, "DIFFUSE0") == 0) { - shader_cat.error() << "Try using the semantic DIFFUSE instead of DIFFUSE0.\n"; - } else if (strcmp(semantic, "SPECULAR0") == 0) { - shader_cat.error() << "Try using the semantic SPECULAR instead of SPECULAR0.\n"; - } else if (strcmp(semantic, "FOGCOORD0") == 0) { - shader_cat.error() << "Try using the semantic FOGCOORD instead of FOGCOORD0.\n"; - } else if (strcmp(semantic, "PSIZE0") == 0) { - shader_cat.error() << "Try using the semantic PSIZE instead of PSIZE0.\n"; - } - } -#endif // NDEBUG - p = 0; - } map[id._seqno] = p; } @@ -2059,9 +2056,9 @@ Shader(ShaderLanguage lang) : _cg_fprofile = CG_PROFILE_UNKNOWN; _cg_gprofile = CG_PROFILE_UNKNOWN; if (_default_caps._ultimate_vprofile == 0 || _default_caps._ultimate_vprofile == CG_PROFILE_UNKNOWN) { - _default_caps._active_vprofile = CG_PROFILE_UNKNOWN; - _default_caps._active_fprofile = CG_PROFILE_UNKNOWN; - _default_caps._active_gprofile = CG_PROFILE_UNKNOWN; + _default_caps._active_vprofile = CG_PROFILE_GENERIC; + _default_caps._active_fprofile = CG_PROFILE_GENERIC; + _default_caps._active_gprofile = CG_PROFILE_GENERIC; _default_caps._ultimate_vprofile = cgGetProfile("glslv"); _default_caps._ultimate_fprofile = cgGetProfile("glslf"); _default_caps._ultimate_gprofile = cgGetProfile("glslg"); diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 45bcab70f9..e56960b1f5 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -297,6 +297,7 @@ public: ShaderArgType _type; ShaderArgDir _direction; bool _varying; + bool _integer; NotifyCategory *_cat; }; @@ -478,14 +479,7 @@ public: bool &success); #endif - bool compile_parameter(const ShaderArgId &arg_id, - const ShaderArgClass &arg_class, - const ShaderArgClass &arg_subclass, - const ShaderArgType &arg_type, - const ShaderArgDir &arg_direction, - bool arg_varying, - int *arg_dim, - NotifyCategory *arg_cat); + bool compile_parameter(ShaderArgInfo &p, int *arg_dim); void clear_parameters(); diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index 14a6bad1d0..b842850db7 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -18,6 +18,7 @@ #include "colorAttrib.h" #include "texGenAttrib.h" #include "textureAttrib.h" +#include "shaderAttrib.h" #include "renderState.h" #include "clockObject.h" #include "cullTraverser.h" @@ -128,6 +129,17 @@ munge_geom(GraphicsStateGuardianBase *gsg, return false; } + // If we have prepared it for skinning via the shader generator, + // mark a flag on the state so that the shader generator will do this. + // We should probably find a cleaner way to do this. + const ShaderAttrib *sattr; + if (_state->get_attrib(sattr) && sattr->auto_shader()) { + GeomVertexDataPipelineReader data_reader(_munged_data, current_thread); + if (data_reader.get_format()->get_animation().get_animation_type() == Geom::AT_hardware) { + _state = _state->set_attrib(sattr->set_flag(ShaderAttrib::F_hardware_skinning, true)); + } + } + StateMunger *state_munger; DCAST_INTO_R(state_munger, munger, false); _state = state_munger->munge_state(_state); diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index e1bc57d632..4a59fb5302 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -271,8 +271,8 @@ private: // The code to manage this map lives in // GraphicsStateGuardian::get_geom_munger(). typedef pmap Mungers; - Mungers _mungers; - Mungers::const_iterator _last_mi; + mutable Mungers _mungers; + mutable Mungers::const_iterator _last_mi; // This is used to mark nodes as we visit them to detect cycles. UpdateSeq _cycle_detect; diff --git a/panda/src/pgraph/shaderAttrib.cxx b/panda/src/pgraph/shaderAttrib.cxx index 1cfb112b93..82f05cfbad 100644 --- a/panda/src/pgraph/shaderAttrib.cxx +++ b/panda/src/pgraph/shaderAttrib.cxx @@ -702,6 +702,7 @@ get_auto_shader_attrib_impl(const RenderState *state) const { attrib->_auto_gloss_on = _auto_gloss_on; attrib->_auto_ramp_on = _auto_ramp_on; attrib->_auto_shadow_on = _auto_shadow_on; + attrib->_flags = _flags; return return_new(attrib); } diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 8e4a931076..488fe84c95 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -92,19 +92,25 @@ reset_register_allocator() { //////////////////////////////////////////////////////////////////// const char *ShaderGenerator:: alloc_vreg() { + // The ATTR# input sseem to map to generic vertex attributes in + // both arbvp1 and glslv, which behave more consistently. switch (_vtregs_used) { - case 0: _vtregs_used += 1; return "TEXCOORD0"; - case 1: _vtregs_used += 1; return "TEXCOORD1"; - case 2: _vtregs_used += 1; return "TEXCOORD2"; - case 3: _vtregs_used += 1; return "TEXCOORD3"; - case 4: _vtregs_used += 1; return "TEXCOORD4"; - case 5: _vtregs_used += 1; return "TEXCOORD5"; - case 6: _vtregs_used += 1; return "TEXCOORD6"; - case 7: _vtregs_used += 1; return "TEXCOORD7"; + case 0: _vtregs_used += 1; return "ATTR8"; + case 1: _vtregs_used += 1; return "ATTR9"; + case 2: _vtregs_used += 1; return "ATTR10"; + case 3: _vtregs_used += 1; return "ATTR11"; + case 4: _vtregs_used += 1; return "ATTR12"; + case 5: _vtregs_used += 1; return "ATTR13"; + case 6: _vtregs_used += 1; return "ATTR14"; + case 7: _vtregs_used += 1; return "ATTR15"; } switch (_vcregs_used) { - case 0: _vcregs_used += 1; return "COLOR0"; - case 1: _vcregs_used += 1; return "COLOR1"; + case 0: _vcregs_used += 1; return "ATTR3"; + case 1: _vcregs_used += 1; return "ATTR4"; + case 2: _vcregs_used += 1; return "ATTR5"; + case 3: _vcregs_used += 1; return "ATTR6"; + case 4: _vcregs_used += 1; return "ATTR7"; + case 5: _vcregs_used += 1; return "ATTR1"; } // These don't exist in arbvp1, though they're reportedly // supported by other profiles. @@ -615,6 +621,7 @@ update_shadow_buffer(NodePath light_np) { // - texmatrix // - 1D/2D/3D textures, cube textures, 2D tex arrays // - linear/exp/exp2 fog +// - animation // // Not yet supported: // - dot3_rgb and dot3_rgba combine modes @@ -624,7 +631,7 @@ update_shadow_buffer(NodePath light_np) { // //////////////////////////////////////////////////////////////////// CPT(ShaderAttrib) ShaderGenerator:: -synthesize_shader(const RenderState *rs) { +synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { analyze_renderstate(rs); reset_register_allocator(); @@ -706,7 +713,7 @@ synthesize_shader(const RenderState *rs) { } } if (_vertex_colors) { - text << "\t in float4 vtx_color : COLOR0,\n"; + text << "\t in float4 vtx_color : ATTR3,\n"; text << "\t out float4 l_color : COLOR0,\n"; } if (_need_world_position || _need_world_normal) { @@ -733,7 +740,7 @@ synthesize_shader(const RenderState *rs) { text << "\t out float4 l_eye_normal : " << eye_normal_freg << ",\n"; } if (_map_index_height >= 0 || _need_world_normal || _need_eye_normal) { - text << "\t in float3 vtx_normal : NORMAL,\n"; + text << "\t in float3 vtx_normal : ATTR2,\n"; } if (_map_index_height >= 0) { text << "\t uniform float4 mspos_view,\n"; @@ -765,11 +772,50 @@ synthesize_shader(const RenderState *rs) { hpos_freg = alloc_freg(); text << "\t out float4 l_hpos : " << hpos_freg << ",\n"; } - text << "\t float4 vtx_position : POSITION,\n"; + if (anim.get_animation_type() == GeomEnums::AT_hardware && + anim.get_num_transforms() > 0) { + int num_transforms; + if (anim.get_indexed_transforms()) { + num_transforms = 120; + } else { + num_transforms = anim.get_num_transforms(); + } + text << "\t uniform float4x4 tbl_transforms[" << num_transforms << "],\n"; + text << "\t in float4 vtx_transform_weight : ATTR1,\n"; + if (anim.get_indexed_transforms()) { + text << "\t in uint4 vtx_transform_index : ATTR7,\n"; + } + } + text << "\t in float4 vtx_position : ATTR0,\n"; text << "\t out float4 l_position : POSITION,\n"; text << "\t uniform float4x4 mat_modelproj\n"; text << ") {\n"; + if (anim.get_animation_type() == GeomEnums::AT_hardware && + anim.get_num_transforms() > 0) { + + if (!anim.get_indexed_transforms()) { + text << "\t const uint4 vtx_transform_index = uint4(0, 1, 2, 3);\n"; + } + + text << "\t float4x4 matrix = tbl_transforms[vtx_transform_index.x] * vtx_transform_weight.x"; + if (anim.get_num_transforms() > 1) { + text << "\n\t + tbl_transforms[vtx_transform_index.y] * vtx_transform_weight.y"; + } + if (anim.get_num_transforms() > 2) { + text << "\n\t + tbl_transforms[vtx_transform_index.z] * vtx_transform_weight.z"; + } + if (anim.get_num_transforms() > 3) { + text << "\n\t + tbl_transforms[vtx_transform_index.w] * vtx_transform_weight.w"; + } + text << ";\n"; + + text << "\t vtx_position = mul(matrix, vtx_position);\n"; + if (_need_world_normal || _need_eye_normal) { + text << "\t vtx_normal = mul((float3x3)matrix, vtx_normal);\n"; + } + } + text << "\t l_position = mul(mat_modelproj, vtx_position);\n"; if (_fog) { text << "\t l_hpos = l_position;\n"; diff --git a/panda/src/pgraphnodes/shaderGenerator.h b/panda/src/pgraphnodes/shaderGenerator.h index 8d414812de..146f115d9a 100644 --- a/panda/src/pgraphnodes/shaderGenerator.h +++ b/panda/src/pgraphnodes/shaderGenerator.h @@ -33,6 +33,7 @@ class DirectionalLight; class PointLight; class Spotlight; class LightAttrib; +class GeomVertexAnimationSpec; //////////////////////////////////////////////////////////////////// // Class : ShaderGenerator @@ -71,7 +72,8 @@ class EXPCL_PANDA_PGRAPHNODES ShaderGenerator : public TypedReferenceCount { PUBLISHED: ShaderGenerator(GraphicsStateGuardianBase *gsg, GraphicsOutputBase *host); virtual ~ShaderGenerator(); - virtual CPT(ShaderAttrib) synthesize_shader(const RenderState *rs); + virtual CPT(ShaderAttrib) synthesize_shader(const RenderState *rs, + const GeomVertexAnimationSpec &anim); protected: CPT(RenderAttrib) create_shader_attrib(const string &txt); From 7ce2a97bef4e65a4e3fec8fba44c815ce29faaf5 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Jul 2015 02:37:48 +0100 Subject: [PATCH 045/203] BGRA color order fix for Cg on Windows --- panda/src/glstuff/glCgShaderContext_src.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glCgShaderContext_src.cxx b/panda/src/glstuff/glCgShaderContext_src.cxx index 47fc97f586..0ff4bacd6c 100644 --- a/panda/src/glstuff/glCgShaderContext_src.cxx +++ b/panda/src/glstuff/glCgShaderContext_src.cxx @@ -172,7 +172,7 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte // can only ever be sure that vtx_position is bound. GLCAT.warning() << "CG varying vtx_position is bound to generic attribute " << loc - << "instead of 0. Use ATTR0 semantic to prevent this.\n"; + << " instead of 0. Use ATTR0 semantic to prevent this.\n"; } } @@ -816,7 +816,11 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { break; case CA_color: - glColorPointer(num_values, type, stride, client_pointer); + if (numeric_type == GeomEnums::NT_packed_dabc) { + glColorPointer(GL_BGRA, GL_UNSIGNED_BYTE, stride, client_pointer); + } else { + glColorPointer(num_values, type, stride, client_pointer); + } glEnableClientState(GL_COLOR_ARRAY); break; From 9b6f4eeaf95d0b9ea57c22a5ba7b7e3603c9c9a3 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Jul 2015 02:58:57 +0100 Subject: [PATCH 046/203] Fix compiler warnings in MSVC --- panda/src/gobj/geomVertexColumn.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panda/src/gobj/geomVertexColumn.cxx b/panda/src/gobj/geomVertexColumn.cxx index b90f231dde..b803f3e1ac 100644 --- a/panda/src/gobj/geomVertexColumn.cxx +++ b/panda/src/gobj/geomVertexColumn.cxx @@ -3619,6 +3619,8 @@ get_data3f(const unsigned char *pointer) { _v3.set(v4[0], v4[1], v4[2]); return _v3; } + + return _v3; } //////////////////////////////////////////////////////////////////// @@ -3703,6 +3705,8 @@ get_data4f(const unsigned char *pointer) { return _v4; } } + + return _v4; } //////////////////////////////////////////////////////////////////// @@ -3838,6 +3842,8 @@ get_data3d(const unsigned char *pointer) { _v3d.set(v4[0], v4[1], v4[2]); return _v3d; } + + return _v3d; } //////////////////////////////////////////////////////////////////// @@ -3922,6 +3928,8 @@ get_data4d(const unsigned char *pointer) { return _v4d; } } + + return _v4d; } //////////////////////////////////////////////////////////////////// From 88f72795227d1e672e829401f3db4cf97a5fcb5b Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Jul 2015 03:17:42 +0100 Subject: [PATCH 047/203] Make it easier to make Python 3 builds on Windows --- makepanda/installpanda.py | 2 +- makepanda/makepanda.py | 40 +++++++++++++++++++++++++------------- makepanda/makepandacore.py | 26 ++++++++++++++++++------- 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/makepanda/installpanda.py b/makepanda/installpanda.py index 41e78bc85a..a84fb02ac6 100644 --- a/makepanda/installpanda.py +++ b/makepanda/installpanda.py @@ -127,7 +127,7 @@ def GetLibDir(): something like "lib" or "lib64" or in some cases, something similar to "lib/x86_64-linux-gnu". """ - if sys.platform == "darwin": + if sys.platform in ("darwin", "win32"): return "lib" # This one's a bit tricky. Some systems require us to install diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 5a4d39a7fb..9ac5c7dc5a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2764,6 +2764,10 @@ if tp_dir is not None: CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll) if not RTDIST: CopyTree(GetOutputDir() + "/python", SDK["PYTHON"]) + if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"): + CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe") + if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"): + CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe") ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n") ######################################################################## @@ -6411,7 +6415,7 @@ def MakeInstallerNSIS(file, title, installdir): shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file) return - print("Building "+title+" installer. This can take up to an hour.") + print("Building "+title+" installer at %s" % (file)) if (COMPRESSOR != "lzma"): print("Note: you are using zlib, which is faster, but lzma gives better compression.") if (os.path.exists("nsis-output.exe")): @@ -6953,19 +6957,29 @@ try: if INSTALLER: ProgressOutput(100.0, "Building installer") target = GetTarget() - if (target == 'windows'): - dbg = "" - if (GetOptimize() <= 2): dbg = "-dbg" - if GetTargetArch() == 'x64': - if (RUNTIME): - MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+"-x64.exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64") - else: - MakeInstallerNSIS("Panda3D-"+VERSION+dbg+"-x64.exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION+"-x64") + if target == 'windows': + fn = "Panda3D-" + dir = "C:\\Panda3D-" + VERSION + + if RUNTIME: + fn += "Runtime-" + title = "Panda3D " + VERSION else: - if (RUNTIME): - MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+".exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION) - else: - MakeInstallerNSIS("Panda3D-"+VERSION+dbg+".exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION) + title = "Panda3D SDK " + VERSION + + fn += VERSION + + if SDK["PYTHONVERSION"] != "python2.7": + fn += '-py' + SDK["PYTHONVERSION"][6:] + + if GetOptimize() <= 2: + fn += "-dbg" + if GetTargetArch() == 'x64': + fn += '-x64' + dir += '-x64' + + fn += '.exe' + MakeInstallerNSIS(fn, title, dir) elif (target == 'linux'): MakeInstallerLinux() elif (target == 'darwin'): diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index c490f0eafb..aa3207b806 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -1845,12 +1845,18 @@ def SdkLocatePython(prefer_thirdparty_python=False): return if GetTarget() == 'windows': - SDK["PYTHON"] = GetThirdpartyBase() + "/win-python" - if (GetOptimize() <= 2): - SDK["PYTHON"] += "-dbg" - if (GetTargetArch() == 'x64' and os.path.isdir(SDK["PYTHON"] + "-x64")): - SDK["PYTHON"] += "-x64" + sdkdir = GetThirdpartyBase() + "/win-python" + if sys.version_info >= (3, 0): + # Python 3 build... + sdkdir += "%d.%d" % sys.version_info[:2] + + if GetOptimize() <= 2: + sdkdir += "-dbg" + if GetTargetArch() == 'x64': + sdkdir += "-x64" + + SDK["PYTHON"] = sdkdir SDK["PYTHONEXEC"] = SDK["PYTHON"].replace('/', '\\') + "\\python" if (GetOptimize() <= 2): SDK["PYTHONEXEC"] += "_d.exe" @@ -1872,10 +1878,14 @@ def SdkLocatePython(prefer_thirdparty_python=False): exit("Found multiple Python dlls in %s." % (SDK["PYTHON"])) py_dll = os.path.basename(py_dlls[0]) - SDK["PYTHONVERSION"] = "python" + py_dll[6] + "." + py_dll[7] + ver = py_dll[6] + "." + py_dll[7] + SDK["PYTHONVERSION"] = "python" + ver os.environ["PYTHONHOME"] = SDK["PYTHON"] + if sys.version[:3] != ver: + print("Warning: running makepanda with Python %s, but building Panda3D with Python %s." % (sys.version[:3], ver)) + elif CrossCompiling() or (prefer_thirdparty_python and os.path.isdir(os.path.join(GetThirdpartyDir(), "python"))): tp_python = os.path.join(GetThirdpartyDir(), "python") @@ -1933,6 +1943,8 @@ def SdkLocatePython(prefer_thirdparty_python=False): if GetVerbose(): print("Using Python %s build located at %s" % (SDK["PYTHONVERSION"][6:9], SDK["PYTHON"])) + else: + print("Using Python %s" % (SDK["PYTHONVERSION"][6:9])) def SdkLocateVisualStudio(): if (GetHost() != "windows"): return @@ -2287,7 +2299,7 @@ def SetupBuildEnvironment(compiler): print("Host OS: %s" % GetHost()) print("Host arch: %s" % GetHostArch()) print("Target OS: %s" % GetTarget()) - print("Target arch: %s" % GetTargetArch()) + print("Target arch: %s" % GetTargetArch()) if compiler == "MSVC": # Add the visual studio tools to PATH et al. From 828e52578d34671cc539362d4cf4f4c47f5584fa Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 8 Jul 2015 01:58:35 +0200 Subject: [PATCH 048/203] Allow a long (provided it is not overflowing) where an int is accepted --- .../interrogate/interfaceMakerPythonNative.cxx | 15 ++++++--------- dtool/src/interrogatedb/py_panda.h | 2 ++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index ec7e84adfe..cf6434508b 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -4774,10 +4774,9 @@ write_function_instance(ostream &out, FunctionRemap *remap, } else if (TypeManager::is_unsigned_short(type)) { if (args_type == AT_single_arg) { - // This is defined to PyLong_Check for Python 3 by py_panda.h. - type_check = "PyInt_Check(arg)"; + type_check = "PyLongOrInt_Check(arg)"; extra_convert - << "long " << param_name << " = PyInt_AS_LONG(arg);\n"; + << "long " << param_name << " = PyLongOrInt_AS_LONG(arg);\n"; pexpr_string = "(" + type->get_local_name(&parser) + ")" + param_name; } else { @@ -4804,12 +4803,11 @@ write_function_instance(ostream &out, FunctionRemap *remap, } else if (TypeManager::is_short(type)) { if (args_type == AT_single_arg) { - // This is defined to PyLong_Check for Python 3 by py_panda.h. - type_check = "PyInt_Check(arg)"; + type_check = "PyLongOrInt_Check(arg)"; // Perform overflow checking in debug builds. extra_convert - << "long arg_val = PyInt_AS_LONG(arg);\n" + << "long arg_val = PyLongOrInt_AS_LONG(arg);\n" << "#ifndef NDEBUG\n" << "if (arg_val < SHRT_MIN || arg_val > SHRT_MAX) {\n"; @@ -4867,14 +4865,13 @@ write_function_instance(ostream &out, FunctionRemap *remap, } else if (TypeManager::is_integer(type)) { if (args_type == AT_single_arg) { - // This is defined to PyLong_Check for Python 3 by py_panda.h. - type_check = "PyInt_Check(arg)"; + type_check = "PyLongOrInt_Check(arg)"; // Perform overflow checking in debug builds. Note that Python 2 // stores longs internally, for ints, so we don't do it on Windows, // where longs are the same size as ints. extra_convert - << "long arg_val = PyInt_AS_LONG(arg);\n" + << "long arg_val = PyLongOrInt_AS_LONG(arg);\n" << "#if (SIZEOF_LONG > SIZEOF_INT) && !defined(NDEBUG)\n" << "if (arg_val < INT_MIN || arg_val > INT_MAX) {\n"; diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index babf870934..7ad2e5857a 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -114,6 +114,7 @@ inline PyObject* doPy_RETURN_FALSE() #define PyLongOrInt_FromSize_t PyLong_FromSize_t #define PyLongOrInt_FromLong PyLong_FromLong #define PyLongOrInt_FromUnsignedLong PyLong_FromUnsignedLong +#define PyLongOrInt_AS_LONG PyLong_AS_LONG #define PyInt_Check PyLong_Check #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG @@ -122,6 +123,7 @@ inline PyObject* doPy_RETURN_FALSE() // PyInt_FromSize_t automatically picks the right type. #define PyLongOrInt_FromSize_t PyInt_FromSize_t #define PyLongOrInt_FromLong PyInt_FromLong +#define PyLongOrInt_AS_LONG PyInt_AsLong // For more portably defining hash functions. typedef long Py_hash_t; From 5913546229e1124755910d526fb6dc88d92c62a3 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 8 Jul 2015 02:03:24 +0200 Subject: [PATCH 049/203] Proper overflow checking for numeric chars --- .../interfaceMakerPythonNative.cxx | 27 +++++++++++---- dtool/src/interrogate/typeManager.cxx | 34 +++++++++++++++++++ dtool/src/interrogate/typeManager.h | 1 + 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 605c8e1343..a6daee775b 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -4929,7 +4929,9 @@ write_function_instance(ostream &out, FunctionRemap *remap, expected_params += "long"; only_pyobjects = false; - } else if (TypeManager::is_unsigned_short(type)) { + } else if (TypeManager::is_unsigned_short(type) || + TypeManager::is_unsigned_char(type) || TypeManager::is_signed_char(type)) { + if (args_type == AT_single_arg) { type_check = "PyLongOrInt_Check(arg)"; extra_convert @@ -4945,12 +4947,25 @@ write_function_instance(ostream &out, FunctionRemap *remap, // The "H" format code, unlike "h", does not do overflow checking, so // we have to do it ourselves (except in release builds). extra_convert - << "#ifndef NDEBUG\n" - << "if (" << param_name << " < 0 || " << param_name << " > USHRT_MAX) {\n"; + << "#ifndef NDEBUG\n"; + + if (TypeManager::is_unsigned_short(type)) { + extra_convert << "if (" << param_name << " < 0 || " << param_name << " > USHRT_MAX) {\n"; + error_raise_return(extra_convert, 2, return_flags, "OverflowError", + "value %ld out of range for unsigned short integer", + param_name); + } else if (TypeManager::is_unsigned_char(type)) { + extra_convert << "if (" << param_name << " < 0 || " << param_name << " > UCHAR_MAX) {\n"; + error_raise_return(extra_convert, 2, return_flags, "OverflowError", + "value %ld out of range for unsigned byte", + param_name); + } else { + extra_convert << "if (" << param_name << " < CHAR_MIN || " << param_name << " > CHAR_MAX) {\n"; + error_raise_return(extra_convert, 2, return_flags, "OverflowError", + "value %ld out of range for signed byte", + param_name); + } - error_raise_return(extra_convert, 2, return_flags, "OverflowError", - "value %ld out of range for unsigned short integer", - param_name); extra_convert << "}\n" << "#endif\n"; diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index 05372ab30c..c8e6dce9c7 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -638,6 +638,40 @@ is_unsigned_char(CPPType *type) { return false; } +//////////////////////////////////////////////////////////////////// +// Function: TypeManager::is_signed_char +// Access: Public, Static +// Description: Returns true if the indicated type is signed char, +// but not unsigned or 'plain' char. +//////////////////////////////////////////////////////////////////// +bool TypeManager:: +is_signed_char(CPPType *type) { + switch (type->get_subtype()) { + case CPPDeclaration::ST_const: + return is_signed_char(type->as_const_type()->_wrapped_around); + + case CPPDeclaration::ST_simple: + { + CPPSimpleType *simple_type = type->as_simple_type(); + + if (simple_type != (CPPSimpleType *)NULL) { + return + (simple_type->_type == CPPSimpleType::T_char) && + (simple_type->_flags & CPPSimpleType::F_signed) != 0; + } + } + break; + + case CPPDeclaration::ST_typedef: + return is_signed_char(type->as_typedef_type()->_type); + + default: + break; + } + + return false; +} + //////////////////////////////////////////////////////////////////// // Function: TypeManager::is_char_pointer // Access: Public, Static diff --git a/dtool/src/interrogate/typeManager.h b/dtool/src/interrogate/typeManager.h index 848f3907ca..29b29eb2c7 100644 --- a/dtool/src/interrogate/typeManager.h +++ b/dtool/src/interrogate/typeManager.h @@ -67,6 +67,7 @@ public: static bool is_pointable(CPPType *type); static bool is_char(CPPType *type); static bool is_unsigned_char(CPPType *type); + static bool is_signed_char(CPPType *type); static bool is_char_pointer(CPPType *type); static bool is_const_char_pointer(CPPType *type); static bool is_unsigned_char_pointer(CPPType *type); From 220015a234125b4f9f0dcef97e0e3147d7ad7b22 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 9 Jul 2015 14:26:24 +0200 Subject: [PATCH 050/203] Drop support for vertex blend/matrix palette in OpenGL, no driver ever supported it (well) --- .../glstuff/glGraphicsStateGuardian_src.cxx | 280 +----------------- .../src/glstuff/glGraphicsStateGuardian_src.h | 25 -- panda/src/glstuff/glmisc_src.cxx | 4 - panda/src/glstuff/glmisc_src.h | 1 - 4 files changed, 1 insertion(+), 309 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 47a6910216..527d8219ef 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -610,115 +610,6 @@ reset() { } #endif -#ifdef OPENGLES_2 - _supports_vertex_blend = false; -#else - _supports_vertex_blend = has_extension("GL_ARB_vertex_blend"); - - if (_supports_vertex_blend) { - _glWeightPointer = (PFNGLWEIGHTPOINTERARBPROC) - get_extension_func("glWeightPointerARB"); - _glVertexBlend = (PFNGLVERTEXBLENDARBPROC) - get_extension_func("glVertexBlendARB"); - _glWeightfv = (PFNGLWEIGHTFVARBPROC) - get_extension_func("glWeightfvARB"); - _glWeightdv = (PFNGLWEIGHTDVARBPROC) - get_extension_func("glWeightdvARB"); - - if (_glWeightPointer == NULL || _glVertexBlend == NULL || - GLfv(_glWeight) == NULL) { - GLCAT.warning() - << "Vertex blending advertised as supported by OpenGL runtime, but could not get pointers to extension functions.\n"; - _supports_vertex_blend = false; - } - } -#endif - -#ifndef OPENGLES_2 - if (_supports_vertex_blend) { -#ifndef OPENGLES - glEnable(GL_WEIGHT_SUM_UNITY_ARB); -#endif - - GLint max_vertex_units = 0; - glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &max_vertex_units); - _max_vertex_transforms = max_vertex_units; - if (GLCAT.is_debug()) { - GLCAT.debug() - << "max vertex transforms = " << _max_vertex_transforms << "\n"; - } - } -#endif - - _supports_matrix_palette = false; -#ifndef OPENGLES - if (has_extension("GL_ARB_matrix_palette")) { - _supports_matrix_palette = true; - _glCurrentPaletteMatrix = (PFNGLCURRENTPALETTEMATRIXARBPROC) - get_extension_func("glCurrentPaletteMatrixARB"); - _glMatrixIndexPointer = (PFNGLMATRIXINDEXPOINTERARBPROC) - get_extension_func("glMatrixIndexPointerARB"); - _glMatrixIndexuiv = (PFNGLMATRIXINDEXUIVARBPROC) - get_extension_func("glMatrixIndexuivARB"); - - if (_glCurrentPaletteMatrix == NULL || - _glMatrixIndexPointer == NULL || - _glMatrixIndexuiv == NULL) { - GLCAT.warning() - << "Matrix palette advertised as supported by OpenGL runtime, but could not get pointers to extension functions.\n"; - _supports_matrix_palette = false; - } - } -#elif defined(OPENGLES_1) - if (has_extension("GL_OES_matrix_palette")) { - _supports_matrix_palette = true; - _glCurrentPaletteMatrix = (PFNGLCURRENTPALETTEMATRIXOESPROC) - get_extension_func("glCurrentPaletteMatrixOES"); - _glMatrixIndexPointer = (PFNGLMATRIXINDEXPOINTEROESPROC) - get_extension_func("glMatrixIndexPointerOES"); - - if (_glCurrentPaletteMatrix == NULL || - _glMatrixIndexPointer == NULL) { - GLCAT.warning() - << "Matrix palette advertised as supported by OpenGL runtime, but could not get pointers to extension functions.\n"; - _supports_matrix_palette = false; - } - } -#endif - - /* - The matrix_palette support in this module is completely untested - (because I don't happen to have a card handy whose driver supports - this extension), so I have this ConfigVariable set to - unconditionally set this flag off for now, to protect the unwary. - When we have shown that the code works, we should remove this bit. - In the meantime, you must put both "matrix-palette 1" and - "gl-matrix-palette 1" in your Config.prc to exercise the new - code. */ - if (!gl_matrix_palette) { - if (_supports_matrix_palette) { - if (GLCAT.is_debug()) { - GLCAT.debug() << "Forcing off matrix palette support.\n"; - } - } - _supports_matrix_palette = false; - } - - if (_supports_matrix_palette) { - GLint max_palette_matrices = 0; -#ifdef OPENGLES_1 - glGetIntegerv(GL_MAX_PALETTE_MATRICES_OES, &max_palette_matrices); -#endif -#ifndef OPENGLES - glGetIntegerv(GL_MAX_PALETTE_MATRICES_ARB, &max_palette_matrices); -#endif - _max_vertex_transform_indices = max_palette_matrices; - if (GLCAT.is_debug()) { - GLCAT.debug() - << "max vertex transform indices = " << _max_vertex_transform_indices << "\n"; - } - } - #ifndef OPENGLES _glDrawRangeElements = null_glDrawRangeElements; @@ -2391,8 +2282,6 @@ reset() { _point_size = 1.0f; _point_perspective = false; - _vertex_blending_enabled = false; - report_my_gl_errors(); #ifndef OPENGLES_2 @@ -3286,96 +3175,6 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, } } -#ifndef OPENGLES - const GeomVertexAnimationSpec &animation = - _data_reader->get_format()->get_animation(); - bool hardware_animation = (animation.get_animation_type() == Geom::AT_hardware); - if (hardware_animation && _current_shader_context == NULL) { - // Set up the transform matrices for vertex blending. - nassertr(_supports_vertex_blend, false); - glEnable(GL_VERTEX_BLEND_ARB); - _glVertexBlend(animation.get_num_transforms()); - - const TransformTable *table = _data_reader->get_transform_table(); - if (table != (TransformTable *)NULL) { - if (animation.get_indexed_transforms()) { - nassertr(_supports_matrix_palette, false); - // We are loading the indexed matrix palette. The ARB decided - // to change this interface from that for the list of - // nonindexed matrices, to make it easier to load an arbitrary - // number of matrices. - glEnable(GL_MATRIX_PALETTE_ARB); - - glMatrixMode(GL_MATRIX_PALETTE_ARB); - - for (int i = 0; i < table->get_num_transforms(); ++i) { - LMatrix4 mat; - table->get_transform(i)->mult_matrix(mat, _internal_transform->get_mat()); - _glCurrentPaletteMatrix(i); - GLPf(LoadMatrix)(mat.get_data()); - } - - // Presumably loading the matrix palette does not step on the - // GL_MODELVIEW matrix? - - } else { - // We are loading the list of nonindexed matrices. This is a - // little clumsier. - - if (_supports_matrix_palette) { - glDisable(GL_MATRIX_PALETTE_ARB); - } - - // GL_MODELVIEW0 and 1 are different than the rest. - int i = 0; - if (i < table->get_num_transforms()) { - LMatrix4 mat; - table->get_transform(i)->mult_matrix(mat, _internal_transform->get_mat()); - glMatrixMode(GL_MODELVIEW0_ARB); - GLPf(LoadMatrix)(mat.get_data()); - ++i; - } - if (i < table->get_num_transforms()) { - LMatrix4 mat; - table->get_transform(i)->mult_matrix(mat, _internal_transform->get_mat()); - glMatrixMode(GL_MODELVIEW1_ARB); - GLPf(LoadMatrix)(mat.get_data()); - ++i; - } - while (i < table->get_num_transforms()) { - LMatrix4 mat; - table->get_transform(i)->mult_matrix(mat, _internal_transform->get_mat()); - glMatrixMode(GL_MODELVIEW2_ARB + i - 2); - GLPf(LoadMatrix)(mat.get_data()); - ++i; - } - - // Setting the GL_MODELVIEW0 matrix steps on the world matrix, - // so we have to set a flag to reload the world matrix later. - _transform_stale = true; - } - } - _vertex_blending_enabled = true; - - } else { - // We're not using vertex blending. - if (_vertex_blending_enabled) { - glDisable(GL_VERTEX_BLEND_ARB); - if (_supports_matrix_palette) { - glDisable(GL_MATRIX_PALETTE_ARB); - } - _vertex_blending_enabled = false; - } - - if (_transform_stale) { - glMatrixMode(GL_MODELVIEW); - GLPf(LoadMatrix)(_internal_transform->get_mat().get_data()); - } - } -#else - const bool hardware_animation = false; -#endif - #ifndef OPENGLES_2 if (_data_reader->is_vertex_transformed()) { // If the vertex data claims to be already transformed into clip @@ -3393,7 +3192,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, #ifndef OPENGLES // Display lists not supported by OpenGL ES. if (geom_reader->get_usage_hint() == Geom::UH_static && _data_reader->get_usage_hint() == Geom::UH_static && - display_lists && (!hardware_animation || display_list_animation)) { + display_lists) { // If the geom claims to be totally static, try to build it into // a display list. @@ -3528,9 +3327,6 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, //////////////////////////////////////////////////////////////////// bool CLP(GraphicsStateGuardian):: update_standard_vertex_arrays(bool force) { - const GeomVertexAnimationSpec &animation = - _data_reader->get_format()->get_animation(); - bool hardware_animation = (animation.get_animation_type() == Geom::AT_hardware); #ifdef SUPPORT_IMMEDIATE_MODE if (_use_sender) { // We must use immediate mode to render primitives. @@ -3588,20 +3384,6 @@ update_standard_vertex_arrays(bool force) { } _last_max_stage_index = max_stage_index; - if (_supports_vertex_blend) { - if (hardware_animation) { - // Issue the weights and/or transform indices for vertex blending. - _sender.add_vector_column(_data_reader, InternalName::get_transform_weight(), - GLfv(_glWeight)); - - if (animation.get_indexed_transforms()) { - // Issue the matrix palette indices. - _sender.add_vector_uint_column(_data_reader, InternalName::get_transform_index(), - _glMatrixIndexuiv); - } - } - } - // We must add vertex last, because glVertex3f() is the key // function call that actually issues the vertex. _sender.add_column(_data_reader, InternalName::get_vertex(), @@ -3703,48 +3485,6 @@ update_standard_vertex_arrays(bool force) { } _last_max_stage_index = max_stage_index; -#ifndef OPENGLES - if (_supports_vertex_blend) { - if (hardware_animation) { - // Issue the weights and/or transform indices for vertex blending. - if (_data_reader->get_array_info(InternalName::get_transform_weight(), - array_reader, num_values, numeric_type, - start, stride)) { - if (!setup_array_data(client_pointer, array_reader, force)) { - return false; - } - _glWeightPointer(num_values, get_numeric_type(numeric_type), - stride, client_pointer + start); - glEnableClientState(GL_WEIGHT_ARRAY_ARB); - } else { - glDisableClientState(GL_WEIGHT_ARRAY_ARB); - } - - if (animation.get_indexed_transforms()) { - // Issue the matrix palette indices. - if (_data_reader->get_array_info(InternalName::get_transform_index(), - array_reader, num_values, numeric_type, - start, stride)) { - if (!setup_array_data(client_pointer, array_reader, force)) { - return false; - } - _glMatrixIndexPointer(num_values, get_numeric_type(numeric_type), - stride, client_pointer + start); - glEnableClientState(GL_MATRIX_INDEX_ARRAY_ARB); - } else { - glDisableClientState(GL_MATRIX_INDEX_ARRAY_ARB); - } - } - - } else { - glDisableClientState(GL_WEIGHT_ARRAY_ARB); - if (_supports_matrix_palette) { - glDisableClientState(GL_MATRIX_INDEX_ARRAY_ARB); - } - } - } -#endif - // There's no requirement that we add vertices last, but we do // anyway. if (_data_reader->get_vertex_info(array_reader, num_values, numeric_type, @@ -3819,15 +3559,6 @@ disable_standard_vertex_arrays() { } _last_max_stage_index = 0; -#ifndef OPENGLES - if (_supports_vertex_blend) { - glDisableClientState(GL_WEIGHT_ARRAY_ARB); - if (_supports_matrix_palette) { - glDisableClientState(GL_MATRIX_INDEX_ARRAY_ARB); - } - } -#endif - glDisableClientState(GL_VERTEX_ARRAY); report_my_gl_errors(); } @@ -4457,15 +4188,6 @@ end_draw_primitives() { _primitive_batches_display_list_pcollector.add_level(1); } _geom_display_list = 0; - - // Clean up the vertex blending state. - if (_vertex_blending_enabled) { - glDisable(GL_VERTEX_BLEND_ARB); - if (_supports_matrix_palette) { - glDisable(GL_MATRIX_PALETTE_ARB); - } - _vertex_blending_enabled = false; - } #endif #ifndef OPENGLES_2 diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 08753fd7fb..ff13fcd202 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -131,16 +131,9 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex); -typedef void (APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); @@ -586,7 +579,6 @@ protected: RenderModeAttrib::Mode _render_mode; PN_stdfloat _point_size; bool _point_perspective; - bool _vertex_blending_enabled; bool _scissor_enabled; bool _scissor_attrib_active; epvector _scissor_array; @@ -667,23 +659,6 @@ public: PFNGLSECONDARYCOLORPOINTERPROC _glSecondaryColorPointer; #endif - bool _supports_vertex_blend; - PFNGLWEIGHTPOINTERARBPROC _glWeightPointer; - PFNGLVERTEXBLENDARBPROC _glVertexBlend; - PFNGLWEIGHTFVARBPROC _glWeightfv; - PFNGLWEIGHTDVARBPROC _glWeightdv; - - bool _supports_matrix_palette; -#ifdef OPENGLES_1 - PFNGLCURRENTPALETTEMATRIXOESPROC _glCurrentPaletteMatrix; - PFNGLMATRIXINDEXPOINTEROESPROC _glMatrixIndexPointer; -#endif -#ifndef OPENGLES - PFNGLCURRENTPALETTEMATRIXARBPROC _glCurrentPaletteMatrix; - PFNGLMATRIXINDEXPOINTERARBPROC _glMatrixIndexPointer; - PFNGLMATRIXINDEXUIVARBPROC _glMatrixIndexuiv; -#endif - #ifndef OPENGLES PFNGLDRAWRANGEELEMENTSPROC _glDrawRangeElements; #endif diff --git a/panda/src/glstuff/glmisc_src.cxx b/panda/src/glstuff/glmisc_src.cxx index 1511c68d1d..82604e1051 100644 --- a/panda/src/glstuff/glmisc_src.cxx +++ b/panda/src/glstuff/glmisc_src.cxx @@ -183,10 +183,6 @@ ConfigVariableBool gl_force_depth_stencil ("gl-force-depth-stencil", false, PRC_DESC("Temporary hack variable 7x00 vs 8x00 nVidia bug. See glGraphicsStateGuardian_src.cxx.")); -ConfigVariableBool gl_matrix_palette - ("gl-matrix-palette", false, - PRC_DESC("Temporary hack variable protecting untested code. See glGraphicsStateGuardian_src.cxx.")); - ConfigVariableBool gl_check_errors ("gl-check-errors", false, PRC_DESC("Regularly call glGetError() to check for OpenGL errors. " diff --git a/panda/src/glstuff/glmisc_src.h b/panda/src/glstuff/glmisc_src.h index 65e489a3ea..33408c6ca8 100644 --- a/panda/src/glstuff/glmisc_src.h +++ b/panda/src/glstuff/glmisc_src.h @@ -64,7 +64,6 @@ extern ConfigVariableBool gl_debug_object_labels; extern ConfigVariableBool gl_debug_buffers; extern ConfigVariableBool gl_finish; extern ConfigVariableBool gl_force_depth_stencil; -extern ConfigVariableBool gl_matrix_palette; extern ConfigVariableBool gl_check_errors; extern ConfigVariableBool gl_force_flush; extern ConfigVariableBool gl_separate_specular_color; From 555844f82a886551ccb3b6b429aadcf6b09ae65f Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 9 Jul 2015 16:43:45 +0200 Subject: [PATCH 051/203] Allow compiling out the fixed-function pipeline and request core context --- makepanda/makepanda.py | 1 + panda/src/gles2gsg/gles2gsg.h | 3 + panda/src/glesgsg/glesgsg.h | 5 + panda/src/glstuff/glCgShaderContext_src.cxx | 44 +- panda/src/glstuff/glGeomContext_src.cxx | 6 +- panda/src/glstuff/glGraphicsBuffer_src.cxx | 2 +- .../src/glstuff/glGraphicsStateGuardian_src.I | 22 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 689 +++++++++++------- .../src/glstuff/glGraphicsStateGuardian_src.h | 54 +- panda/src/glstuff/glShaderContext_src.cxx | 5 +- panda/src/glstuff/glmisc_src.cxx | 4 + panda/src/glstuff/glmisc_src.h | 1 + .../glxdisplay/glxGraphicsStateGuardian.cxx | 8 + 13 files changed, 546 insertions(+), 298 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 9ac5c7dc5a..b7ac3cbc4a 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2052,6 +2052,7 @@ DTOOL_CONFIG=[ ("DO_DCAST", 'UNDEF', 'UNDEF'), ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'), ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'), + ("SUPPORT_FIXED_FUNCTION", '1', '1'), ("TRACK_IN_INTERPRETER", 'UNDEF', 'UNDEF'), ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'), ("DO_PIPELINING", '1', '1'), diff --git a/panda/src/gles2gsg/gles2gsg.h b/panda/src/gles2gsg/gles2gsg.h index 71ac91e594..2582a2d5ed 100644 --- a/panda/src/gles2gsg/gles2gsg.h +++ b/panda/src/gles2gsg/gles2gsg.h @@ -49,6 +49,9 @@ #define OPENGLES_2 #endif +// OpenGL ES 2 has no fixed-function pipeline. +#undef SUPPORT_FIXED_FUNCTION + #ifdef IS_OSX #include // #include diff --git a/panda/src/glesgsg/glesgsg.h b/panda/src/glesgsg/glesgsg.h index 3282cd4536..6f13f9223c 100644 --- a/panda/src/glesgsg/glesgsg.h +++ b/panda/src/glesgsg/glesgsg.h @@ -49,6 +49,11 @@ #error OPENGLES_2 should not be defined! #endif +// OpenGL ES 1 has only the fixed-function pipeline. +#ifndef SUPPORT_FIXED_FUNCTION +#define SUPPORT_FIXED_FUNCTION +#endif + // This prevents glext.h from getting included by gl.h // That way, we can provide our own, better version. #define __glext_h_ diff --git a/panda/src/glstuff/glCgShaderContext_src.cxx b/panda/src/glstuff/glCgShaderContext_src.cxx index 0ff4bacd6c..d8db598182 100644 --- a/panda/src/glstuff/glCgShaderContext_src.cxx +++ b/panda/src/glstuff/glCgShaderContext_src.cxx @@ -685,6 +685,7 @@ disable_shader_vertex_arrays() { _glgsg->_glVertexAttribDivisor(p, 0); } } else { +#ifdef SUPPORT_FIXED_FUNCTION switch (p) { case CA_unknown: break; @@ -705,6 +706,7 @@ disable_shader_vertex_arrays() { glDisableClientState(GL_TEXTURE_COORD_ARRAY); break; } +#endif // SUPPORT_FIXED_FUNCTION } } @@ -801,6 +803,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { } else { // It's a conventional vertex attribute. Ugh. +#ifdef SUPPORT_FIXED_FUNCTION switch (p) { case CA_unknown: break; @@ -836,9 +839,11 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { glEnableClientState(GL_TEXTURE_COORD_ARRAY); break; } +#endif // SUPPORT_FIXED_FUNCTION } } else { // There is no vertex column with this name; disable the attribute array. +#ifdef SUPPORT_FIXED_FUNCTION if (p == 0) { //NOTE: if we disable attribute 0 in compatibility profile, the object // will disappear. In GLSL we fix this by forcing the vertex column @@ -852,7 +857,9 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { _glgsg->_glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0); } - } else if (p > 0) { + } else +#endif // SUPPORT_FIXED_FUNCTION + if (p >= 0) { _glgsg->_glDisableVertexAttribArray(p); if (p == _color_attrib_index) { @@ -863,6 +870,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { #endif } } else { +#ifdef SUPPORT_FIXED_FUNCTION switch (p) { case CA_unknown: break; @@ -888,6 +896,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { glDisableClientState(GL_TEXTURE_COORD_ARRAY); break; } +#endif // SUPPORT_FIXED_FUNCTION } } } @@ -920,35 +929,27 @@ disable_shader_texture_bindings() { return; } -#ifndef OPENGLES_2 - for (int i=0; i<(int)_shader->_tex_spec.size(); i++) { + for (int i = 0; i < (int)_shader->_tex_spec.size(); ++i) { CGparameter p = _cg_parameter_map[_shader->_tex_spec[i]._id._seqno]; if (p == 0) continue; int texunit = cgGetParameterResourceIndex(p); _glgsg->_glActiveTexture(GL_TEXTURE0 + texunit); -#ifndef OPENGLES glBindTexture(GL_TEXTURE_1D, 0); -#endif // OPENGLES glBindTexture(GL_TEXTURE_2D, 0); -#ifndef OPENGLES_1 if (_glgsg->_supports_3d_texture) { glBindTexture(GL_TEXTURE_3D, 0); } -#endif // OPENGLES_1 -#ifndef OPENGLES if (_glgsg->_supports_2d_texture_array) { glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, 0); } -#endif if (_glgsg->_supports_cube_map) { glBindTexture(GL_TEXTURE_CUBE_MAP, 0); } // This is probably faster - but maybe not as safe? //cgGLDisableTextureParameter(p); } -#endif // OPENGLES_2 cg_report_errors(); _glgsg->report_my_gl_errors(); @@ -981,9 +982,10 @@ update_shader_texture_bindings(ShaderContext *prev) { nassertv(texattrib != (TextureAttrib *)NULL); for (int i = 0; i < (int)_shader->_tex_spec.size(); ++i) { - InternalName *id = _shader->_tex_spec[i]._name; + Shader::ShaderTexSpec &spec = _shader->_tex_spec[i]; + const InternalName *id = spec._name; - CGparameter p = _cg_parameter_map[_shader->_tex_spec[i]._id._seqno]; + CGparameter p = _cg_parameter_map[spec._id._seqno]; if (p == 0) { continue; } @@ -997,23 +999,27 @@ update_shader_texture_bindings(ShaderContext *prev) { tex = _glgsg->_target_shader->get_shader_input_texture(id, &sampler); } else { - if (_shader->_tex_spec[i]._stage >= texattrib->get_num_on_stages()) { + if (spec._stage >= texattrib->get_num_on_stages()) { + // Apply a white texture in order to make it easier to use a shader + // that takes a texture on a model that doesn't have a texture applied. + _glgsg->_glActiveTexture(GL_TEXTURE0 + texunit); + _glgsg->apply_white_texture(); continue; } - TextureStage *stage = texattrib->get_on_stage(_shader->_tex_spec[i]._stage); + TextureStage *stage = texattrib->get_on_stage(spec._stage); tex = texattrib->get_on_texture(stage); sampler = texattrib->get_on_sampler(stage); view += stage->get_tex_view_offset(); } - if (_shader->_tex_spec[i]._suffix != 0) { + if (spec._suffix != 0) { // The suffix feature is inefficient. It is a temporary hack. if (tex == 0) { continue; } - tex = tex->load_related(_shader->_tex_spec[i]._suffix); + tex = tex->load_related(spec._suffix); } - if ((tex == 0) || (tex->get_texture_type() != _shader->_tex_spec[i]._desired_type)) { + if ((tex == 0) || (tex->get_texture_type() != spec._desired_type)) { continue; } @@ -1035,11 +1041,11 @@ update_shader_texture_bindings(ShaderContext *prev) { } _glgsg->apply_texture(tc); - _glgsg->apply_sampler(i, sampler, tc); + _glgsg->apply_sampler(texunit, sampler, tc); } cg_report_errors(); _glgsg->report_my_gl_errors(); } -#endif // OPENGLES_1 +#endif // !OPENGLES diff --git a/panda/src/glstuff/glGeomContext_src.cxx b/panda/src/glstuff/glGeomContext_src.cxx index 272d9727bf..d9e6578bf8 100644 --- a/panda/src/glstuff/glGeomContext_src.cxx +++ b/panda/src/glstuff/glGeomContext_src.cxx @@ -37,7 +37,7 @@ CLP(GeomContext):: bool CLP(GeomContext):: get_display_list(GLuint &index, const CLP(GeomMunger) *munger, UpdateSeq modified) { -#ifdef OPENGLES +#if defined(OPENGLES) || !defined(SUPPORT_FIXED_FUNCTION) // Display lists not supported by OpenGL ES. nassertr(false, false); return false; @@ -68,7 +68,7 @@ get_display_list(GLuint &index, const CLP(GeomMunger) *munger, //////////////////////////////////////////////////////////////////// void CLP(GeomContext):: release_display_lists() { -#ifdef OPENGLES +#if defined(OPENGLES) || !defined(SUPPORT_FIXED_FUNCTION) // Display lists not supported by OpenGL ES. nassertv(_display_lists.empty()); @@ -103,6 +103,7 @@ release_display_lists() { //////////////////////////////////////////////////////////////////// void CLP(GeomContext):: remove_munger(CLP(GeomMunger) *munger) { +#if !defined(OPENGLES) && defined(SUPPORT_FIXED_FUNCTION) DisplayLists::iterator dli = _display_lists.find(munger); nassertv(dli != _display_lists.end()); @@ -116,4 +117,5 @@ remove_munger(CLP(GeomMunger) *munger) { // running in any thread. Instead, enqueue the display list index // and let it get deleted at the end of the current or next frame. glgsg->record_deleted_display_list(index); +#endif } diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 05d8c4b78f..cb1451ebe7 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1054,7 +1054,7 @@ attach_tex(int layer, int view, Texture *attach, GLenum attachpoint) { // to a framebuffer attachment. glgsg->apply_texture(gtc); -#ifndef OPENGLES +#if !defined(OPENGLES) && defined(SUPPORT_FIXED_FUNCTION) GLclampf priority = 1.0f; glPrioritizeTextures(1, >c->_index, &priority); #endif diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.I b/panda/src/glstuff/glGraphicsStateGuardian_src.I index d973269700..5b5a7a81e9 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.I +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.I @@ -354,7 +354,7 @@ enable_line_smooth(bool val) { //////////////////////////////////////////////////////////////////// INLINE void CLP(GraphicsStateGuardian):: enable_point_smooth(bool val) { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION if (_point_smooth_enabled != val) { _state_mask.clear_bit(TransparencyAttrib::get_class_slot()); _point_smooth_enabled = val; @@ -532,7 +532,7 @@ enable_depth_test(bool val) { } } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::enable_fog // Access: @@ -559,7 +559,7 @@ enable_fog(bool val) { } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::enable_alpha_test // Access: @@ -644,7 +644,7 @@ clear_color_write_mask() { } } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::call_glFogfv // Access: Public @@ -662,7 +662,7 @@ call_glFogfv(GLenum pname, const LColor &color) { } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::call_glMaterialfv // Access: Public @@ -680,7 +680,7 @@ call_glMaterialfv(GLenum face, GLenum pname, const LColor &color) { } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::call_glLightfv // Access: Public @@ -698,7 +698,7 @@ call_glLightfv(GLenum light, GLenum pname, const LVecBase4 &value) { } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::call_glLightfv // Access: Public @@ -716,7 +716,7 @@ call_glLightfv(GLenum light, GLenum pname, const LVecBase3 &value) { } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::call_glLightModelfv // Access: Public @@ -734,7 +734,7 @@ call_glLightModelfv(GLenum pname, const LVecBase4 &value) { } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::call_glTexEnvfv // Access: Public @@ -768,7 +768,7 @@ call_glTexParameterfv(GLenum target, GLenum pname, const LVecBase4 &value) { #endif // STDFLOAT_DOUBLE } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_light_id // Access: Public @@ -780,7 +780,7 @@ get_light_id(int index) const { } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_clip_plane_id // Access: Public diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 527d8219ef..e594579d4c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -83,7 +83,7 @@ PStatCollector CLP(GraphicsStateGuardian)::_texture_update_pcollector("Draw:Upda PStatCollector CLP(GraphicsStateGuardian)::_fbo_bind_pcollector("Draw:Bind FBO"); PStatCollector CLP(GraphicsStateGuardian)::_check_error_pcollector("Draw:Check errors"); -#ifdef OPENGLES_2 +#ifndef OPENGLES_1 PT(Shader) CLP(GraphicsStateGuardian)::_default_shader = NULL; #endif @@ -126,22 +126,54 @@ static void APIENTRY null_glBlendColor(GLclampf, GLclampf, GLclampf, GLclampf) { } -#ifdef OPENGLES_2 -// We have a default shader that will be applied when there -// isn't any shader applied (e.g. if it failed to compile). -// We need this because OpenGL ES 2.x does not have -// a fixed-function pipeline. -// This default shader just outputs a red color, telling -// the user that something went wrong. +#ifndef OPENGLES_1 +// We have a default shader that will be applied when there isn't any +// shader applied (e.g. if it failed to compile). We need this because +// OpenGL ES 2.x and OpenGL 3.2+ core don't have a fixed-function pipeline. +// This default shader just applies a single texture, which is good enough +// for drawing GUIs and such. static const string default_vshader = - "uniform mediump mat4 p3d_ModelViewProjectionMatrix;\n" - "attribute highp vec4 p3d_Vertex;\n" +#ifndef OPENGLES + "#version 130\n" + "in vec4 p3d_Vertex;\n" + "in vec4 p3d_Color;\n" + "in vec2 p3d_MultiTexCoord0;\n" + "out vec2 texcoord;\n" + "out vec4 color;\n" +#else + "precision mediump float;\n" + "attribute vec4 p3d_Vertex;\n" + "attribute vec4 p3d_Color;\n" + "attribute vec2 p3d_MultiTexCoord0;\n" + "varying vec2 texcoord;\n" + "varying vec4 color;\n" +#endif + "uniform mat4 p3d_ModelViewProjectionMatrix;\n" + "uniform vec4 p3d_ColorScale;\n" "void main(void) {\n" " gl_Position = p3d_ModelViewProjectionMatrix * p3d_Vertex;\n" + " texcoord = p3d_MultiTexCoord0;\n" + " color = p3d_Color * p3d_ColorScale;\n" "}\n"; + static const string default_fshader = +#ifndef OPENGLES + "#version 130\n" + "in vec2 texcoord;\n" + "in vec4 color;\n" +#else + "precision mediump float;\n" + "varying vec2 texcoord;\n" + "varying vec4 color;\n" +#endif + "uniform sampler2D p3d_Texture0;\n" "void main(void) {\n" - " gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n" +#ifndef OPENGLES + " gl_FragColor = texture(p3d_Texture0, texcoord);\n" +#else + " gl_FragColor = texture2D(p3d_Texture0, texcoord).bgra;\n" +#endif + " gl_FragColor *= color;\n" "}\n"; #endif @@ -308,6 +340,8 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) : _renderbuffer_residency(get_prepared_objects()->get_name(), "renderbuffer") { _error_count = 0; + _gl_shadlang_ver_major = 0; + _gl_shadlang_ver_minor = 0; // Hack. Turn on the flag that we turned off at a higher level, // since we know this works properly in OpenGL, and we want the @@ -325,6 +359,8 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) : _scissor_enabled = false; _scissor_attrib_active = false; + _white_texture = 0; + #ifdef HAVE_CG _cg_context = 0; #endif @@ -447,8 +483,55 @@ reset() { // Save the extensions tokens. _extensions.clear(); - save_extensions((const char *)glGetString(GL_EXTENSIONS)); + + // In OpenGL 3.0 and later, glGetString(GL_EXTENSIONS) is deprecated. +#ifndef OPENGLES + if (is_at_least_gl_version(3, 0)) { + PFNGLGETSTRINGIPROC _glGetStringi = + (PFNGLGETSTRINGIPROC)get_extension_func("glGetStringi"); + + if (_glGetStringi != NULL) { + GLint n = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &n); + for (GLint i = 0; i < n; ++i) { + const char *extension = (const char *)_glGetStringi(GL_EXTENSIONS, i); + _extensions.insert(string(extension)); + } + } else { + GLCAT.error() << "glGetStringi is not available!\n"; + save_extensions((const char *)glGetString(GL_EXTENSIONS)); + } + } else +#endif + { + save_extensions((const char *)glGetString(GL_EXTENSIONS)); + } + get_extra_extensions(); + + // This needs access to the extensions, so put this after save_extensions. + query_glsl_version(); + +#ifndef OPENGLES + bool core_profile; + if (_gl_version_major < 3 || has_extension("GL_ARB_compatibility")) { + core_profile = false; + } else { + core_profile = true; + } + + if (core_profile) { + GLCAT.debug() << "Using core profile\n"; + } else { + GLCAT.debug() << "Using compatibility profile\n"; + } +#elif defined(OPENGLES_1) + static const bool core_profile = false; +#else + static const bool core_profile = true; +#endif + + // Print out a list of all extensions. report_extensions(); // Initialize OpenGL debugging output first, if enabled and supported. @@ -599,7 +682,7 @@ reset() { } #endif -#ifndef OPENGLES +#if !defined(OPENGLES) && defined(SUPPORT_FIXED_FUNCTION) if (is_at_least_gl_version(1, 4)) { _glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) get_extension_func("glSecondaryColorPointer"); @@ -905,11 +988,9 @@ reset() { has_extension("GL_EXT_bgra") || is_at_least_gl_version(1, 2); #endif -#ifdef OPENGLES_2 - _supports_rescale_normal = true; -#else +#ifdef SUPPORT_FIXED_FUNCTION _supports_rescale_normal = - gl_support_rescale_normal && + !core_profile && gl_support_rescale_normal && (has_extension("GL_EXT_rescale_normal") || is_at_least_gl_version(1, 2)); #endif @@ -945,13 +1026,19 @@ reset() { #ifdef OPENGLES_2 _glActiveTexture = glActiveTexture; #else + bool supports_multitexture = false; if (is_at_least_gl_version(1, 3) || is_at_least_gles_version(1, 1)) { - _supports_multitexture = true; + supports_multitexture = true; _glActiveTexture = (PFNGLACTIVETEXTUREPROC) get_extension_func("glActiveTexture"); + +#ifdef SUPPORT_FIXED_FUNCTION _glClientActiveTexture = (PFNGLACTIVETEXTUREPROC) get_extension_func("glClientActiveTexture"); +#endif + +#ifdef SUPPORT_IMMEDIATE_MODE _glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC) get_extension_func("glMultiTexCoord1f"); _glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC) @@ -968,14 +1055,20 @@ reset() { get_extension_func("glMultiTexCoord3d"); _glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC) get_extension_func("glMultiTexCoord4d"); +#endif } else if (has_extension("GL_ARB_multitexture")) { - _supports_multitexture = true; + supports_multitexture = true; _glActiveTexture = (PFNGLACTIVETEXTUREPROC) get_extension_func("glActiveTextureARB"); + +#ifdef SUPPORT_FIXED_FUNCTION _glClientActiveTexture = (PFNGLACTIVETEXTUREPROC) get_extension_func("glClientActiveTextureARB"); +#endif + +#ifdef SUPPORT_IMMEDIATE_MODE _glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC) get_extension_func("glMultiTexCoord1fARB"); _glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC) @@ -992,12 +1085,16 @@ reset() { get_extension_func("glMultiTexCoord3dARB"); _glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC) get_extension_func("glMultiTexCoord4dARB"); +#endif } else { - _supports_multitexture = false; + supports_multitexture = false; } - if (_supports_multitexture) { - if (_glActiveTexture == NULL || _glClientActiveTexture == NULL + if (supports_multitexture) { + if (_glActiveTexture == NULL +#ifdef SUPPORT_FIXED_FUNCTION + || _glClientActiveTexture == NULL +#endif #ifdef SUPPORT_IMMEDIATE_MODE || GLf(_glMultiTexCoord1) == NULL || GLf(_glMultiTexCoord2) == NULL || GLf(_glMultiTexCoord3) == NULL || GLf(_glMultiTexCoord4) == NULL @@ -1005,16 +1102,21 @@ reset() { ) { GLCAT.warning() << "Multitexture advertised as supported by OpenGL runtime, but could not get pointers to extension functions.\n"; - _supports_multitexture = false; + supports_multitexture = false; } } - if (!_supports_multitexture) { + if (!supports_multitexture) { // Replace with dummy no-op functions. _glActiveTexture = null_glActiveTexture; + } + +#ifdef SUPPORT_FIXED_FUNCTION + if (!supports_multitexture || core_profile) { _glClientActiveTexture = null_glActiveTexture; } #endif +#endif // OPENGLES_2 #ifdef OPENGLES if (has_extension("GL_ANGLE_depth_texture")) { @@ -1058,17 +1160,19 @@ reset() { _supports_shadow_filter = false; }*/ -#ifdef OPENGLES_2 +#ifndef SUPPORT_FIXED_FUNCTION _supports_texture_combine = false; _supports_texture_saved_result = false; _supports_texture_dot3 = false; #else - _supports_texture_combine = - has_extension("GL_ARB_texture_env_combine") || is_at_least_gl_version(1, 3) || is_at_least_gles_version(1, 1); - _supports_texture_saved_result = - has_extension("GL_ARB_texture_env_crossbar") || has_extension("GL_OES_texture_env_crossbar") || is_at_least_gl_version(1, 4); - _supports_texture_dot3 = - has_extension("GL_ARB_texture_env_dot3") || is_at_least_gl_version(1, 3) || is_at_least_gles_version(1, 1); + if (!core_profile) { + _supports_texture_combine = + has_extension("GL_ARB_texture_env_combine") || is_at_least_gl_version(1, 3) || is_at_least_gles_version(1, 1); + _supports_texture_saved_result = + has_extension("GL_ARB_texture_env_crossbar") || has_extension("GL_OES_texture_env_crossbar") || is_at_least_gl_version(1, 4); + _supports_texture_dot3 = + has_extension("GL_ARB_texture_env_dot3") || is_at_least_gl_version(1, 3) || is_at_least_gles_version(1, 1); + } #endif #ifdef OPENGLES_2 @@ -1123,6 +1227,38 @@ reset() { } #endif + _supports_vao = false; + + if (is_at_least_gl_version(3, 0) || has_extension("GL_ARB_vertex_array_object")) { + _supports_vao = true; + + _glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) + get_extension_func("glBindVertexArray"); + _glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) + get_extension_func("glDeleteVertexArrays"); + _glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) + get_extension_func("glGenVertexArrays"); + + } else if (has_extension("GL_OES_vertex_array_object")) { + _supports_vao = true; + + _glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) + get_extension_func("glBindVertexArrayOES"); + _glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) + get_extension_func("glDeleteVertexArraysOES"); + _glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) + get_extension_func("glGenVertexArraysOES"); + } + + if (_supports_vao) { + if (_glBindVertexArray == NULL || _glDeleteVertexArrays == NULL || + _glGenVertexArrays == NULL) { + GLCAT.warning() + << "Vertex array objects advertised as supported by OpenGL runtime, but could not get pointers to extension functions.\n"; + _supports_vao = false; + } + } + #if defined(HAVE_CG) && !defined(OPENGLES) if (cgGLIsProfileSupported(CG_PROFILE_ARBFP1) && cgGLIsProfileSupported(CG_PROFILE_ARBVP1)) { @@ -1353,12 +1489,14 @@ reset() { _glVertexAttribPointer = glVertexAttribPointer; _glVertexAttribIPointer = NULL; _glVertexAttribLPointer = NULL; +#endif +#ifndef OPENGLES_1 // We need to have a default shader to apply in case // something didn't happen to have a shader applied, or // if it failed to compile. This default shader just outputs // a red color, indicating that something went wrong. - if (_default_shader == NULL) { + if (_default_shader == NULL && core_profile) { _default_shader = Shader::make(Shader::SL_GLSL, default_vshader, default_fshader); } #endif @@ -2161,11 +2299,17 @@ reset() { report_my_gl_errors(); - if (support_stencil) { + if (core_profile) { + //TODO: better detection mechanism? + _supports_stencil = true; + } +#ifdef SUPPORT_FIXED_FUNCTION + else if (support_stencil) { GLint num_stencil_bits; glGetIntegerv(GL_STENCIL_BITS, &num_stencil_bits); _supports_stencil = (num_stencil_bits != 0); } +#endif _supports_stencil_wrap = has_extension("GL_EXT_stencil_wrap") || has_extension("GL_OES_stencil_wrap"); @@ -2189,11 +2333,17 @@ reset() { glFrontFace(GL_CCW); #ifndef OPENGLES_2 glDisable(GL_LINE_SMOOTH); - glDisable(GL_POINT_SMOOTH); +#endif +#ifdef SUPPORT_FIXED_FUNCTION + if (!core_profile) { + glDisable(GL_POINT_SMOOTH); + } +#endif #ifndef OPENGLES glDisable(GL_POLYGON_SMOOTH); #endif // OPENGLES +#ifndef OPENGLES_2 if (_supports_multisample) { glDisable(GL_MULTISAMPLE); } @@ -2231,38 +2381,39 @@ reset() { _texture_binding_shader_context = (ShaderContext *)NULL; #endif -#ifdef OPENGLES_2 - _max_lights = 0; -#else // Count the max number of lights - GLint max_lights = 0; - glGetIntegerv(GL_MAX_LIGHTS, &max_lights); - _max_lights = max_lights; + _max_lights = 0; +#ifdef SUPPORT_FIXED_FUNCTION + if (!core_profile) { + GLint max_lights = 0; + glGetIntegerv(GL_MAX_LIGHTS, &max_lights); + _max_lights = max_lights; - if (GLCAT.is_debug()) { - GLCAT.debug() - << "max lights = " << _max_lights << "\n"; + if (GLCAT.is_debug()) { + GLCAT.debug() + << "max lights = " << _max_lights << "\n"; + } } #endif -#ifdef OPENGLES_2 - _max_clip_planes = 0; -#else // Count the max number of clipping planes - GLint max_clip_planes = 0; - glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes); - _max_clip_planes = max_clip_planes; + _max_clip_planes = 0; +#ifdef SUPPORT_FIXED_FUNCTION + if (!core_profile) { + GLint max_clip_planes = 0; + glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes); + _max_clip_planes = max_clip_planes; - if (GLCAT.is_debug()) { - GLCAT.debug() - << "max clip planes = " << _max_clip_planes << "\n"; + if (GLCAT.is_debug()) { + GLCAT.debug() + << "max clip planes = " << _max_clip_planes << "\n"; + } } #endif -#ifdef OPENGLES_2 - _max_texture_stages = 0; -#else - if (_supports_multitexture) { + _max_texture_stages = 1; +#ifdef SUPPORT_FIXED_FUNCTION + if (supports_multitexture && !core_profile) { GLint max_texture_stages = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_texture_stages); _max_texture_stages = max_texture_stages; @@ -2276,6 +2427,7 @@ reset() { _current_vbuffer_index = 0; _current_ibuffer_index = 0; + _current_vao_index = 0; _current_fbo = 0; _auto_antialias_mode = false; _render_mode = RenderModeAttrib::M_filled; @@ -2284,28 +2436,34 @@ reset() { report_my_gl_errors(); -#ifndef OPENGLES_2 - if (gl_cheap_textures) { - GLCAT.info() - << "Setting glHint() for fastest textures.\n"; - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); - } +#ifdef SUPPORT_FIXED_FUNCTION + if (!core_profile) { + if (gl_cheap_textures) { + GLCAT.info() + << "Setting glHint() for fastest textures.\n"; + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + } - // Use per-vertex fog if per-pixel fog requires SW renderer - glHint(GL_FOG_HINT, GL_DONT_CARE); + // Use per-vertex fog if per-pixel fog requires SW renderer + glHint(GL_FOG_HINT, GL_DONT_CARE); + } #endif - GLint num_red_bits = 0; - glGetIntegerv(GL_RED_BITS, &num_red_bits); - if (num_red_bits < 8) { - glEnable(GL_DITHER); - _dithering_enabled = true; - if (GLCAT.is_debug()) { - GLCAT.debug() - << "frame buffer depth = " << num_red_bits - << " bits/channel, enabling dithering\n"; +#ifdef SUPPORT_FIXED_FUNCTION + if (!core_profile) { + GLint num_red_bits = 0; + glGetIntegerv(GL_RED_BITS, &num_red_bits); + if (num_red_bits < 8) { + glEnable(GL_DITHER); + _dithering_enabled = true; + if (GLCAT.is_debug()) { + GLCAT.debug() + << "frame buffer depth = " << num_red_bits + << " bits/channel, enabling dithering\n"; + } } } +#endif _error_count = 0; @@ -2414,6 +2572,20 @@ reset() { << "\n"; } +#endif + + // OpenGL core profile requires a VAO to be bound. It's a bit silly, + // because we can just bind a VAO and then forget about it. +#if !defined(OPENGLES) + if (core_profile) { + if (_supports_vao) { + _glGenVertexArrays(1, &_current_vao_index); + _glBindVertexArray(_current_vao_index); + } else { + GLCAT.error() + << "Core profile enabled, but vertex array objects not supported!\n"; + } + } #endif // Now that the GSG has been initialized, make it available for @@ -2745,7 +2917,7 @@ prepare_display_region(DisplayRegionPipelineReader *dr) { //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: clear_before_callback() { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION disable_standard_vertex_arrays(); #endif unbind_buffers(); @@ -2754,7 +2926,7 @@ clear_before_callback() { // texture stage is still set to stage 0. CEGUI, in particular, // makes this assumption. _glActiveTexture(GL_TEXTURE0); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION _glClientActiveTexture(GL_TEXTURE0); #endif @@ -2824,7 +2996,7 @@ calc_projection_mat(const Lens *lens) { //////////////////////////////////////////////////////////////////// bool CLP(GraphicsStateGuardian):: prepare_lens() { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION if (GLCAT.is_spam()) { GLCAT.spam() << "glMatrixMode(GL_PROJECTION): " << _projection_mat->get_mat() << endl; @@ -2837,6 +3009,12 @@ prepare_lens() { do_point_size(); #endif +#ifndef OPENGLES_1 + if (_current_shader_context) { + _current_shader_context->issue_parameters(Shader::SSD_transform); + } +#endif + return true; } @@ -3029,6 +3207,7 @@ end_frame(Thread *current_thread) { // Now is a good time to delete any pending display lists. #ifndef OPENGLES +#ifdef SUPPORT_FIXED_FUNCTION if (display_lists) { LightMutexHolder holder(_lock); if (!_deleted_display_lists.empty()) { @@ -3045,6 +3224,7 @@ end_frame(Thread *current_thread) { _deleted_display_lists.clear(); } } +#endif // And deleted queries, too, unless we're using query timers // in which case we'll need to reuse lots of them. @@ -3131,7 +3311,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, } #endif // NDEBUG -#ifdef OPENGLES_2 +#ifndef SUPPORT_FIXED_FUNCTION // We can't draw without a shader bound in OpenGL ES 2. This shouldn't // happen anyway unless the default shader failed to compile somehow. if (_current_shader_context == NULL) { @@ -3175,7 +3355,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, } } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION if (_data_reader->is_vertex_transformed()) { // If the vertex data claims to be already transformed into clip // coordinates, wipe out the current projection and modelview @@ -3189,7 +3369,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, } #endif -#ifndef OPENGLES // Display lists not supported by OpenGL ES. +#if !defined(OPENGLES) && defined(SUPPORT_FIXED_FUNCTION) // Display lists not supported by OpenGL ES. if (geom_reader->get_usage_hint() == Geom::UH_static && _data_reader->get_usage_hint() == Geom::UH_static && display_lists) { @@ -3271,13 +3451,13 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, if (_vertex_array_shader_context != 0) { _vertex_array_shader_context->disable_shader_vertex_arrays(); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION if (!update_standard_vertex_arrays(force)) { return false; } #endif } else { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION // Shader. if (_vertex_array_shader_context == 0 || _vertex_array_shader_context->uses_standard_vertex_arrays()) { // Previous shader used standard arrays. @@ -3291,7 +3471,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, disable_standard_vertex_arrays(); } } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION if (_current_shader_context->uses_custom_vertex_arrays()) { // The current shader also uses custom vertex arrays. if (!_current_shader_context-> @@ -3312,7 +3492,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, return true; } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::update_standard_vertex_arrays // Access: Protected @@ -3499,7 +3679,7 @@ update_standard_vertex_arrays(bool force) { } return true; } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::unbind_buffers @@ -3527,12 +3707,12 @@ unbind_buffers() { _current_ibuffer_index = 0; } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION disable_standard_vertex_arrays(); #endif } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::disable_standard_vertex_arrays // Access: Protected @@ -3562,7 +3742,7 @@ disable_standard_vertex_arrays() { glDisableClientState(GL_VERTEX_ARRAY); report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::draw_triangles @@ -4176,7 +4356,7 @@ draw_points(const GeomPrimitivePipelineReader *reader, bool force) { //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: end_draw_primitives() { -#ifndef OPENGLES // Display lists not supported by OpenGL ES. +#if !defined(OPENGLES) && defined(SUPPORT_FIXED_FUNCTION) // Display lists not supported by OpenGL ES. if (_geom_display_list != 0) { // If we were building a display list, close it now. glEndList(); @@ -4190,7 +4370,7 @@ end_draw_primitives() { _geom_display_list = 0; #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION if (_transform_stale) { glMatrixMode(GL_MODELVIEW); GLPf(LoadMatrix)(_internal_transform->get_mat().get_data()); @@ -5615,7 +5795,7 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z, return true; } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::apply_fog // Access: Public, Virtual @@ -5640,7 +5820,7 @@ apply_fog(Fog *fog) { call_glFogfv(GL_FOG_COLOR, fog->get_color()); report_my_gl_errors(); } -#endif // OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_transform @@ -5653,7 +5833,7 @@ apply_fog(Fog *fog) { //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: do_issue_transform() { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION // OpenGL ES 2 does not support glLoadMatrix. const TransformState *transform = _internal_transform; @@ -5677,7 +5857,7 @@ do_issue_transform() { report_my_gl_errors(); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_shade_model // Access: Protected @@ -5700,8 +5880,9 @@ do_issue_shade_model() { break; } } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION +#ifndef OPENGLES_1 //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_shader // Access: Protected @@ -5709,24 +5890,25 @@ do_issue_shade_model() { //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: do_issue_shader(bool state_has_changed) { -#ifndef OPENGLES_1 ShaderContext *context = 0; Shader *shader = (Shader *)(_target_shader->get_shader()); -#ifdef OPENGLES_2 +#ifndef SUPPORT_FIXED_FUNCTION // If we don't have a shader, apply the default shader. if (!shader) { shader = _default_shader; + nassertv(shader != NULL); } #endif if (shader) { context = shader->prepare_now(get_prepared_objects(), this); } -#ifdef OPENGLES_2 +#ifndef SUPPORT_FIXED_FUNCTION // If it failed, try applying the default shader. if (shader != _default_shader && (context == 0 || !context->valid())) { shader = _default_shader; + nassertv(shader != NULL); context = shader->prepare_now(get_prepared_objects(), this); } #endif @@ -5757,8 +5939,8 @@ do_issue_shader(bool state_has_changed) { } report_my_gl_errors(); -#endif } +#endif // !OPENGLES_1 //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_render_mode @@ -5876,7 +6058,7 @@ do_issue_antialias() { report_my_gl_errors(); } -#ifndef OPENGLES_2 // OpenGL ES 2.0 doesn't support rescaling normals. +#ifdef SUPPORT_FIXED_FUNCTION // OpenGL ES 2.0 doesn't support rescaling normals. //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_rescale_normal // Access: Protected @@ -5921,7 +6103,7 @@ do_issue_rescale_normal() { } report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION // PandaCompareFunc - 1 + 0x200 === GL_NEVER, etc. order is sequential #define PANDA_TO_GL_COMPAREFUNC(PANDACMPFUNC) (PANDACMPFUNC-1 +0x200) @@ -5946,7 +6128,7 @@ do_issue_depth_test() { report_my_gl_errors(); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_alpha_test // Access: Protected @@ -5970,7 +6152,7 @@ do_issue_alpha_test() { } } } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_depth_write @@ -6031,7 +6213,7 @@ do_issue_cull_face() { report_my_gl_errors(); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_fog // Access: Protected @@ -6052,7 +6234,7 @@ do_issue_fog() { } report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_depth_offset @@ -6093,7 +6275,7 @@ do_issue_depth_offset() { report_my_gl_errors(); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_material // Access: Protected @@ -6199,7 +6381,7 @@ do_issue_material() { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_blending @@ -6330,7 +6512,7 @@ do_issue_blending() { enable_blend(false); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::bind_light // Access: Public, Virtual @@ -6373,9 +6555,9 @@ bind_light(PointLight *light_obj, const NodePath &light, int light_id) { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::bind_light // Access: Public, Virtual @@ -6425,9 +6607,9 @@ bind_light(DirectionalLight *light_obj, const NodePath &light, int light_id) { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::bind_light // Access: Public, Virtual @@ -6471,7 +6653,7 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION #ifdef SUPPORT_IMMEDIATE_MODE //////////////////////////////////////////////////////////////////// @@ -6680,8 +6862,7 @@ query_gl_version() { _gl_version_major = 0; _gl_version_minor = 0; - _gl_shadlang_ver_major = 0; - _gl_shadlang_ver_minor = 0; + const GLubyte *text = glGetString(GL_VERSION); if (text == (const GLubyte *)NULL) { @@ -6727,38 +6908,45 @@ query_gl_version() { << _gl_version_major << "." << _gl_version_minor << "\n"; } + } +} + +//////////////////////////////////////////////////////////////////// +// Function: GLGraphicsStateGuardian::query_glsl_version +// Access: Protected +// Description: Queries the supported GLSL version. +//////////////////////////////////////////////////////////////////// +void CLP(GraphicsStateGuardian):: +query_glsl_version() { + _gl_shadlang_ver_major = 0; + _gl_shadlang_ver_minor = 0; #ifndef OPENGLES - if (_gl_version_major == 1) { - // We can't call has_extension at this point yet. - const char *extstr = (const char *) glGetString(GL_EXTENSIONS); - if (extstr != NULL) { - if (strstr(extstr, "GL_ARB_shading_language_100") != NULL) { - _gl_shadlang_ver_major = 1; - _gl_shadlang_ver_minor = 0; - } - } - } else if (_gl_version_major >= 2) { + if (_gl_version_major == 1) { + if (has_extension("GL_ARB_shading_language_100")) { _gl_shadlang_ver_major = 1; - _gl_shadlang_ver_minor = 1; - const char *verstr = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION); - if (verstr == NULL || - sscanf(verstr, "%d.%d", &_gl_shadlang_ver_major, - &_gl_shadlang_ver_minor) != 2) { - GLCAT.warning() << "Invalid GL_SHADING_LANGUAGE_VERSION format.\n"; - } + _gl_shadlang_ver_minor = 0; } -#elif defined(OPENGLES_2) + } else if (_gl_version_major >= 2) { _gl_shadlang_ver_major = 1; - _gl_shadlang_ver_minor = 0; + _gl_shadlang_ver_minor = 1; const char *verstr = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION); if (verstr == NULL || - sscanf(verstr, "OpenGL ES GLSL %d.%d", &_gl_shadlang_ver_major, - &_gl_shadlang_ver_minor) != 2) { + sscanf(verstr, "%d.%d", &_gl_shadlang_ver_major, + &_gl_shadlang_ver_minor) != 2) { GLCAT.warning() << "Invalid GL_SHADING_LANGUAGE_VERSION format.\n"; } -#endif } +#elif defined(OPENGLES_2) + _gl_shadlang_ver_major = 1; + _gl_shadlang_ver_minor = 0; + const char *verstr = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION); + if (verstr == NULL || + sscanf(verstr, "OpenGL ES GLSL %d.%d", &_gl_shadlang_ver_major, + &_gl_shadlang_ver_minor) != 2) { + GLCAT.warning() << "Invalid GL_SHADING_LANGUAGE_VERSION format.\n"; + } +#endif } //////////////////////////////////////////////////////////////////// @@ -7579,8 +7767,14 @@ get_external_image_format(Texture *tex) const { case Texture::F_blue: return GL_BLUE; #endif + case Texture::F_alpha: +#ifdef SUPPORT_FIXED_FUNCTION return GL_ALPHA; +#else + return GL_RED; +#endif + #ifndef OPENGLES_1 case Texture::F_rg16: case Texture::F_rg32: @@ -7613,13 +7807,22 @@ get_external_image_format(Texture *tex) const { #else return _supports_bgr ? GL_BGRA : GL_RGBA; #endif + case Texture::F_luminance: case Texture::F_sluminance: +#ifdef SUPPORT_FIXED_FUNCTION return GL_LUMINANCE; +#else + return GL_RED; +#endif case Texture::F_luminance_alphamask: case Texture::F_luminance_alpha: case Texture::F_sluminance_alpha: +#ifdef SUPPORT_FIXED_FUNCTION return GL_LUMINANCE_ALPHA; +#else + return GL_RG; +#endif #ifndef OPENGLES case Texture::F_r8i: @@ -8127,7 +8330,11 @@ get_internal_image_format(Texture *tex, bool force_sized) const { #endif case Texture::F_alpha: +#ifdef SUPPORT_FIXED_FUNCTION return force_sized ? GL_ALPHA8 : GL_ALPHA; +#else + return force_sized ? GL_R8 : GL_RED; +#endif case Texture::F_luminance: #ifndef OPENGLES @@ -8243,7 +8450,7 @@ is_compressed_format(GLenum format) { //////////////////////////////////////////////////////////////////// GLint CLP(GraphicsStateGuardian):: get_texture_apply_mode_type(TextureStage::Mode am) { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION switch (am) { case TextureStage::M_modulate: return GL_MODULATE; case TextureStage::M_decal: return GL_DECAL; @@ -8275,7 +8482,7 @@ get_texture_apply_mode_type(TextureStage::Mode am) { //////////////////////////////////////////////////////////////////// GLint CLP(GraphicsStateGuardian):: get_texture_combine_type(TextureStage::CombineMode cm) { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION switch (cm) { case TextureStage::CM_undefined: // fall through case TextureStage::CM_replace: return GL_REPLACE; @@ -8303,7 +8510,7 @@ GLint CLP(GraphicsStateGuardian):: get_texture_src_type(TextureStage::CombineSource cs, int last_stage, int last_saved_result, int this_stage) const { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION switch (cs) { case TextureStage::CS_undefined: // fall through case TextureStage::CS_texture: return GL_TEXTURE; @@ -8365,6 +8572,7 @@ get_texture_operand_type(TextureStage::CombineOperand co) { return GL_SRC_COLOR; } +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_fog_mode_type // Access: Protected, Static @@ -8374,23 +8582,18 @@ GLenum CLP(GraphicsStateGuardian):: get_fog_mode_type(Fog::Mode m) { switch(m) { case Fog::M_linear: return GL_LINEAR; -#ifndef OPENGLES_2 case Fog::M_exponential: return GL_EXP; case Fog::M_exponential_squared: return GL_EXP2; -#endif /* case Fog::M_spline: return GL_FOG_FUNC_SGIS; */ default: GLCAT.error() << "Invalid Fog::Mode value" << endl; -#ifdef OPENGLES_2 - return GL_LINEAR; -#else return GL_EXP; -#endif } } +#endif //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_blend_equation_type @@ -8539,65 +8742,6 @@ get_usage(Geom::UsageHint usage_hint) { return GL_STATIC_DRAW; } - -//////////////////////////////////////////////////////////////////// -// Function: GLGraphicsStateGuardian::print_gfx_visual -// Access: Public -// Description: Prints a description of the current visual selected. -//////////////////////////////////////////////////////////////////// -void CLP(GraphicsStateGuardian):: -print_gfx_visual() { - GLint i; - GLboolean j; - cout << "Graphics Visual Info (# bits of each):" << endl; - - cout << "RGBA: "; - glGetIntegerv( GL_RED_BITS, &i ); cout << i << " "; - glGetIntegerv( GL_GREEN_BITS, &i ); cout << i << " "; - glGetIntegerv( GL_BLUE_BITS, &i ); cout << i << " "; - glGetIntegerv( GL_ALPHA_BITS, &i ); cout << i << endl; - -#ifndef OPENGLES - cout << "Accum RGBA: "; - glGetIntegerv( GL_ACCUM_RED_BITS, &i ); cout << i << " "; - glGetIntegerv( GL_ACCUM_GREEN_BITS, &i ); cout << i << " "; - glGetIntegerv( GL_ACCUM_BLUE_BITS, &i ); cout << i << " "; - glGetIntegerv( GL_ACCUM_ALPHA_BITS, &i ); cout << i << endl; - - glGetIntegerv( GL_INDEX_BITS, &i ); cout << "Color Index: " << i << endl; -#endif - - glGetIntegerv( GL_DEPTH_BITS, &i ); cout << "Depth: " << i << endl; - glGetIntegerv( GL_ALPHA_BITS, &i ); cout << "Alpha: " << i << endl; - glGetIntegerv( GL_STENCIL_BITS, &i ); cout << "Stencil: " << i << endl; - -#ifndef OPENGLES - glGetBooleanv( GL_DOUBLEBUFFER, &j ); cout << "DoubleBuffer? " - << (int)j << endl; - - glGetBooleanv( GL_STEREO, &j ); cout << "Stereo? " << (int)j << endl; -#endif - - if (_supports_multisample) { -#ifndef OPENGLES_2 - glGetBooleanv( GL_MULTISAMPLE, &j ); cout << "Multisample? " << (int)j << endl; -#endif - glGetIntegerv( GL_SAMPLES, &i ); cout << "Samples: " << i << endl; - } - - glGetBooleanv( GL_BLEND, &j ); cout << "Blend? " << (int)j << endl; -#ifndef OPENGLES_2 - glGetBooleanv( GL_POINT_SMOOTH, &j ); cout << "Point Smooth? " - << (int)j << endl; - glGetBooleanv( GL_LINE_SMOOTH, &j ); cout << "Line Smooth? " - << (int)j << endl; -#endif - -#ifndef OPENGLES - glGetIntegerv( GL_AUX_BUFFERS, &i ); cout << "Aux Buffers: " << i << endl; -#endif -} - //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_light_color // Access: Public @@ -8640,7 +8784,7 @@ reissue_transforms() { do_issue_transform(); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::enable_lighting // Access: Protected, Virtual @@ -8660,9 +8804,9 @@ enable_lighting(bool enable) { glDisable(GL_LIGHTING); } } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::set_ambient_light // Access: Protected, Virtual @@ -8683,9 +8827,9 @@ set_ambient_light(const LColor &color) { c[3] * _light_color_scale[3]); call_glLightModelfv(GL_LIGHT_MODEL_AMBIENT, c); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::enable_light // Access: Protected, Virtual @@ -8704,9 +8848,9 @@ enable_light(int light_id, bool enable) { glDisable(get_light_id(light_id)); } } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::begin_bind_lights // Access: Protected, Virtual @@ -8738,9 +8882,9 @@ begin_bind_lights() { glPushMatrix(); GLPf(LoadMatrix)(render_transform->get_mat().get_data()); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::end_bind_lights // Access: Protected, Virtual @@ -8758,9 +8902,9 @@ end_bind_lights() { glMatrixMode(GL_MODELVIEW); glPopMatrix(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::enable_clip_plane // Access: Protected, Virtual @@ -8777,9 +8921,9 @@ enable_clip_plane(int plane_id, bool enable) { glDisable(get_clip_plane_id(plane_id)); } } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::begin_bind_clip_planes // Access: Protected, Virtual @@ -8808,9 +8952,9 @@ begin_bind_clip_planes() { glPushMatrix(); GLPf(LoadMatrix)(render_transform->get_mat().get_data()); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::bind_clip_plane // Access: Protected, Virtual @@ -8840,9 +8984,9 @@ bind_clip_plane(const NodePath &plane, int plane_id) { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::end_bind_clip_planes // Access: Protected, Virtual @@ -8857,7 +9001,7 @@ end_bind_clip_planes() { glMatrixMode(GL_MODELVIEW); glPopMatrix(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::set_state_and_transform @@ -8908,7 +9052,7 @@ set_state_and_transform(const RenderState *target, _instance_count = _target_shader->get_instance_count(); #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION int alpha_test_slot = AlphaTestAttrib::get_class_slot(); if (_target_rs->get_attrib(alpha_test_slot) != _state_rs->get_attrib(alpha_test_slot) || !_state_mask.get_bit(alpha_test_slot) || @@ -9000,7 +9144,7 @@ set_state_and_transform(const RenderState *target, _state_mask.set_bit(render_mode_slot); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION int rescale_normal_slot = RescaleNormalAttrib::get_class_slot(); if (_target_rs->get_attrib(rescale_normal_slot) != _state_rs->get_attrib(rescale_normal_slot) || !_state_mask.get_bit(rescale_normal_slot)) { @@ -9010,7 +9154,7 @@ set_state_and_transform(const RenderState *target, } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION int shade_model_slot = ShadeModelAttrib::get_class_slot(); if (_target_rs->get_attrib(shade_model_slot) != _state_rs->get_attrib(shade_model_slot) || !_state_mask.get_bit(shade_model_slot)) { @@ -9046,7 +9190,7 @@ set_state_and_transform(const RenderState *target, _state_shader = _target_shader; _state_mask.clear_bit(TextureAttrib::get_class_slot()); } -#ifdef OPENGLES_2 +#ifndef SUPPORT_FIXED_FUNCTION else { // In the case of OpenGL ES 2.x, we need to glUseShader before we draw anything. do_issue_shader(false); } @@ -9073,7 +9217,7 @@ set_state_and_transform(const RenderState *target, // If one of the previously-loaded TexGen modes modified the texture // matrix, then if either state changed, we have to change both of // them now. -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION if (_tex_gen_modifies_mat) { int tex_gen_slot = TexGenAttrib::get_class_slot(); int tex_matrix_slot = TexMatrixAttrib::get_class_slot(); @@ -9095,7 +9239,7 @@ set_state_and_transform(const RenderState *target, } #endif -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION int tex_gen_slot = TexGenAttrib::get_class_slot(); if (_target_tex_gen != _state_tex_gen || !_state_mask.get_bit(tex_gen_slot)) { @@ -9110,7 +9254,7 @@ set_state_and_transform(const RenderState *target, if (_target_rs->get_attrib(material_slot) != _state_rs->get_attrib(material_slot) || !_state_mask.get_bit(material_slot)) { //PStatGPUTimer timer(this, _draw_set_state_material_pcollector); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION do_issue_material(); #endif _state_mask.set_bit(material_slot); @@ -9125,7 +9269,7 @@ set_state_and_transform(const RenderState *target, if (_target_rs->get_attrib(light_slot) != _state_rs->get_attrib(light_slot) || !_state_mask.get_bit(light_slot)) { //PStatGPUTimer timer(this, _draw_set_state_light_pcollector); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION do_issue_light(); #endif _state_mask.set_bit(light_slot); @@ -9148,7 +9292,7 @@ set_state_and_transform(const RenderState *target, if (_target_rs->get_attrib(fog_slot) != _state_rs->get_attrib(fog_slot) || !_state_mask.get_bit(fog_slot)) { //PStatGPUTimer timer(this, _draw_set_state_fog_pcollector); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION do_issue_fog(); #endif _state_mask.set_bit(fog_slot); @@ -9206,12 +9350,12 @@ do_issue_texture() { if (_texture_binding_shader_context != 0) { _texture_binding_shader_context->disable_shader_texture_bindings(); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION update_standard_texture_bindings(); #endif } else { if (_texture_binding_shader_context == 0) { -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION disable_standard_texture_bindings(); #endif _current_shader_context->update_shader_texture_bindings(NULL); @@ -9226,7 +9370,7 @@ do_issue_texture() { #endif } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::update_standard_texture_bindings // Access: Private @@ -9470,9 +9614,32 @@ update_standard_texture_bindings() { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION +//////////////////////////////////////////////////////////////////// +// Function: GLGraphicsStateGuardian::apply_white_texture +// Access: Private +// Description: Applies a white dummy texture. This is useful to +// bind to a texture slot when a texture is missing. +//////////////////////////////////////////////////////////////////// +void CLP(GraphicsStateGuardian):: +apply_white_texture() { + if (_white_texture != 0) { + glBindTexture(GL_TEXTURE_2D, _white_texture); + return; + } + glGenTextures(1, &_white_texture); + glBindTexture(GL_TEXTURE_2D, _white_texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + unsigned char data[] = {0xff, 0xff, 0xff, 0xff}; + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, + GL_RGBA, GL_UNSIGNED_BYTE, data); +} #ifndef NDEBUG //////////////////////////////////////////////////////////////////// @@ -9515,7 +9682,7 @@ update_show_usage_texture_bindings(int show_stage_index) { tc->enqueue_lru(&_prepared_objects->_graphics_memory_lru); } -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION // Disable all texture stages. for (i = 0; i < _num_active_texture_stages; i++) { _glActiveTexture(GL_TEXTURE0 + i); @@ -9551,7 +9718,7 @@ update_show_usage_texture_bindings(int show_stage_index) { // Choose the corresponding usage texture and apply it. _glActiveTexture(GL_TEXTURE0 + i); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION glEnable(GL_TEXTURE_2D); #endif @@ -9652,7 +9819,7 @@ upload_usage_texture(int width, int height) { } #endif // NDEBUG -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::disable_standard_texture_bindings // Access: Private @@ -9681,9 +9848,9 @@ disable_standard_texture_bindings() { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_tex_matrix // Access: Protected @@ -9718,9 +9885,9 @@ do_issue_tex_matrix() { } report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::do_issue_tex_gen // Access: Protected @@ -10003,7 +10170,7 @@ do_issue_tex_gen() { report_my_gl_errors(); } -#endif // !OPENGLES_2 +#endif // SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::specify_texture @@ -10099,7 +10266,7 @@ specify_texture(CLP(TextureContext) *gtc, const SamplerState &sampler) { tex->get_format() == Texture::F_depth_component16 || tex->get_format() == Texture::F_depth_component24 || tex->get_format() == Texture::F_depth_component32) { -#ifndef OPENGLES +#ifdef SUPPORT_FIXED_FUNCTION glTexParameteri(target, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY); #endif if (_supports_shadow_filter) { @@ -10533,6 +10700,36 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { } #endif +#if !defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES_2) + // Do we need to apply a swizzle mask to emulate these deprecated + // texture formats? + switch (tex->get_format()) { + case Texture::F_alpha: + glTexParameteri(target, GL_TEXTURE_SWIZZLE_R, GL_ONE); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_G, GL_ONE); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_B, GL_ONE); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_A, GL_RED); + break; + + case Texture::F_luminance: + glTexParameteri(target, GL_TEXTURE_SWIZZLE_R, GL_RED); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_G, GL_RED); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_B, GL_RED); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_A, GL_ONE); + break; + + case Texture::F_luminance_alpha: + glTexParameteri(target, GL_TEXTURE_SWIZZLE_R, GL_RED); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_G, GL_RED); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_B, GL_RED); + glTexParameteri(target, GL_TEXTURE_SWIZZLE_A, GL_GREEN); + break; + + default: + break; + } +#endif + // Allocate immutable storage for the texture, after which we can subload it. // Pre-allocating storage using glTexStorage is more efficient than using glTexImage // to load all of the individual images one by one later, but we are not allowed to @@ -10987,12 +11184,12 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, GLCAT.warning() << "No mipmap level " << n << " defined for " << tex->get_name() << "\n"; - #ifndef OPENGLES +#ifndef OPENGLES if (is_at_least_gl_version(1, 2)) { // Tell the GL we have no more mipmaps for it to use. glTexParameteri(texture_target, GL_TEXTURE_MAX_LEVEL, n - mipmap_bias); } - #endif +#endif break; } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index ff13fcd202..71339e4b23 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -57,6 +57,7 @@ typedef double GLdouble; // functions are defined, and the system gl.h sometimes doesn't // declare these typedefs. #if !defined( __EDG__ ) || defined( __INTEL_COMPILER ) // Protect the following from the Tau instrumentor and expose it for the intel compiler. +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); @@ -137,6 +138,9 @@ typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLen typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); #ifndef OPENGLES_1 // GLSL shader functions @@ -341,7 +345,7 @@ public: virtual bool framebuffer_copy_to_ram (Texture *tex, int view, int z, const DisplayRegion *dr, const RenderBuffer &rb); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION void apply_fog(Fog *fog); virtual void bind_light(PointLight *light_obj, const NodePath &light, @@ -352,8 +356,6 @@ public: int light_id); #endif - void print_gfx_visual(); - LVecBase4 get_light_color(Light *light) const; #ifdef SUPPORT_IMMEDIATE_MODE @@ -386,23 +388,25 @@ protected: void do_issue_rescale_normal(); void do_issue_color_write(); void do_issue_depth_test(); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION void do_issue_alpha_test(); #endif void do_issue_depth_write(); void do_issue_cull_face(); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION void do_issue_fog(); #endif void do_issue_depth_offset(); void do_issue_shade_model(); +#ifndef OPENGLES_1 void do_issue_shader(bool state_has_changed = false); -#ifndef OPENGLES_2 +#endif +#ifdef SUPPORT_FIXED_FUNCTION void do_issue_material(); #endif void do_issue_texture(); void do_issue_blending(); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION void do_issue_tex_gen(); void do_issue_tex_matrix(); #endif @@ -418,10 +422,11 @@ protected: static string get_error_string(GLenum error_code); string show_gl_string(const string &name, GLenum id); virtual void query_gl_version(); + void query_glsl_version(); void save_extensions(const char *extensions); virtual void get_extra_extensions(); void report_extensions() const; - INLINE virtual bool has_extension(const string &extension) const FINAL; + INLINE virtual bool has_extension(const string &extension) const; INLINE bool is_at_least_gl_version(int major_version, int minor_version) const; INLINE bool is_at_least_gles_version(int major_version, int minor_version) const; void *get_extension_func(const char *name); @@ -429,7 +434,7 @@ protected: virtual void reissue_transforms(); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION virtual void enable_lighting(bool enable); virtual void set_ambient_light(const LColor &color); virtual void enable_light(int light_id, bool enable); @@ -464,7 +469,7 @@ protected: INLINE void set_color_write_mask(int mask); INLINE void clear_color_write_mask(); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION INLINE void call_glFogfv(GLenum pname, const LColor &color); INLINE void call_glMaterialfv(GLenum face, GLenum pname, const LColor &color); INLINE void call_glLightfv(GLenum light, GLenum pname, const LVecBase4 &value); @@ -475,7 +480,7 @@ protected: INLINE void call_glTexParameterfv(GLenum target, GLenum pname, const LVecBase4 &value); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION INLINE GLenum get_light_id(int index) const; INLINE GLenum get_clip_plane_id(int index) const; #endif @@ -507,13 +512,15 @@ protected: static GLenum get_usage(Geom::UsageHint usage_hint); void unbind_buffers(); -#ifndef OPENGLES_2 +#ifdef SUPPORT_FIXED_FUNCTION void disable_standard_vertex_arrays(); bool update_standard_vertex_arrays(bool force); void disable_standard_texture_bindings(); void update_standard_texture_bindings(); #endif + void apply_white_texture(); + #ifndef NDEBUG void update_show_usage_texture_bindings(int show_stage_index); void upload_usage_texture(int width, int height); @@ -590,8 +597,7 @@ protected: ShaderContext *_vertex_array_shader_context; PT(Shader) _texture_binding_shader; ShaderContext *_texture_binding_shader_context; -#endif -#ifdef OPENGLES_2 + static PT(Shader) _default_shader; #endif @@ -655,7 +661,7 @@ public: bool _explicit_primitive_restart; #endif -#ifndef OPENGLES +#if defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES) PFNGLSECONDARYCOLORPOINTERPROC _glSecondaryColorPointer; #endif @@ -692,14 +698,18 @@ public: PFNGLGETCOMPRESSEDTEXIMAGEPROC _glGetCompressedTexImage; bool _supports_bgr; - bool _supports_rescale_normal; bool _supports_packed_dabc; bool _supports_packed_ufloat; +#ifdef SUPPORT_FIXED_FUNCTION + bool _supports_rescale_normal; +#endif + PFNGLACTIVETEXTUREPROC _glActiveTexture; -#ifndef OPENGLES_2 - bool _supports_multitexture; +#ifdef SUPPORT_FIXED_FUNCTION PFNGLCLIENTACTIVETEXTUREPROC _glClientActiveTexture; +#endif +#ifdef SUPPORT_IMMEDIATE_MODE PFNGLMULTITEXCOORD1FPROC _glMultiTexCoord1f; PFNGLMULTITEXCOORD2FPROC _glMultiTexCoord2f; PFNGLMULTITEXCOORD3FPROC _glMultiTexCoord3f; @@ -720,6 +730,12 @@ public: PFNGLBLENDEQUATIONPROC _glBlendEquation; PFNGLBLENDCOLORPROC _glBlendColor; + bool _supports_vao; + GLuint _current_vao_index; + PFNGLBINDVERTEXARRAYPROC _glBindVertexArray; + PFNGLDELETEVERTEXARRAYSPROC _glDeleteVertexArrays; + PFNGLGENVERTEXARRAYSPROC _glGenVertexArrays; + bool _supports_framebuffer_object; PFNGLISRENDERBUFFEREXTPROC _glIsRenderbuffer; PFNGLBINDRENDERBUFFEREXTPROC _glBindRenderbuffer; @@ -888,6 +904,8 @@ public: bool _use_object_labels; PFNGLOBJECTLABELPROC _glObjectLabel; + GLuint _white_texture; + #ifndef NDEBUG bool _show_texture_usage; int _show_texture_usage_max_size; diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 4c6922432f..2fd3c25577 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -2047,8 +2047,11 @@ update_shader_texture_bindings(ShaderContext *prev) { tex = _glgsg->_target_shader->get_shader_input_texture(id, &sampler); } else { - // Numbered texture input. if (spec._stage >= texattrib->get_num_on_stages()) { + // Apply a white texture in order to make it easier to use a shader + // that takes a texture on a model that doesn't have a texture applied. + _glgsg->_glActiveTexture(GL_TEXTURE0 + i); + _glgsg->apply_white_texture(); continue; } TextureStage *stage = texattrib->get_on_stage(spec._stage); diff --git a/panda/src/glstuff/glmisc_src.cxx b/panda/src/glstuff/glmisc_src.cxx index 82604e1051..743b9ca0ea 100644 --- a/panda/src/glstuff/glmisc_src.cxx +++ b/panda/src/glstuff/glmisc_src.cxx @@ -14,6 +14,10 @@ #include "pandaSystem.h" +ConfigVariableInt gl_version + ("gl-version", "", + PRC_DESC("Set this to get an OpenGL context with a specific version.")); + ConfigVariableBool gl_support_fbo ("gl-support-fbo", true, PRC_DESC("Configure this false if your GL's implementation of " diff --git a/panda/src/glstuff/glmisc_src.h b/panda/src/glstuff/glmisc_src.h index 33408c6ca8..78a19a5a8f 100644 --- a/panda/src/glstuff/glmisc_src.h +++ b/panda/src/glstuff/glmisc_src.h @@ -41,6 +41,7 @@ //#define GSG_VERBOSE 1 +extern ConfigVariableInt gl_version; extern EXPCL_PANDAGL ConfigVariableBool gl_support_fbo; extern ConfigVariableBool gl_cheap_textures; extern ConfigVariableBool gl_ignore_clamp; diff --git a/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx b/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx index e9c44e9e8d..4964385912 100644 --- a/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx +++ b/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx @@ -355,6 +355,14 @@ choose_pixel_format(const FrameBufferProperties &properties, n = 0; attrib_list[n++] = GLX_RENDER_TYPE; attrib_list[n++] = render_type; + if (gl_version.get_num_words() > 0) { + attrib_list[n++] = GLX_CONTEXT_MAJOR_VERSION_ARB; + attrib_list[n++] = gl_version[0]; + if (gl_version.get_num_words() > 1) { + attrib_list[n++] = GLX_CONTEXT_MINOR_VERSION_ARB; + attrib_list[n++] = gl_version[1]; + } + } if (gl_debug) { attrib_list[n++] = GLX_CONTEXT_FLAGS_ARB; attrib_list[n++] = GLX_CONTEXT_DEBUG_BIT_ARB; From 16bfd3750f726a8831771b81649d18d087917fd5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Jul 2015 19:07:14 -0700 Subject: [PATCH 052/203] Add missing includes. --- dtool/src/cppparser/cppStructType.cxx | 1 + dtool/src/dtoolbase/pdtoa.h | 2 +- dtool/src/interrogate/functionRemap.cxx | 2 ++ dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx | 1 + dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx | 1 + dtool/src/interrogate/parameterRemapBasicStringToString.cxx | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dtool/src/cppparser/cppStructType.cxx b/dtool/src/cppparser/cppStructType.cxx index 42dfed1d7b..c0a8aa7448 100644 --- a/dtool/src/cppparser/cppStructType.cxx +++ b/dtool/src/cppparser/cppStructType.cxx @@ -20,6 +20,7 @@ #include "cppTemplateScope.h" #include "cppFunctionGroup.h" #include "cppFunctionType.h" +#include "cppParameterList.h" #include "cppTBDType.h" #include "indent.h" #include "cppParser.h" diff --git a/dtool/src/dtoolbase/pdtoa.h b/dtool/src/dtoolbase/pdtoa.h index b7f9b39f72..a3d3e46147 100644 --- a/dtool/src/dtoolbase/pdtoa.h +++ b/dtool/src/dtoolbase/pdtoa.h @@ -9,7 +9,7 @@ #ifndef PDTOA_H #define PDTOA_H -#include "dtoolsymbols.h" +#include "dtoolbase.h" #ifdef __cplusplus extern "C" { diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 4206931d13..5e602a7553 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -22,7 +22,9 @@ #include "interrogateBuilder.h" #include "interrogateDatabase.h" +#include "cppExpression.h" #include "cppInstance.h" +#include "cppArrayType.h" #include "cppConstType.h" #include "cppFunctionType.h" #include "cppParameterList.h" diff --git a/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx b/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx index 42ae0ecd5e..03bb183a0e 100644 --- a/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx +++ b/dtool/src/interrogate/parameterRemapBasicStringPtrToString.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "parameterRemapBasicStringPtrToString.h" +#include "interrogate.h" //////////////////////////////////////////////////////////////////// // Function: ParameterRemapBasicStringPtrToString::Constructor diff --git a/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx b/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx index 4e264c45d3..84962d4bf6 100644 --- a/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx +++ b/dtool/src/interrogate/parameterRemapBasicStringRefToString.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "parameterRemapBasicStringRefToString.h" +#include "interrogate.h" //////////////////////////////////////////////////////////////////// // Function: ParameterRemapBasicStringRefToString::Constructor diff --git a/dtool/src/interrogate/parameterRemapBasicStringToString.cxx b/dtool/src/interrogate/parameterRemapBasicStringToString.cxx index 3cd22933a9..8a23083953 100644 --- a/dtool/src/interrogate/parameterRemapBasicStringToString.cxx +++ b/dtool/src/interrogate/parameterRemapBasicStringToString.cxx @@ -14,6 +14,7 @@ #include "parameterRemapBasicStringToString.h" #include "interfaceMaker.h" +#include "interrogate.h" //////////////////////////////////////////////////////////////////// // Function: ParameterRemapBasicStringToString::Constructor From 9178ed2871c198f0e50212ba7b80f9c9fdf94871 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 13 Jul 2015 19:54:55 +0100 Subject: [PATCH 053/203] Fix some preprocessor expressions in Interrogate --- dtool/src/cppparser/cppPreprocessor.cxx | 10 +++++++--- dtool/src/cppparser/cppPreprocessor.h | 2 +- dtool/src/parser-inc/stdtypedefs.h | 7 +++++-- makepanda/makepanda.py | 9 ++++----- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 52c758acd6..cbb7174239 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -687,7 +687,7 @@ push_string(const string &input, bool lock_position) { // string and return the new string. //////////////////////////////////////////////////////////////////// string CPPPreprocessor:: -expand_manifests(const string &input_expr) { +expand_manifests(const string &input_expr, bool expand_undefined) { // Get a copy of the expression string we can modify. string expr = input_expr; @@ -722,6 +722,10 @@ expand_manifests(const string &input_expr) { expand_manifest_inline(expr, q, p, (*mi).second); manifest_found = true; } + } else if (expand_undefined && ident != "true" && ident != "false") { + // It is not found. Expand it to 0. + expr = expr.substr(0, q) + "0" + expr.substr(p); + p = q + 1; } } } else { @@ -751,7 +755,7 @@ expand_manifests(const string &input_expr) { CPPExpression *CPPPreprocessor:: parse_expr(const string &input_expr, CPPScope *current_scope, CPPScope *global_scope) { - string expr = expand_manifests(input_expr); + string expr = expand_manifests(input_expr, true); CPPExpressionParser ep(current_scope, global_scope); ep._verbose = 0; @@ -1380,7 +1384,7 @@ handle_include_directive(const string &args, int first_line, // might not filter out quotes and angle brackets properly, we'll // only expand manifests if we don't begin with a quote or bracket. if (!expr.empty() && (expr[0] != '"' && expr[0] != '<')) { - expr = expand_manifests(expr); + expr = expand_manifests(expr, false); } if (!expr.empty()) { diff --git a/dtool/src/cppparser/cppPreprocessor.h b/dtool/src/cppparser/cppPreprocessor.h index 571ef0598b..9aedcb24de 100644 --- a/dtool/src/cppparser/cppPreprocessor.h +++ b/dtool/src/cppparser/cppPreprocessor.h @@ -106,7 +106,7 @@ protected: bool push_file(const CPPFile &file); bool push_string(const string &input, bool lock_position); - string expand_manifests(const string &input_expr); + string expand_manifests(const string &input_expr, bool expand_undefined); CPPExpression *parse_expr(const string &expr, CPPScope *current_scope, CPPScope *global_scope); diff --git a/dtool/src/parser-inc/stdtypedefs.h b/dtool/src/parser-inc/stdtypedefs.h index 345eda1fd0..99280ebb4f 100644 --- a/dtool/src/parser-inc/stdtypedefs.h +++ b/dtool/src/parser-inc/stdtypedefs.h @@ -39,10 +39,13 @@ typedef unsigned short ushort; typedef unsigned char uchar; #ifdef __cplusplus -#define NULL 0 +#define NULL 0L #else #define NULL ((void *)0) #endif -#endif +// One day, we might extend interrogate to be able to parse this, +// but we currently don't need it. +#define alignas(x) +#endif diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index b7ac3cbc4a..d7bc6e723d 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1020,7 +1020,6 @@ def CompileCxx(obj,src,opts): if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir) for (opt,var,val) in DEFSYMBOLS: if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val - if (opts.count('NOFLOATWARN')): cmd += ' /wd4244 /wd4305' if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-' if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS" @@ -1070,7 +1069,6 @@ def CompileCxx(obj,src,opts): if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir) for (opt,var,val) in DEFSYMBOLS: if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val - if (opts.count('NOFLOATWARN')): cmd += ' /wd4244 /wd4305' if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-' if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS" @@ -1339,14 +1337,15 @@ def CompileIgate(woutd,wsrc,opts): cmd = 'interrogate' cmd += ' -srcdir %s -I%s -Dvolatile -Dmutable' % (srcdir, srcdir) + cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L' if (COMPILER=="MSVC"): - cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32' + cmd += ' -D__inline -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32' if GetTargetArch() == 'x64': cmd += ' -DWIN64_VC -DWIN64 -D_WIN64' # NOTE: this 1600 value is the version number for VC2010. - cmd += ' -D_MSC_VER=1600 -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall' + cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall' if (COMPILER=="GCC"): - cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D__const=const -D__attribute__\(x\)=' + cmd += ' -D__inline -D__const=const -D__attribute__\(x\)=' if GetTargetArch() in ("x86_64", "amd64"): cmd += ' -D_LP64' else: From da6140a8cc177ccc37c3d076a14cb5b5fba7dfdf Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 14 Jul 2015 21:00:12 +0100 Subject: [PATCH 054/203] Changes to GLSL input handling that further assist in efforts to port from Cg to GLSL --- panda/src/glstuff/glShaderContext_src.cxx | 159 ++++++++++++++-------- panda/src/glstuff/glShaderContext_src.h | 2 +- 2 files changed, 107 insertions(+), 54 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 2fd3c25577..f0fcf509d8 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -51,59 +51,51 @@ TypeHandle CLP(ShaderContext)::_type_handle; // actually picked up and the appropriate ShaderMatSpec pushed onto _mat_spec. //////////////////////////////////////////////////////////////////// bool CLP(ShaderContext):: -parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *objShader) { +parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, GLenum param_type, GLint param_size, Shader *objShader) { Shader::ShaderArgInfo p; p._id = arg_id; p._cat = GLCAT; string basename(arg_id._name); + // Split it at the underscores. vector_string pieces; tokenize(basename, pieces, "_"); - if (pieces[0] == "mstrans") { - pieces[0] = "trans"; - pieces.push_back("to"); - pieces.push_back("model"); - } - if (pieces[0] == "wstrans") { - pieces[0] = "trans"; - pieces.push_back("to"); - pieces.push_back("world"); - } - if (pieces[0] == "vstrans") { - pieces[0] = "trans"; - pieces.push_back("to"); - pieces.push_back("view"); - } - if (pieces[0] == "cstrans") { - pieces[0] = "trans"; - pieces.push_back("to"); - pieces.push_back("clip"); - } - if (pieces[0] == "mspos") { - pieces[0] = "row3"; - pieces.push_back("to"); - pieces.push_back("model"); - } - if (pieces[0] == "wspos") { - pieces[0] = "row3"; - pieces.push_back("to"); - pieces.push_back("world"); - } - if (pieces[0] == "vspos") { - pieces[0] = "row3"; - pieces.push_back("to"); - pieces.push_back("view"); - } - if (pieces[0] == "cspos") { - pieces[0] = "row3"; - pieces.push_back("to"); - pieces.push_back("clip"); + if (pieces.size() == 0 || pieces[0].size() < 3) { + return false; } - if ((pieces[0] == "mat") || (pieces[0] == "inv") || - (pieces[0] == "tps") || (pieces[0] == "itp")) { + // mstrans, wstrans, vstrans, cstrans, mspos, wspos, vspos, cspos + if (strcmp(pieces[0].c_str() + 1, "strans") == 0 || + strcmp(pieces[0].c_str() + 1, "spos") == 0) { + pieces.push_back("to"); + + switch (pieces[0][0]) { + case 'm': + pieces.push_back("model"); + break; + case 'w': + pieces.push_back("world"); + break; + case 'v': + pieces.push_back("view"); + break; + case 'c': + pieces.push_back("clip"); + break; + default: + return false; + } + if (strcmp(pieces[0].c_str() + 1, "strans") == 0) { + pieces[0] = "trans"; + } else { + pieces[0] = "row3"; + } + // mat_modelproj et al + } else if (pieces[0].size() == 3 && + (pieces[0] == "mat" || pieces[0] == "inv" || + pieces[0] == "tps" || pieces[0] == "itp")) { if (!objShader->cp_errchk_parameter_words(p, 2)) { return false; } @@ -156,16 +148,58 @@ parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *objSha pieces.push_back(""); // Decide whether this is a matrix or vector. - if (pieces[0] == "trans") bind._piece = Shader::SMP_whole; - else if (pieces[0] == "tpose") bind._piece = Shader::SMP_transpose; - else if (pieces[0] == "row0") bind._piece = Shader::SMP_row0; - else if (pieces[0] == "row1") bind._piece = Shader::SMP_row1; - else if (pieces[0] == "row2") bind._piece = Shader::SMP_row2; - else if (pieces[0] == "row3") bind._piece = Shader::SMP_row3; - else if (pieces[0] == "col0") bind._piece = Shader::SMP_col0; - else if (pieces[0] == "col1") bind._piece = Shader::SMP_col1; - else if (pieces[0] == "col2") bind._piece = Shader::SMP_col2; - else if (pieces[0] == "col3") bind._piece = Shader::SMP_col3; + if (param_type == GL_FLOAT_MAT4) { + if (pieces[0] == "trans") bind._piece = Shader::SMP_whole; + else if (pieces[0] == "tpose") bind._piece = Shader::SMP_transpose; + else { + GLCAT.error() << basename << " should be vec4, not mat3\n"; + return false; + } + } else if (param_type == GL_FLOAT_MAT3) { + if (pieces[0] == "trans") bind._piece = Shader::SMP_upper3x3; + else if (pieces[0] == "tpose") bind._piece = Shader::SMP_transpose3x3; + else { + GLCAT.error() << basename << " should be vec4, not mat3\n"; + return false; + } + } else if (param_type == GL_FLOAT_VEC4) { + if (pieces[0] == "trans") bind._piece = Shader::SMP_col0; + else if (pieces[0] == "tpose") bind._piece = Shader::SMP_row0; + else if (pieces[0] == "row0") bind._piece = Shader::SMP_row0; + else if (pieces[0] == "row1") bind._piece = Shader::SMP_row1; + else if (pieces[0] == "row2") bind._piece = Shader::SMP_row2; + else if (pieces[0] == "row3") bind._piece = Shader::SMP_row3; + else if (pieces[0] == "col0") bind._piece = Shader::SMP_col0; + else if (pieces[0] == "col1") bind._piece = Shader::SMP_col1; + else if (pieces[0] == "col2") bind._piece = Shader::SMP_col2; + else if (pieces[0] == "col3") bind._piece = Shader::SMP_col3; + else { + GLCAT.error() << basename << " should be mat4, not vec4\n"; + return false; + } + } else if (pieces[0] == "row3") { + // We'll permit this too, simply because we can support it. + switch (param_type) { + case GL_FLOAT: + bind._piece = Shader::SMP_row3x1; + break; + case GL_FLOAT_VEC2: + bind._piece = Shader::SMP_row3x2; + break; + case GL_FLOAT_VEC3: + bind._piece = Shader::SMP_row3x3; + break; + default: + GLCAT.error() << basename << " should be vec4\n"; + return false; + } + } else if (pieces[0] == "trans" || pieces[0] == "tpose") { + GLCAT.error() << basename << " should be mat4 or mat3\n"; + return false; + } else { + GLCAT.error() << basename << " should be vec4\n"; + return false; + } if (!objShader->cp_parse_coord_sys(p, pieces, next, bind, true)) { return false; @@ -194,6 +228,25 @@ parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *objSha objShader->cp_optimize_mat_spec(bind); objShader->_mat_spec.push_back(bind); + + if (param_size > 1) { + // We support arrays of rows and arrays of columns, so we can + // run the GLSL shaders that cgc spits out. + if (bind._piece == Shader::SMP_row0 || bind._piece == Shader::SMP_col0) { + if (param_size > 4) { + GLCAT.warning() << basename << "[" << param_size << "] is too large, only the first four elements will be defined\n"; + param_size = 4; + } + for (int i = 1; i < param_size; ++i) { + bind._id._seqno += 1; + bind._piece = (Shader::ShaderMatPiece)((int)bind._piece + 1); + objShader->_mat_spec.push_back(bind); + } + } else { + GLCAT.warning() << basename << "[" << param_size << "] should not be an array, only the first element will be defined\n"; + } + } + return true; } return false; @@ -963,7 +1016,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } else { // Tries to parse shorthand notations like mspos_XXX and trans_model_to_clip_of_XXX - if (parse_and_set_short_hand_shader_vars(arg_id, _shader)) { + if (parse_and_set_short_hand_shader_vars(arg_id, param_type, param_size, _shader)) { return; } } diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index fd4b56def4..9147bcf1b1 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -98,7 +98,7 @@ private: void glsl_report_program_errors(GLuint program, bool fatal); bool glsl_compile_shader(Shader::ShaderType type); bool glsl_compile_and_link(); - bool parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *s); + bool parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, GLenum param_type, GLint param_size, Shader *s); void release_resources(); public: From 1206d93813f231864f4e6a67c6b60dbdc9ce9815 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 14 Jul 2015 22:22:45 +0100 Subject: [PATCH 055/203] Fix pandac.PandaModules import error with Python 3 (thanks, tzaeru!) --- makepanda/makepanda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index d7bc6e723d..35bfea1e7f 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2648,7 +2648,7 @@ for module in panda_modules: panda_modules_code += """ try: from panda3d.%s import * -except ImportError, err: +except ImportError as err: if "No module named %s" not in str(err): raise""" % (module, module) From dafae50ce26b89ffbdd6a154a273d17e5ebbbfeb Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 17 Jul 2015 15:55:24 +0200 Subject: [PATCH 056/203] Protect against self-move-assignment to fix stable_sort in MSVC --- panda/src/express/pointerToBase.I | 15 +++++++++------ panda/src/putil/copyOnWritePointer.I | 13 ++++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/panda/src/express/pointerToBase.I b/panda/src/express/pointerToBase.I index 783d59353e..ce319a5f50 100644 --- a/panda/src/express/pointerToBase.I +++ b/panda/src/express/pointerToBase.I @@ -71,14 +71,17 @@ PointerToBase(PointerToBase &&from) NOEXCEPT { template INLINE void PointerToBase:: reassign(PointerToBase &&from) NOEXCEPT { - To *old_ptr = (To *)this->_void_ptr; + // Protect against self-move-assignment. + if (from._void_ptr != this->_void_ptr) { + To *old_ptr = (To *)this->_void_ptr; - this->_void_ptr = from._void_ptr; - from._void_ptr = NULL; + this->_void_ptr = from._void_ptr; + from._void_ptr = NULL; - // Now delete the old pointer. - if (old_ptr != (To *)NULL) { - unref_delete(old_ptr); + // Now delete the old pointer. + if (old_ptr != (To *)NULL) { + unref_delete(old_ptr); + } } } #endif // USE_MOVE_SEMANTICS diff --git a/panda/src/putil/copyOnWritePointer.I b/panda/src/putil/copyOnWritePointer.I index d9c81d9de5..47e51fab15 100644 --- a/panda/src/putil/copyOnWritePointer.I +++ b/panda/src/putil/copyOnWritePointer.I @@ -102,12 +102,15 @@ CopyOnWritePointer(CopyOnWritePointer &&move) NOEXCEPT : //////////////////////////////////////////////////////////////////// INLINE void CopyOnWritePointer:: operator = (CopyOnWritePointer &&move) NOEXCEPT { - CopyOnWriteObject *old_object = _cow_object; - _cow_object = move._cow_object; - move._cow_object = NULL; + // Protect against self-move-assignment. + if (move._cow_object != _cow_object) { + CopyOnWriteObject *old_object = _cow_object; + _cow_object = move._cow_object; + move._cow_object = NULL; - if (old_object != (CopyOnWriteObject *)NULL) { - cache_unref_delete(old_object); + if (old_object != (CopyOnWriteObject *)NULL) { + cache_unref_delete(old_object); + } } } #endif // USE_MOVE_SEMANTICS From 946f273ebb6f30969bf7d099bf9a3fdd06cad64f Mon Sep 17 00:00:00 2001 From: Jeremy Koletar Date: Fri, 17 Jul 2015 13:39:41 -0500 Subject: [PATCH 057/203] controls: Don't make scene graph assumptions when setting the CollisionRay's height --- direct/src/controls/GravityWalker.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/direct/src/controls/GravityWalker.py b/direct/src/controls/GravityWalker.py index 5552168860..7c232e55f4 100755 --- a/direct/src/controls/GravityWalker.py +++ b/direct/src/controls/GravityWalker.py @@ -179,9 +179,9 @@ class GravityWalker(DirectObject.DirectObject): # a higher or lower value depending on whether you want an avatar # that is outside of the world to step up to the floor when they # get under valid floor: - cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0) + self.cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0) cRayNode = CollisionNode('GW.cRayNode') - cRayNode.addSolid(cRay) + cRayNode.addSolid(self.cRay) self.cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode) cRayNode.setFromCollideMask(bitmask) cRayNode.setIntoCollideMask(BitMask32.allOff()) @@ -697,8 +697,4 @@ class GravityWalker(DirectObject.DirectObject): # There are sometimes issues if the collision ray height is # so tall that it collides with multiple levels of floors. def setCollisionRayHeight(self, height): - oldNode = self.avatarNodePath.getNode(0) - cRayNode = oldNode.getChild(2) - cRayNode.removeSolid(0) - cRay = CollisionRay(0.0, 0.0, height, 0.0, 0.0, -1.0) - cRayNode.addSolid(cRay) \ No newline at end of file + self.cRay.setOrigin(0.0, 0.0, height) From 221507437a4be6d3b9c0b3295d67f05b5ebad2e2 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 17 Jul 2015 21:28:51 +0200 Subject: [PATCH 058/203] Fix crash when passing an undersized array to a GLSL array input --- panda/src/glstuff/glShaderContext_src.cxx | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 5288c446b5..5566680c17 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1186,6 +1186,7 @@ issue_parameters(int altered) { } GLint p = _glsl_parameter_map[spec._id._seqno]; + int array_size = min(spec._dim[0], ptr_data->_size / spec._dim[1]); switch (spec._type) { case Shader::SPT_float: { @@ -1194,16 +1195,16 @@ issue_parameters(int altered) { switch (ptr_data->_type) { case Shader::SPT_int: // Convert int data to float data. - data = (float*) alloca(sizeof(float) * spec._dim[0] * spec._dim[1]); - for (int i = 0; i < (spec._dim[0] * spec._dim[1]); ++i) { + data = (float*) alloca(sizeof(float) * array_size * spec._dim[1]); + for (int i = 0; i < (array_size * spec._dim[1]); ++i) { data[i] = (float)(((int*)ptr_data->_ptr)[i]); } break; case Shader::SPT_double: // Downgrade double data to float data. - data = (float*) alloca(sizeof(float) * spec._dim[0] * spec._dim[1]); - for (int i = 0; i < (spec._dim[0] * spec._dim[1]); ++i) { + data = (float*) alloca(sizeof(float) * array_size * spec._dim[1]); + for (int i = 0; i < (array_size * spec._dim[1]); ++i) { data[i] = (float)(((double*)ptr_data->_ptr)[i]); } break; @@ -1217,12 +1218,12 @@ issue_parameters(int altered) { } switch (spec._dim[1]) { - case 1: _glgsg->_glUniform1fv(p, spec._dim[0], (float*)data); continue; - case 2: _glgsg->_glUniform2fv(p, spec._dim[0], (float*)data); continue; - case 3: _glgsg->_glUniform3fv(p, spec._dim[0], (float*)data); continue; - case 4: _glgsg->_glUniform4fv(p, spec._dim[0], (float*)data); continue; - case 9: _glgsg->_glUniformMatrix3fv(p, spec._dim[0], GL_FALSE, (float*)data); continue; - case 16: _glgsg->_glUniformMatrix4fv(p, spec._dim[0], GL_FALSE, (float*)data); continue; + case 1: _glgsg->_glUniform1fv(p, array_size, (float*)data); continue; + case 2: _glgsg->_glUniform2fv(p, array_size, (float*)data); continue; + case 3: _glgsg->_glUniform3fv(p, array_size, (float*)data); continue; + case 4: _glgsg->_glUniform4fv(p, array_size, (float*)data); continue; + case 9: _glgsg->_glUniformMatrix3fv(p, array_size, GL_FALSE, (float*)data); continue; + case 16: _glgsg->_glUniformMatrix4fv(p, array_size, GL_FALSE, (float*)data); continue; } nassertd(false) continue; } @@ -1239,10 +1240,10 @@ issue_parameters(int altered) { } else { switch (spec._dim[1]) { - case 1: _glgsg->_glUniform1iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue; - case 2: _glgsg->_glUniform2iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue; - case 3: _glgsg->_glUniform3iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue; - case 4: _glgsg->_glUniform4iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue; + case 1: _glgsg->_glUniform1iv(p, array_size, (int*)ptr_data->_ptr); continue; + case 2: _glgsg->_glUniform2iv(p, array_size, (int*)ptr_data->_ptr); continue; + case 3: _glgsg->_glUniform3iv(p, array_size, (int*)ptr_data->_ptr); continue; + case 4: _glgsg->_glUniform4iv(p, array_size, (int*)ptr_data->_ptr); continue; } nassertd(false) continue; } From 5e219f6438935c6dfd526d5bbd10f4db66a6e231 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 17 Jul 2015 21:34:29 +0200 Subject: [PATCH 059/203] Add support for uniform int osg_FrameNumber in GLSL --- panda/src/glstuff/glShaderContext_src.cxx | 28 +++++++++++++++++++---- panda/src/glstuff/glShaderContext_src.h | 2 ++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index a0a6f35959..7101fb62d0 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -266,6 +266,8 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext _color_attrib_index = -1; _transform_table_index = -1; _slider_table_index = -1; + _frame_number_loc = -1; + _frame_number = -1; _validated = !gl_validate_shaders; nassertv(s->get_language() == Shader::SL_GLSL); @@ -941,7 +943,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { if (noprefix == "TransformTable") { if (param_type != GL_FLOAT_MAT4) { GLCAT.error() - << "p3d_TransformTable should be uniform mat4\n"; + << "p3d_TransformTable should be uniform mat4[]\n"; return; } _transform_table_index = p; @@ -951,7 +953,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { if (noprefix == "SliderTable") { if (param_type != GL_FLOAT) { GLCAT.error() - << "p3d_SliderTable should be uniform float\n"; + << "p3d_SliderTable should be uniform float[]\n"; return; } _slider_table_index = p; @@ -965,8 +967,6 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { string noprefix(name_buffer + 4); // These inputs are supported by OpenSceneGraph. We can support // them as well, to increase compatibility. - // Other inputs we may support in the future: - // int osg_FrameNumber Shader::ShaderMatSpec bind; bind._id = arg_id; @@ -983,7 +983,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { _shader->_mat_spec.push_back(bind); return; - } else if (noprefix == "InverseViewMatrix") { + } else if (noprefix == "InverseViewMatrix" || noprefix == "ViewMatrixInverse") { bind._piece = Shader::SMP_whole; bind._func = Shader::SMF_compose; bind._part[0] = Shader::SMO_apiview_to_view; @@ -1012,6 +1012,16 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._dep[1] = Shader::SSD_NONE; _shader->_mat_spec.push_back(bind); return; + + } else if (noprefix == "FrameNumber") { + // We don't currently support ints with this mechanism, + // so we special-case this one. + if (param_type != GL_INT) { + GLCAT.error() << "osg_FrameNumber should be uniform int\n"; + } else { + _frame_number_loc = p; + } + return; } } else { @@ -1514,6 +1524,14 @@ issue_parameters(int altered) { return; } + if (_frame_number_loc != -1) { + int current_frame = ClockObject::get_global_clock()->get_frame_count(); + if (current_frame != _frame_number) { + _glgsg->_glUniform1i(_frame_number_loc, current_frame); + _frame_number = current_frame; + } + } + // Iterate through _ptr parameters for (int i = 0; i < (int)_shader->_ptr_spec.size(); ++i) { Shader::ShaderPtrSpec &spec = _shader->_ptr_spec[i]; diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index 9147bcf1b1..cc04500c9d 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -80,6 +80,8 @@ private: GLint _slider_table_index; GLsizei _transform_table_size; GLsizei _slider_table_size; + GLint _frame_number_loc; + GLint _frame_number; pmap _glsl_uniform_handles; struct ImageInput { From c224f351ecb6594cff7fedae7dd089b652e659bd Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 17 Jul 2015 21:50:06 +0200 Subject: [PATCH 060/203] Fix gcc/clang compile error --- panda/src/glstuff/glShaderContext_src.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 5566680c17..bb58a45572 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1186,7 +1186,7 @@ issue_parameters(int altered) { } GLint p = _glsl_parameter_map[spec._id._seqno]; - int array_size = min(spec._dim[0], ptr_data->_size / spec._dim[1]); + int array_size = min(spec._dim[0], (int)ptr_data->_size / spec._dim[1]); switch (spec._type) { case Shader::SPT_float: { From 96a9e223950f6d832b7a9eca0d6987a9f31f3e32 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 18 Jul 2015 11:06:11 +0200 Subject: [PATCH 061/203] Add uniform mat4 p3d_TextureMatrix[] input to GLSL --- panda/src/display/graphicsStateGuardian.cxx | 24 +++++++++++---- .../glstuff/glGraphicsStateGuardian_src.cxx | 11 +++++-- panda/src/glstuff/glShaderContext_src.cxx | 29 +++++++++++++++++-- panda/src/gobj/shader.cxx | 8 +++-- panda/src/gobj/shader.h | 5 +++- 5 files changed, 63 insertions(+), 14 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index a3979a6c2c..15ebcd9dc2 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1190,14 +1190,26 @@ fetch_specified_part(Shader::ShaderMatInput part, InternalName *name, } return &t; } - case Shader::SMO_texmat_x: { - const TexMatrixAttrib *tma = DCAST(TexMatrixAttrib, _target_rs->get_attrib_def(TexMatrixAttrib::get_class_slot())); - const TextureAttrib *ta = DCAST(TextureAttrib, _target_rs->get_attrib_def(TextureAttrib::get_class_slot())); - int stagenr = atoi(name->get_name().c_str()); - if (stagenr >= ta->get_num_on_stages()) { + case Shader::SMO_texmat_i: { + const TexMatrixAttrib *tma; + const TextureAttrib *ta; + if (_target_rs->get_attrib(ta) && _target_rs->get_attrib(tma) && + index < ta->get_num_on_stages()) { + return &tma->get_mat(ta->get_on_stage(index)); + } else { + return &LMatrix4::ident_mat(); + } + } + case Shader::SMO_inv_texmat_i: { + const TexMatrixAttrib *tma; + const TextureAttrib *ta; + if (_target_rs->get_attrib(ta) && _target_rs->get_attrib(tma) && + index < ta->get_num_on_stages()) { + t = tma->get_transform(ta->get_on_stage(index))->get_inverse()->get_mat(); + return &t; + } else { return &LMatrix4::ident_mat(); } - return &tma->get_mat(ta->get_on_stage(stagenr)); } case Shader::SMO_plane_x: { const NodePath &np = _target_shader->get_shader_input_nodepath(name); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index e594579d4c..6159dd5cfb 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -9217,7 +9217,6 @@ set_state_and_transform(const RenderState *target, // If one of the previously-loaded TexGen modes modified the texture // matrix, then if either state changed, we have to change both of // them now. -#ifdef SUPPORT_FIXED_FUNCTION if (_tex_gen_modifies_mat) { int tex_gen_slot = TexGenAttrib::get_class_slot(); int tex_matrix_slot = TexMatrixAttrib::get_class_slot(); @@ -9234,10 +9233,16 @@ set_state_and_transform(const RenderState *target, if (_target_rs->get_attrib(tex_matrix_slot) != _state_rs->get_attrib(tex_matrix_slot) || !_state_mask.get_bit(tex_matrix_slot)) { //PStatGPUTimer timer(this, _draw_set_state_tex_matrix_pcollector); +#ifdef SUPPORT_FIXED_FUNCTION do_issue_tex_matrix(); - _state_mask.set_bit(tex_matrix_slot); - } #endif + _state_mask.set_bit(tex_matrix_slot); +#ifndef OPENGLES_1 + if (_current_shader_context) { + _current_shader_context->issue_parameters(Shader::SSD_tex_matrix); + } +#endif + } #ifdef SUPPORT_FIXED_FUNCTION int tex_gen_slot = TexGenAttrib::get_class_slot(); diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 50a40f4e30..f2f0bd8a27 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -690,12 +690,16 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } else { bind._piece = Shader::SMP_transpose3x3; } - } else { + } else if (param_type == GL_FLOAT_MAT4) { if (transpose) { bind._piece = Shader::SMP_transpose; } else { bind._piece = Shader::SMP_whole; } + } else { + GLCAT.error() + << "Matrix input p3d_" << matrix_name << " should be mat3 or mat4\n"; + return; } bind._arg[0] = NULL; bind._arg[1] = NULL; @@ -731,7 +735,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._part[1] = Shader::SMO_identity; if (param_type != GL_FLOAT_MAT3) { - GLCAT.error() << "p3d_NormalMatrix input should be mat3, not mat4!\n"; + GLCAT.warning() << "p3d_NormalMatrix input should be mat3, not mat4!\n"; } } else if (matrix_name == "ModelMatrix") { @@ -761,6 +765,27 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._part[1] = Shader::SMO_view_to_apiclip; } + } else if (matrix_name == "TextureMatrix") { + // We may support 2-D texmats later, but let's make sure that people + // don't think they can just use a mat3 to get the 2-D version. + if (param_type != GL_FLOAT_MAT4) { + GLCAT.error() << "p3d_TextureMatrix should be mat4[], not mat3[]!\n"; + return; + } + + bind._func = Shader::SMF_first; + bind._part[0] = inverse ? Shader::SMO_inv_texmat_i + : Shader::SMO_texmat_i; + bind._part[1] = Shader::SMO_identity; + bind._dep[0] = Shader::SSD_general | Shader::SSD_tex_matrix; + bind._dep[1] = 0; + + // Add it once for each index. + for (bind._index = 0; bind._index < param_size; ++bind._index) { + _shader->_mat_spec.push_back(bind); + } + return; + } else { GLCAT.error() << "Unrecognized uniform matrix name '" << matrix_name << "'!\n"; return; diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 8f1cc70d33..b20ac8e1b2 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -452,6 +452,9 @@ cp_dependency(ShaderMatInput inp) { (inp == SMO_apiview_clipplane_i)) { dep |= SSD_clip_planes; } + if (inp == SMO_texmat_i || inp == SMO_inv_texmat_i) { + dep |= SSD_tex_matrix; + } return dep; } @@ -1040,10 +1043,11 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { bind._id = p._id; bind._piece = SMP_whole; bind._func = SMF_first; - bind._part[0] = SMO_texmat_x; - bind._arg[0] = InternalName::make(pieces[1]); + bind._part[0] = SMO_texmat_i; + bind._arg[0] = NULL; bind._part[1] = SMO_identity; bind._arg[1] = NULL; + bind._index = atoi(pieces[1].c_str()); cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index e56960b1f5..33fe43b799 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -132,7 +132,7 @@ public: SMO_plight_x, SMO_slight_x, SMO_satten_x, - SMO_texmat_x, + SMO_texmat_i, SMO_plane_x, SMO_clipplane_x, @@ -191,6 +191,8 @@ public: SMO_apiview_to_apiclip, SMO_apiclip_to_apiview, + SMO_inv_texmat_i, + SMO_INVALID }; @@ -270,6 +272,7 @@ public: SSD_fog = 0x040, SSD_light = 0x080, SSD_clip_planes = 0x100, + SSD_tex_matrix = 0x200, }; enum ShaderBug { From e91a9100ed3398bfe14bfa793d274a02fbbcb871 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 18 Jul 2015 22:40:57 +0200 Subject: [PATCH 062/203] Support specifying custom gl-version or requesting debug context on Windows Also works around NVIDIA driver bug where GL_VERSION is always reported as 1.2 for pview.exe --- .../glstuff/glGraphicsStateGuardian_src.cxx | 65 +++++++++++++++---- .../wgldisplay/wglGraphicsStateGuardian.cxx | 39 ++++++++++- .../src/wgldisplay/wglGraphicsStateGuardian.h | 2 + panda/src/wgldisplay/wglGraphicsWindow.cxx | 12 +++- 4 files changed, 103 insertions(+), 15 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 6159dd5cfb..476e1af9f1 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -6835,10 +6835,9 @@ show_gl_string(const string &name, GLenum id) { const GLubyte *text = glGetString(id); if (text == (const GLubyte *)NULL) { - if (GLCAT.is_debug()) { - GLCAT.debug() - << "Unable to query " << name << "\n"; - } + GLCAT.warning() + << "Unable to query " << name << "\n"; + } else { result = (const char *)text; if (GLCAT.is_debug()) { @@ -6859,20 +6858,60 @@ void CLP(GraphicsStateGuardian):: query_gl_version() { _gl_vendor = show_gl_string("GL_VENDOR", GL_VENDOR); _gl_renderer = show_gl_string("GL_RENDERER", GL_RENDERER); + _gl_version = show_gl_string("GL_VERSION", GL_VERSION); _gl_version_major = 0; _gl_version_minor = 0; + // This is the most preposterous driver bug: NVIDIA drivers will claim + // that the version is 1.2 as long as the process is named pview.exe! +#ifndef OPENGLES + if (_gl_version.substr(0, 10) == "1.2 NVIDIA") { + Filename exec_name = ExecutionEnvironment::get_binary_name(); + if (cmp_nocase(exec_name.get_basename(), "pview.exe") == 0) { + glGetIntegerv(GL_MAJOR_VERSION, &_gl_version_major); + glGetIntegerv(GL_MINOR_VERSION, &_gl_version_minor); + + if (glGetError() == GL_INVALID_ENUM) { + _gl_version_major = 1; + _gl_version_minor = 2; + GLCAT.warning() + << "Driver possibly misreported GL_VERSION! Unable to detect " + "correct OpenGL version.\n"; + + } else if (_gl_version_major != 1 || _gl_version_minor != 2) { + GLCAT.debug() + << "Driver misreported GL_VERSION! Correct version detected as " + << _gl_version_major << "." << _gl_version_minor << "\n"; + } + return; + } + } +#endif + + // If we asked for a GL 3 context, let's first try and see if we + // can use the OpenGL 3 way to query version. + if (gl_version.get_num_words() > 0 && gl_version[0] >= 3) { + glGetIntegerv(GL_MAJOR_VERSION, &_gl_version_major); + glGetIntegerv(GL_MINOR_VERSION, &_gl_version_minor); + + if (_gl_version_major >= 1) { + // Fair enough, seems to check out. + if (GLCAT.is_debug()) { + GLCAT.debug() + << "Detected OpenGL version: " + << _gl_version_major << "." << _gl_version_minor << "\n"; + } + return; + } + } + + // Otherwise, parse the GL_VERSION string. + if (_gl_version.empty()) { + GLCAT.error() << "Unable to detect OpenGL version\n"; - const GLubyte *text = glGetString(GL_VERSION); - if (text == (const GLubyte *)NULL) { - GLCAT.warning() - << "Unable to query GL_VERSION\n"; } else { - string version((const char *)text); - _gl_version = version; - - string input = version; + string input = _gl_version; // Skip any initial words that don't begin with a digit. while (!input.empty() && !isdigit(input[0])) { @@ -6904,7 +6943,7 @@ query_gl_version() { if (GLCAT.is_debug()) { GLCAT.debug() - << "GL_VERSION = " << version << ", decoded to " + << "GL_VERSION decoded to: " << _gl_version_major << "." << _gl_version_minor << "\n"; } diff --git a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx index e89ce1fdb6..236ab57a77 100644 --- a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx +++ b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx @@ -47,6 +47,8 @@ wglGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, _supports_wgl_multisample = false; _supports_wgl_render_texture = false; + _wglCreateContextAttribsARB = NULL; + get_gamma_table(); atexit(atexit_function); } @@ -345,6 +347,14 @@ choose_pixel_format(const FrameBufferProperties &properties, get_extra_extensions(); _supports_pixel_format = has_extension("WGL_ARB_pixel_format"); _supports_wgl_multisample = has_extension("WGL_ARB_multisample"); + + if (has_extension("WGL_ARB_create_context")) { + _wglCreateContextAttribsARB = + (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB"); + } else { + _wglCreateContextAttribsARB = NULL; + } + _extensions.clear(); if (!_supports_pixel_format) { @@ -614,7 +624,34 @@ make_context(HDC hdc) { // Attempt to create a context. wglGraphicsPipe::_current_valid = false; - _context = wglCreateContext(hdc); + + if (_wglCreateContextAttribsARB != NULL) { + // We have a fancier version of wglCreateContext that allows us + // to specify what kind of OpenGL context we would like. + int attrib_list[32]; + int n = 0; + attrib_list[0] = NULL; + + if (gl_version.get_num_words() > 0) { + attrib_list[n++] = WGL_CONTEXT_MAJOR_VERSION_ARB; + attrib_list[n++] = gl_version[0]; + if (gl_version.get_num_words() > 1) { + attrib_list[n++] = WGL_CONTEXT_MINOR_VERSION_ARB; + attrib_list[n++] = gl_version[1]; + } + } + if (gl_debug) { + attrib_list[n++] = WGL_CONTEXT_FLAGS_ARB; + attrib_list[n++] = WGL_CONTEXT_DEBUG_BIT_ARB; + } + attrib_list[n++] = WGL_CONTEXT_PROFILE_MASK_ARB; + attrib_list[n++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + attrib_list[n] = NULL; + + _context = _wglCreateContextAttribsARB(hdc, 0, attrib_list); + } else { + _context = wglCreateContext(hdc); + } if (_context == NULL) { wgldisplay_cat.error() diff --git a/panda/src/wgldisplay/wglGraphicsStateGuardian.h b/panda/src/wgldisplay/wglGraphicsStateGuardian.h index 4fa70b2a46..b76dac9578 100644 --- a/panda/src/wgldisplay/wglGraphicsStateGuardian.h +++ b/panda/src/wgldisplay/wglGraphicsStateGuardian.h @@ -118,6 +118,8 @@ public: PFNWGLRELEASETEXIMAGEARBPROC _wglReleaseTexImageARB; PFNWGLSETPBUFFERATTRIBARBPROC _wglSetPbufferAttribARB; + PFNWGLCREATECONTEXTATTRIBSARBPROC _wglCreateContextAttribsARB; + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/wgldisplay/wglGraphicsWindow.cxx b/panda/src/wgldisplay/wglGraphicsWindow.cxx index 0ddcdb208a..43a3d5a480 100644 --- a/panda/src/wgldisplay/wglGraphicsWindow.cxx +++ b/panda/src/wgldisplay/wglGraphicsWindow.cxx @@ -304,8 +304,18 @@ open_window() { // Initializes _colormap setup_colormap(pixelformat); + // Make sure we have a context created. + HGLRC context = wglgsg->get_context(_hdc); + if (!context) { + // The context failed to create for some reason. + wgldisplay_cat.error() + << "Closing window because no valid context is available.\n"; + close_window(); + return false; + } + // Initialize the gsg. - wglGraphicsPipe::wgl_make_current(_hdc, wglgsg->get_context(_hdc), &_make_current_pcollector); + wglGraphicsPipe::wgl_make_current(_hdc, context, &_make_current_pcollector); wglgsg->reset_if_new(); wglgsg->report_my_gl_errors(); if (!wglgsg->get_fb_properties().verify_hardware_software From 23441aa5bb7edf3ed170d2c926e6399bece53b8d Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Jul 2015 09:22:57 +0200 Subject: [PATCH 063/203] Fix intel driver issues, particularly with geometry shaders --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 1 + .../glstuff/glGraphicsStateGuardian_src.cxx | 74 ++++++++++++------- panda/src/glstuff/glShaderContext_src.cxx | 18 +++-- 3 files changed, 58 insertions(+), 35 deletions(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 05d8c4b78f..cd40b52384 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1062,6 +1062,7 @@ attach_tex(int layer, int view, Texture *attach, GLenum attachpoint) { #ifndef OPENGLES if (_rb_size_z != 1) { // Bind all of the layers of the texture. + nassertv(glgsg->_glFramebufferTexture != NULL); glgsg->_glFramebufferTexture(GL_FRAMEBUFFER_EXT, attachpoint, gtc->_index, 0); return; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index cb7b0e4da3..db342f423a 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -829,13 +829,22 @@ reset() { _supports_2d_texture_array = false; #ifndef OPENGLES - _supports_2d_texture_array = has_extension("GL_EXT_texture_array"); - if (_supports_2d_texture_array) { + if (is_at_least_gl_version(3, 0)) { + _supports_2d_texture_array = true; + + _glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) + get_extension_func("glFramebufferTextureLayer"); + + } else if (has_extension("GL_EXT_texture_array")) { + _supports_2d_texture_array = true; + _glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) get_extension_func("glFramebufferTextureLayerEXT"); - } else { - // ARB_geometry_shader4 also provides a version. - _glFramebufferTextureLayer = NULL; + } + + if (_supports_2d_texture_array && _glFramebufferTextureLayer == NULL) { + GLCAT.warning() + << "Texture arrays advertised as supported by OpenGL runtime, but could not get pointer to glFramebufferTextureLayer function.\n"; } #endif @@ -1263,20 +1272,40 @@ reset() { #endif // HAVE_CG -#ifdef OPENGLES_2 +#if defined(OPENGLES_1) + _supports_glsl = false; + _supports_geometry_shaders = false; + _supports_tessellation_shaders = false; +#elif defined(OPENGLES) _supports_glsl = true; _supports_geometry_shaders = false; _supports_tessellation_shaders = false; #else - #ifdef OPENGLES_1 - _supports_glsl = false; + _supports_glsl = is_at_least_gl_version(2, 0) || has_extension("GL_ARB_shading_language_100"); + _supports_tessellation_shaders = is_at_least_gl_version(4, 0) || has_extension("GL_ARB_tessellation_shader"); + + if (is_at_least_gl_version(3, 2)) { + _supports_geometry_shaders = true; + _glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREARBPROC) + get_extension_func("glFramebufferTexture"); + + } else if (has_extension("GL_ARB_geometry_shader4")) { + _supports_geometry_shaders = true; + _glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREARBPROC) + get_extension_func("glFramebufferTextureARB"); + _glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) + get_extension_func("glProgramParameteriARB"); + + } else if (has_extension("GL_EXT_geometry_shader4")) { + _supports_geometry_shaders = true; + _glFramebufferTexture = NULL; + _glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) + get_extension_func("glProgramParameteriEXT"); + + } else { _supports_geometry_shaders = false; - _supports_tessellation_shaders = false; - #else - _supports_glsl = is_at_least_gl_version(2, 0) || has_extension("GL_ARB_shading_language_100"); - _supports_geometry_shaders = is_at_least_gl_version(3, 2) || has_extension("GL_ARB_geometry_shader4"); - _supports_tessellation_shaders = is_at_least_gl_version(4, 0) || has_extension("GL_ARB_tessellation_shader"); - #endif + _glFramebufferTexture = NULL; + } #endif _shader_caps._supports_glsl = _supports_glsl; @@ -1378,17 +1407,6 @@ reset() { _glVertexAttribLPointer = NULL; } - if (_supports_geometry_shaders) { - _glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) - get_extension_func("glProgramParameteri"); - _glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREARBPROC) - get_extension_func("glFramebufferTextureARB"); - - if (_glFramebufferTextureLayer == NULL) { - _glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) - get_extension_func("glFramebufferTextureLayerARB"); - } - } if (_supports_tessellation_shaders) { _glPatchParameteri = (PFNGLPATCHPARAMETERIPROC) get_extension_func("glPatchParameteri"); @@ -1533,7 +1551,7 @@ reset() { _glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) get_extension_func("glDrawElementsInstancedARB"); _supports_geometry_instancing = true; - + } else if (has_extension("GL_EXT_draw_instanced")) { _glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) get_extension_func("glDrawArraysInstancedEXT"); @@ -2202,8 +2220,10 @@ reset() { if (is_at_least_gl_version(4, 1) || has_extension("GL_ARB_get_program_binary")) { _glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC) get_extension_func("glGetProgramBinary"); + _glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) + get_extension_func("glProgramParameteri"); - if (_glGetProgramBinary != NULL) { + if (_glGetProgramBinary != NULL && _glProgramParameteri != NULL) { _supports_get_program_binary = true; } } diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index bb58a45572..2a67e0ba21 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -212,10 +212,11 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext if (_glsl_parameter_map.size() == 0) { int seqno = 0, texunitno = 0, imgunitno = 0; string noprefix; - GLint param_count, param_maxlength, param_size; + GLint param_count = 0, param_maxlength = 0, param_size; GLenum param_type; _glgsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_UNIFORMS, ¶m_count); _glgsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_UNIFORM_MAX_LENGTH, ¶m_maxlength); + param_maxlength = max(64, param_maxlength); char* param_name_cstr = (char *)alloca(param_maxlength); for (int i = 0; i < param_count; ++i) { @@ -856,6 +857,7 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext // Now we've processed the uniforms, we'll process the attribs. _glgsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_ATTRIBUTES, ¶m_count); _glgsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, ¶m_maxlength); + param_maxlength = max(64, param_maxlength); param_name_cstr = (char *)alloca(param_maxlength); for (int i = 0; i < param_count; ++i) { @@ -1940,13 +1942,13 @@ glsl_compile_and_link() { if (!_shader->get_text(Shader::ST_geometry).empty()) { valid &= glsl_compile_shader(Shader::ST_geometry); - // Set the vertex output limit to the maximum. - // This is slow, but it is probably reasonable to require - // the user to override this in his shader using layout(). - nassertr(_glgsg->_glProgramParameteri != NULL, false); - GLint max_vertices; - glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, &max_vertices); - _glgsg->_glProgramParameteri(_glsl_program, GL_GEOMETRY_VERTICES_OUT_ARB, max_vertices); + //XXX Actually, it turns out that this is unavailable in the core + // version of geometry shaders. Probably no need to bother with it. + + //nassertr(_glgsg->_glProgramParameteri != NULL, false); + //GLint max_vertices; + //glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, &max_vertices); + //_glgsg->_glProgramParameteri(_glsl_program, GL_GEOMETRY_VERTICES_OUT_ARB, max_vertices); } #endif From 1bb1cc79f4fae129fa1b991349ffa85459324ac4 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Jul 2015 20:13:55 +0200 Subject: [PATCH 064/203] Improve reporting of supported extensions and compressed formats --- .../glstuff/glGraphicsStateGuardian_src.cxx | 190 +++++++++++++----- .../src/glstuff/glGraphicsStateGuardian_src.h | 4 + 2 files changed, 146 insertions(+), 48 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 20bc4c2ae8..601b1a3215 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -2128,61 +2128,22 @@ reset() { GLCAT.debug() << "No specific compressed texture formats are supported.\n"; } else { +#ifndef NDEBUG GLCAT.debug() << "Supported compressed texture formats:\n"; GLint *formats = (GLint *)alloca(num_compressed_formats * sizeof(GLint)); glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats); for (int i = 0; i < num_compressed_formats; ++i) { - switch (formats[i]) { - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - GLCAT.debug(false) << " GL_COMPRESSED_RGB_S3TC_DXT1_EXT\n"; - break; - - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - GLCAT.debug(false) << " GL_COMPRESSED_RGBA_S3TC_DXT1_EXT\n"; - break; -#ifdef OPENGLES - case GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG: - GLCAT.debug(false) << " GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG\n"; - break; - - case GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: - GLCAT.debug(false) << " GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\n"; - break; - - case GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: - GLCAT.debug(false) << " GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG\n"; - break; - - case GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: - GLCAT.debug(false) << " GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\n"; - break; -#endif -#ifndef OPENGLES_1 - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - GLCAT.debug(false) << " GL_COMPRESSED_RGBA_S3TC_DXT3_EXT\n"; - break; - - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - GLCAT.debug(false) << " GL_COMPRESSED_RGBA_S3TC_DXT5_EXT\n"; - break; -#endif -#ifndef OPENGLES - case GL_COMPRESSED_RGB_FXT1_3DFX: - GLCAT.debug(false) << " GL_COMPRESSED_RGB_FXT1_3DFX\n"; - break; - - case GL_COMPRESSED_RGBA_FXT1_3DFX: - GLCAT.debug(false) << " GL_COMPRESSED_RGBA_FXT1_3DFX\n"; - break; -#endif - - default: + const char *format_str = get_compressed_format_string(formats[i]); + if (format_str != NULL) { + GLCAT.debug(false) << " " << format_str << '\n'; + } else { GLCAT.debug(false) << " Unknown compressed format 0x" << hex << formats[i] << dec << "\n"; } } +#endif } } } @@ -7049,11 +7010,25 @@ get_extra_extensions() { void CLP(GraphicsStateGuardian):: report_extensions() const { if (GLCAT.is_debug()) { - GLCAT.debug() - << "GL Extensions:\n"; + ostream &out = GLCAT.debug(); + out << "GL Extensions:\n"; + + size_t maxlen = 0; pset::const_iterator ei; for (ei = _extensions.begin(); ei != _extensions.end(); ++ei) { - GLCAT.debug() << (*ei) << "\n"; + size_t len = (*ei).size(); + out << " " << (*ei); + + // Display a second column. + if (len <= 38) { + if (++ei != _extensions.end()) { + for (int i = len; i < 38; ++i) { + out.put(' '); + } + out << ' ' << (*ei); + } + } + out.put('\n'); } } } @@ -8801,6 +8776,125 @@ get_usage(Geom::UsageHint usage_hint) { return GL_STATIC_DRAW; } +//////////////////////////////////////////////////////////////////// +// Function: GLGraphicsStateGuardian::get_compressed_format_string +// Access: Public, Static +// Description: Returns a string describing an compression format. +//////////////////////////////////////////////////////////////////// +const char *CLP(GraphicsStateGuardian):: +get_compressed_format_string(GLenum format) { + switch (format) { + case 0x83F0: return "GL_COMPRESSED_RGB_S3TC_DXT1_EXT"; + case 0x83F1: return "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT"; + case 0x83F2: return "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"; + case 0x83F3: return "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"; + case 0x86B0: return "GL_COMPRESSED_RGB_FXT1_3DFX"; + case 0x86B1: return "GL_COMPRESSED_RGBA_FXT1_3DFX"; + case 0x8A54: return "GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT"; + case 0x8A55: return "GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT"; + case 0x8A56: return "GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT"; + case 0x8A57: return "GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT"; + case 0x8B90: return "GL_PALETTE4_RGB8_OES"; + case 0x8B91: return "GL_PALETTE4_RGBA8_OES"; + case 0x8B92: return "GL_PALETTE4_R5_G6_B5_OES"; + case 0x8B93: return "GL_PALETTE4_RGBA4_OES"; + case 0x8B94: return "GL_PALETTE4_RGB5_A1_OES"; + case 0x8B95: return "GL_PALETTE8_RGB8_OES"; + case 0x8B96: return "GL_PALETTE8_RGBA8_OES"; + case 0x8B97: return "GL_PALETTE8_R5_G6_B5_OES"; + case 0x8B98: return "GL_PALETTE8_RGBA4_OES"; + case 0x8B99: return "GL_PALETTE8_RGB5_A1_OES"; + case 0x8C00: return "GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG"; + case 0x8C01: return "GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG"; + case 0x8C02: return "GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"; + case 0x8C03: return "GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG"; + case 0x8C48: return "GL_COMPRESSED_SRGB_EXT"; + case 0x8C49: return "GL_COMPRESSED_SRGB_ALPHA_EXT"; + case 0x8C4A: return "GL_COMPRESSED_SLUMINANCE_EXT"; + case 0x8C4B: return "GL_COMPRESSED_SLUMINANCE_ALPHA_EXT"; + case 0x8C4C: return "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT"; + case 0x8C4D: return "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT"; + case 0x8C4E: return "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT"; + case 0x8C4F: return "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT"; + case 0x8C70: return "GL_COMPRESSED_LUMINANCE_LATC1_EXT"; + case 0x8C71: return "GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT"; + case 0x8C72: return "GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT"; + case 0x8C73: return "GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT"; + case 0x8DBB: return "GL_COMPRESSED_RED_RGTC1"; + case 0x8DBC: return "GL_COMPRESSED_SIGNED_RED_RGTC1"; + case 0x8DBD: return "GL_COMPRESSED_RG_RGTC2"; + case 0x8DBE: return "GL_COMPRESSED_SIGNED_RG_RGTC2"; + case 0x8E8C: return "GL_COMPRESSED_RGBA_BPTC_UNORM"; + case 0x8E8D: return "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM"; + case 0x8E8E: return "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT"; + case 0x8E8F: return "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT"; + case 0x9137: return "GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG"; + case 0x9138: return "GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG"; + case 0x9270: return "GL_COMPRESSED_R11_EAC"; + case 0x9271: return "GL_COMPRESSED_SIGNED_R11_EAC"; + case 0x9272: return "GL_COMPRESSED_RG11_EAC"; + case 0x9273: return "GL_COMPRESSED_SIGNED_RG11_EAC"; + case 0x9274: return "GL_COMPRESSED_RGB8_ETC2"; + case 0x9275: return "GL_COMPRESSED_SRGB8_ETC2"; + case 0x9276: return "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"; + case 0x9277: return "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"; + case 0x9278: return "GL_COMPRESSED_RGBA8_ETC2_EAC"; + case 0x9279: return "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"; + case 0x93B0: return "GL_COMPRESSED_RGBA_ASTC_4x4_KHR"; + case 0x93B1: return "GL_COMPRESSED_RGBA_ASTC_5x4_KHR"; + case 0x93B2: return "GL_COMPRESSED_RGBA_ASTC_5x5_KHR"; + case 0x93B3: return "GL_COMPRESSED_RGBA_ASTC_6x5_KHR"; + case 0x93B4: return "GL_COMPRESSED_RGBA_ASTC_6x6_KHR"; + case 0x93B5: return "GL_COMPRESSED_RGBA_ASTC_8x5_KHR"; + case 0x93B6: return "GL_COMPRESSED_RGBA_ASTC_8x6_KHR"; + case 0x93B7: return "GL_COMPRESSED_RGBA_ASTC_8x8_KHR"; + case 0x93B8: return "GL_COMPRESSED_RGBA_ASTC_10x5_KHR"; + case 0x93B9: return "GL_COMPRESSED_RGBA_ASTC_10x6_KHR"; + case 0x93BA: return "GL_COMPRESSED_RGBA_ASTC_10x8_KHR"; + case 0x93BB: return "GL_COMPRESSED_RGBA_ASTC_10x10_KHR"; + case 0x93BC: return "GL_COMPRESSED_RGBA_ASTC_12x10_KHR"; + case 0x93BD: return "GL_COMPRESSED_RGBA_ASTC_12x12_KHR"; + case 0x93C0: return "GL_COMPRESSED_RGBA_ASTC_3x3x3_OES"; + case 0x93C1: return "GL_COMPRESSED_RGBA_ASTC_4x3x3_OES"; + case 0x93C2: return "GL_COMPRESSED_RGBA_ASTC_4x4x3_OES"; + case 0x93C3: return "GL_COMPRESSED_RGBA_ASTC_4x4x4_OES"; + case 0x93C4: return "GL_COMPRESSED_RGBA_ASTC_5x4x4_OES"; + case 0x93C5: return "GL_COMPRESSED_RGBA_ASTC_5x5x4_OES"; + case 0x93C6: return "GL_COMPRESSED_RGBA_ASTC_5x5x5_OES"; + case 0x93C7: return "GL_COMPRESSED_RGBA_ASTC_6x5x5_OES"; + case 0x93C8: return "GL_COMPRESSED_RGBA_ASTC_6x6x5_OES"; + case 0x93C9: return "GL_COMPRESSED_RGBA_ASTC_6x6x6_OES"; + case 0x93D0: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"; + case 0x93D1: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"; + case 0x93D2: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"; + case 0x93D3: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"; + case 0x93D4: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"; + case 0x93D5: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"; + case 0x93D6: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"; + case 0x93D7: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"; + case 0x93D8: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"; + case 0x93D9: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"; + case 0x93DA: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"; + case 0x93DB: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"; + case 0x93DC: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"; + case 0x93DD: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"; + case 0x93E0: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES"; + case 0x93E1: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES"; + case 0x93E2: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES"; + case 0x93E3: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES"; + case 0x93E4: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES"; + case 0x93E5: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES"; + case 0x93E6: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES"; + case 0x93E7: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES"; + case 0x93E8: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES"; + case 0x93E9: return "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES"; + case 0x93F0: return "GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG"; + case 0x93F1: return "GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG"; + default: + return NULL; + } +} + //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_light_color // Access: Public diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 71339e4b23..63c4cb8abd 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -511,6 +511,10 @@ protected: static GLenum get_blend_func(ColorBlendAttrib::Operand operand); static GLenum get_usage(Geom::UsageHint usage_hint); +#ifndef NDEBUG + static const char *get_compressed_format_string(GLenum format); +#endif + void unbind_buffers(); #ifdef SUPPORT_FIXED_FUNCTION void disable_standard_vertex_arrays(); From e515cbdbd1dae5319a667a6b9d538db434316753 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Jul 2015 21:11:43 +0200 Subject: [PATCH 065/203] Reintroduce display mode information in Windows via Win32 API Also clean up the CPUID code in winGraphicsPipe a bit --- panda/src/display/displayInformation.cxx | 59 +- panda/src/display/displayInformation.h | 23 +- panda/src/windisplay/winGraphicsPipe.cxx | 667 ++++++++++------------- 3 files changed, 353 insertions(+), 396 deletions(-) diff --git a/panda/src/display/displayInformation.cxx b/panda/src/display/displayInformation.cxx index 0c3dc53ebe..41eab9d020 100644 --- a/panda/src/display/displayInformation.cxx +++ b/panda/src/display/displayInformation.cxx @@ -15,10 +15,52 @@ #include "graphicsStateGuardian.h" #include "displayInformation.h" +//////////////////////////////////////////////////////////////////// +// Function: DisplayMode::Comparison Operator +// Access: Published +// Description: Returns true if these two DisplayModes are identical. +//////////////////////////////////////////////////////////////////// +bool DisplayMode:: +operator == (const DisplayMode &other) const { + return (width == other.width && height == other.height && + bits_per_pixel == other.bits_per_pixel && + refresh_rate == other.refresh_rate && + fullscreen_only == other.fullscreen_only); +} + +//////////////////////////////////////////////////////////////////// +// Function: DisplayMode::Comparison Operator +// Access: Published +// Description: Returns false if these two DisplayModes are identical. +//////////////////////////////////////////////////////////////////// +bool DisplayMode:: +operator != (const DisplayMode &other) const { + return !operator == (other); +} + +//////////////////////////////////////////////////////////////////// +// Function: DisplayMode::output +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +void DisplayMode:: +output(ostream &out) const { + out << width << 'x' << height; + if (bits_per_pixel > 0) { + out << ' ' << bits_per_pixel << "bpp"; + } + if (refresh_rate > 0) { + out << ' ' << refresh_rate << "Hz"; + } + if (fullscreen_only > 0) { + out << " (fullscreen only)"; + } +} + //////////////////////////////////////////////////////////////////// // Function: DisplayInformation::Destructor // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// DisplayInformation:: ~DisplayInformation() { @@ -181,6 +223,21 @@ get_total_display_modes() { return _total_display_modes; } +//////////////////////////////////////////////////////////////////// +// Function: DisplayInformation::get_display_mode +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +const DisplayMode &DisplayInformation:: +get_display_mode(int display_index) { +#ifndef NDEBUG + static DisplayMode err_mode = {0}; + nassertr(display_index >= 0 && display_index < _total_display_modes, err_mode); +#endif + + return _display_mode_array[display_index]; +} + //////////////////////////////////////////////////////////////////// // Function: DisplayInformation::get_display_mode_width // Access: Published diff --git a/panda/src/display/displayInformation.h b/panda/src/display/displayInformation.h index df158e45f3..32ee8c687e 100644 --- a/panda/src/display/displayInformation.h +++ b/panda/src/display/displayInformation.h @@ -17,29 +17,30 @@ #include "typedef.h" -typedef struct { +struct EXPCL_PANDA_DISPLAY DisplayMode { +PUBLISHED: int width; int height; int bits_per_pixel; int refresh_rate; int fullscreen_only; -} -DisplayMode; + + bool operator == (const DisplayMode &other) const; + bool operator != (const DisplayMode &other) const; + void output(ostream &out) const; +}; //////////////////////////////////////////////////////////////////// // Class : DisplayInformation // Description : This class contains various display information. //////////////////////////////////////////////////////////////////// - class EXPCL_PANDA_DISPLAY DisplayInformation { - PUBLISHED: - enum DetectionState { - DS_unknown, - DS_success, + DS_unknown, + DS_success, - DS_direct_3d_create_error, + DS_direct_3d_create_error, DS_create_window_error, DS_create_device_error, }; @@ -54,6 +55,10 @@ PUBLISHED: int get_window_bits_per_pixel(); int get_total_display_modes(); + const DisplayMode &get_display_mode(int display_index); + MAKE_SEQ(get_display_modes, get_total_display_modes, get_display_mode); + + // Older interface for display modes. int get_display_mode_width(int display_index); int get_display_mode_height(int display_index); int get_display_mode_bits_per_pixel(int display_index); diff --git a/panda/src/windisplay/winGraphicsPipe.cxx b/panda/src/windisplay/winGraphicsPipe.cxx index 1fd25e52e1..3776e8dbc5 100644 --- a/panda/src/windisplay/winGraphicsPipe.cxx +++ b/panda/src/windisplay/winGraphicsPipe.cxx @@ -15,6 +15,7 @@ #include "winGraphicsPipe.h" #include "config_windisplay.h" #include "displaySearchParameters.h" +#include "displayInformation.h" #include "dtool_config.h" #include "pbitops.h" @@ -52,49 +53,47 @@ static GetProcessMemoryInfoType GetProcessMemoryInfoFunction = 0; static GlobalMemoryStatusExType GlobalMemoryStatusExFunction = 0; static CallNtPowerInformationType CallNtPowerInformationFunction = 0; -void get_memory_information (DisplayInformation *display_information) -{ +void get_memory_information (DisplayInformation *display_information) { if (initialize == false) { - psapi_dll = LoadLibrary ("psapi.dll"); + psapi_dll = LoadLibrary("psapi.dll"); if (psapi_dll) { - GetProcessMemoryInfoFunction = (GetProcessMemoryInfoType) GetProcAddress (psapi_dll, "GetProcessMemoryInfo"); + GetProcessMemoryInfoFunction = (GetProcessMemoryInfoType) GetProcAddress(psapi_dll, "GetProcessMemoryInfo"); } - kernel32_dll = LoadLibrary ("kernel32.dll"); + kernel32_dll = LoadLibrary("kernel32.dll"); if (kernel32_dll) { - GlobalMemoryStatusExFunction = (GlobalMemoryStatusExType) GetProcAddress (kernel32_dll, "GlobalMemoryStatusEx"); + GlobalMemoryStatusExFunction = (GlobalMemoryStatusExType) GetProcAddress(kernel32_dll, "GlobalMemoryStatusEx"); } - + initialize = true; } if (GlobalMemoryStatusExFunction) { MEMORYSTATUSEX memory_status; - memory_status.dwLength = sizeof (MEMORYSTATUSEX); - if (GlobalMemoryStatusExFunction (&memory_status)) { - display_information -> _physical_memory = memory_status.ullTotalPhys; - display_information -> _available_physical_memory = memory_status.ullAvailPhys; - display_information -> _page_file_size = memory_status.ullTotalPageFile; - display_information -> _available_page_file_size = memory_status.ullAvailPageFile; - display_information -> _process_virtual_memory = memory_status.ullTotalVirtual; - display_information -> _available_process_virtual_memory = memory_status.ullAvailVirtual; - display_information -> _memory_load = memory_status.dwMemoryLoad; - } - } - else { + memory_status.dwLength = sizeof(MEMORYSTATUSEX); + if (GlobalMemoryStatusExFunction(&memory_status)) { + display_information->_physical_memory = memory_status.ullTotalPhys; + display_information->_available_physical_memory = memory_status.ullAvailPhys; + display_information->_page_file_size = memory_status.ullTotalPageFile; + display_information->_available_page_file_size = memory_status.ullAvailPageFile; + display_information->_process_virtual_memory = memory_status.ullTotalVirtual; + display_information->_available_process_virtual_memory = memory_status.ullAvailVirtual; + display_information->_memory_load = memory_status.dwMemoryLoad; + } + } else { MEMORYSTATUS memory_status; - memory_status.dwLength = sizeof (MEMORYSTATUS); + memory_status.dwLength = sizeof(MEMORYSTATUS); GlobalMemoryStatus (&memory_status); - display_information -> _physical_memory = memory_status.dwTotalPhys; - display_information -> _available_physical_memory = memory_status.dwAvailPhys; - display_information -> _page_file_size = memory_status.dwTotalPageFile; - display_information -> _available_page_file_size = memory_status.dwAvailPageFile; - display_information -> _process_virtual_memory = memory_status.dwTotalVirtual; - display_information -> _available_process_virtual_memory = memory_status.dwAvailVirtual; - display_information -> _memory_load = memory_status.dwMemoryLoad; + display_information->_physical_memory = memory_status.dwTotalPhys; + display_information->_available_physical_memory = memory_status.dwAvailPhys; + display_information->_page_file_size = memory_status.dwTotalPageFile; + display_information->_available_page_file_size = memory_status.dwAvailPageFile; + display_information->_process_virtual_memory = memory_status.dwTotalVirtual; + display_information->_available_process_virtual_memory = memory_status.dwAvailVirtual; + display_information->_memory_load = memory_status.dwMemoryLoad; } if (GetProcessMemoryInfoFunction) { @@ -105,21 +104,20 @@ void get_memory_information (DisplayInformation *display_information) process_id = GetCurrentProcessId(); process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, process_id); if (process) { - if (GetProcessMemoryInfoFunction (process, &process_memory_counters, sizeof (PROCESS_MEMORY_COUNTERS))) { - display_information -> _page_fault_count = process_memory_counters.PageFaultCount; - display_information -> _process_memory = process_memory_counters.WorkingSetSize; - display_information -> _peak_process_memory = process_memory_counters.PeakWorkingSetSize; - display_information -> _page_file_usage = process_memory_counters.PagefileUsage; - display_information -> _peak_page_file_usage = process_memory_counters.PeakPagefileUsage; + if (GetProcessMemoryInfoFunction (process, &process_memory_counters, sizeof(PROCESS_MEMORY_COUNTERS))) { + display_information->_page_fault_count = process_memory_counters.PageFaultCount; + display_information->_process_memory = process_memory_counters.WorkingSetSize; + display_information->_peak_process_memory = process_memory_counters.PeakWorkingSetSize; + display_information->_page_file_usage = process_memory_counters.PagefileUsage; + display_information->_peak_page_file_usage = process_memory_counters.PeakPagefileUsage; } CloseHandle(process); } - } + } } -typedef union -{ +typedef union { PN_uint64 long_integer; } LONG_INTEGER; @@ -130,11 +128,10 @@ PN_uint64 cpu_time_function (void) { #else LONG_INTEGER long_integer; LONG_INTEGER *long_integer_pointer; - + long_integer_pointer = &long_integer; - - __asm - { + + __asm { mov ebx,[long_integer_pointer] rdtsc mov [ebx + 0], eax @@ -145,14 +142,10 @@ PN_uint64 cpu_time_function (void) { #endif } -typedef union -{ - struct - { - union - { - struct - { +typedef union { + struct { + union { + struct { unsigned char al; unsigned char ah; }; @@ -162,15 +155,11 @@ typedef union unsigned int ecx; unsigned int edx; }; -} -CPU_ID_REGISTERS; +} CPU_ID_REGISTERS; -typedef struct -{ - union - { - struct - { +typedef struct { + union { + struct { int maximum_cpu_id_input; char cpu_vendor [16]; }; @@ -178,19 +167,15 @@ typedef struct CPU_ID_REGISTERS cpu_id_registers_0; }; - union - { + union { CPU_ID_REGISTERS cpu_id_registers_1; - struct - { + struct { // eax - union - { + union { unsigned int eax; unsigned int version_information; - struct - { + struct { unsigned int stepping_id : 4; unsigned int model : 4; unsigned int family : 4; @@ -203,11 +188,9 @@ typedef struct }; // ebx - union - { + union { unsigned int ebx; - struct - { + struct { unsigned int brand_index : 8; unsigned int clflush : 8; unsigned int maximum_logical_processors : 8; @@ -216,11 +199,9 @@ typedef struct }; // ecx - union - { + union { unsigned int ecx; - struct - { + struct { unsigned int sse3 : 1; unsigned int reserved_1_to_2 : 2; unsigned int monitor : 1; @@ -239,11 +220,9 @@ typedef struct }; // edx - union - { + union { unsigned int edx; - struct - { + struct { unsigned int fpu : 1; unsigned int vme : 1; unsigned int de : 1; @@ -282,71 +261,47 @@ typedef struct }; #define MAXIMUM_2 8 - #define MAXIMUM_CHARACTERS (MAXIMUM_2 * sizeof (CPU_ID_REGISTERS)) + #define MAXIMUM_CHARACTERS (MAXIMUM_2 * sizeof(CPU_ID_REGISTERS)) - union - { + union { CPU_ID_REGISTERS cpu_id_registers_2; unsigned char character_array_2 [MAXIMUM_CHARACTERS]; CPU_ID_REGISTERS cpu_id_registers_2_array [MAXIMUM_2]; }; - union - { + union { CPU_ID_REGISTERS cpu_id_registers_0x80000000; }; - union - { + union { CPU_ID_REGISTERS cpu_id_registers_0x80000001; }; - union - { - char cpu_brand_string [sizeof (CPU_ID_REGISTERS) * 3]; - struct - { + union { + char cpu_brand_string [sizeof(CPU_ID_REGISTERS) * 3]; + struct { CPU_ID_REGISTERS cpu_id_registers_0x80000002; CPU_ID_REGISTERS cpu_id_registers_0x80000003; CPU_ID_REGISTERS cpu_id_registers_0x80000004; }; }; - union - { - struct - { - // eax - union - { - unsigned int eax; - }; - - // ebx - union - { - unsigned int ebx; - }; - - // ecx - union - { + union { + struct { + unsigned int eax; + unsigned int ebx; + union { unsigned int ecx; - struct - { + struct { unsigned int l1_data_cache_line_size : 8; unsigned int l1_data_reserved_8_to_15 : 8; unsigned int l1_data_associativity : 8; unsigned int l1_data_cache_size : 8; }; }; - - // edx - union - { + union { unsigned int edx; - struct - { + struct { unsigned int l1_code_cache_line_size : 8; unsigned int l1_code_reserved_8_to_15 : 8; unsigned int l1_code_associativity : 8; @@ -357,82 +312,31 @@ typedef struct CPU_ID_REGISTERS cpu_id_registers_0x80000005; }; - union - { - struct - { - // eax - union - { - unsigned int eax; - }; - - // ebx - union - { - unsigned int ebx; - }; - - // ecx - union - { + union { + struct { + unsigned int eax; + unsigned int ebx; + union { unsigned int ecx; - struct - { + struct { unsigned int l2_cache_line_size : 8; unsigned int l2_reserved_8_to_11 : 4; unsigned int l2_associativity : 4; unsigned int l2_cache_size : 16; }; }; - - // edx - union - { - unsigned int edx; - }; + unsigned int edx; }; CPU_ID_REGISTERS cpu_id_registers_0x80000006; }; - union - { - struct - { - // eax - union - { - unsigned int eax; - }; + CPU_ID_REGISTERS cpu_id_registers_0x80000008; - // ebx - union - { - unsigned int ebx; - }; - - // ecx - union - { - unsigned int ecx; - }; - - // edx - union - { - unsigned int edx; - }; - }; - CPU_ID_REGISTERS cpu_id_registers_0x80000008; - }; - unsigned int cache_line_size; unsigned int log_base_2_cache_line_size; -} -CPU_ID; +} CPU_ID; -typedef struct -{ +typedef struct { CPU_ID_REGISTERS cpu_id_registers_0; CPU_ID_REGISTERS cpu_id_registers_1; @@ -445,63 +349,48 @@ typedef struct CPU_ID_REGISTERS cpu_id_registers_0x80000006; CPU_ID_REGISTERS cpu_id_registers_0x80000008; -} -CPU_ID_BINARY_DATA; - -typedef struct -{ - union - { - CPU_ID_BINARY_DATA cpu_binary_data; - unsigned int data_array [sizeof (CPU_ID_BINARY_DATA) / 4]; - }; -} -CPU_ID_BINARY_DATA_ARRAY; +} CPU_ID_BINARY_DATA; void cpu_id_to_cpu_id_binary_data (CPU_ID *cpu_id, CPU_ID_BINARY_DATA *cpu_id_binary_data) { - - cpu_id_binary_data -> cpu_id_registers_0 = cpu_id -> cpu_id_registers_0; - cpu_id_binary_data -> cpu_id_registers_1 = cpu_id -> cpu_id_registers_1; - cpu_id_binary_data -> cpu_id_registers_0x80000000 = cpu_id -> cpu_id_registers_0x80000000; - cpu_id_binary_data -> cpu_id_registers_0x80000001 = cpu_id -> cpu_id_registers_0x80000001; - cpu_id_binary_data -> cpu_id_registers_0x80000002 = cpu_id -> cpu_id_registers_0x80000002; - cpu_id_binary_data -> cpu_id_registers_0x80000003 = cpu_id -> cpu_id_registers_0x80000003; - cpu_id_binary_data -> cpu_id_registers_0x80000004 = cpu_id -> cpu_id_registers_0x80000004; - cpu_id_binary_data -> cpu_id_registers_0x80000006 = cpu_id -> cpu_id_registers_0x80000006; - cpu_id_binary_data -> cpu_id_registers_0x80000008 = cpu_id -> cpu_id_registers_0x80000008; + cpu_id_binary_data->cpu_id_registers_0 = cpu_id->cpu_id_registers_0; + cpu_id_binary_data->cpu_id_registers_1 = cpu_id->cpu_id_registers_1; + cpu_id_binary_data->cpu_id_registers_0x80000000 = cpu_id->cpu_id_registers_0x80000000; + cpu_id_binary_data->cpu_id_registers_0x80000001 = cpu_id->cpu_id_registers_0x80000001; + cpu_id_binary_data->cpu_id_registers_0x80000002 = cpu_id->cpu_id_registers_0x80000002; + cpu_id_binary_data->cpu_id_registers_0x80000003 = cpu_id->cpu_id_registers_0x80000003; + cpu_id_binary_data->cpu_id_registers_0x80000004 = cpu_id->cpu_id_registers_0x80000004; + cpu_id_binary_data->cpu_id_registers_0x80000006 = cpu_id->cpu_id_registers_0x80000006; + cpu_id_binary_data->cpu_id_registers_0x80000008 = cpu_id->cpu_id_registers_0x80000008; } void cpu_id_binary_data_to_cpu_id (CPU_ID_BINARY_DATA *cpu_id_binary_data, CPU_ID *cpu_id) { + memset (cpu_id, 0, sizeof(CPU_ID)); - memset (cpu_id, 0, sizeof (CPU_ID)); - - cpu_id -> cpu_id_registers_0 = cpu_id_binary_data -> cpu_id_registers_0; - cpu_id -> cpu_id_registers_1 = cpu_id_binary_data -> cpu_id_registers_1; - cpu_id -> cpu_id_registers_0x80000000 = cpu_id_binary_data -> cpu_id_registers_0x80000000; - cpu_id -> cpu_id_registers_0x80000001 = cpu_id_binary_data -> cpu_id_registers_0x80000001; - cpu_id -> cpu_id_registers_0x80000002 = cpu_id_binary_data -> cpu_id_registers_0x80000002; - cpu_id -> cpu_id_registers_0x80000003 = cpu_id_binary_data -> cpu_id_registers_0x80000003; - cpu_id -> cpu_id_registers_0x80000004 = cpu_id_binary_data -> cpu_id_registers_0x80000004; - cpu_id -> cpu_id_registers_0x80000006 = cpu_id_binary_data -> cpu_id_registers_0x80000006; - cpu_id -> cpu_id_registers_0x80000008 = cpu_id_binary_data -> cpu_id_registers_0x80000008; + cpu_id->cpu_id_registers_0 = cpu_id_binary_data->cpu_id_registers_0; + cpu_id->cpu_id_registers_1 = cpu_id_binary_data->cpu_id_registers_1; + cpu_id->cpu_id_registers_0x80000000 = cpu_id_binary_data->cpu_id_registers_0x80000000; + cpu_id->cpu_id_registers_0x80000001 = cpu_id_binary_data->cpu_id_registers_0x80000001; + cpu_id->cpu_id_registers_0x80000002 = cpu_id_binary_data->cpu_id_registers_0x80000002; + cpu_id->cpu_id_registers_0x80000003 = cpu_id_binary_data->cpu_id_registers_0x80000003; + cpu_id->cpu_id_registers_0x80000004 = cpu_id_binary_data->cpu_id_registers_0x80000004; + cpu_id->cpu_id_registers_0x80000006 = cpu_id_binary_data->cpu_id_registers_0x80000006; + cpu_id->cpu_id_registers_0x80000008 = cpu_id_binary_data->cpu_id_registers_0x80000008; } -int cpuid (int input_eax, CPU_ID_REGISTERS *cpu_id_registers) { +int cpuid(int input_eax, CPU_ID_REGISTERS *cpu_id_registers) { int state; - state = false; - __try - { + state = false; + __try { if (input_eax == 0) { // the order of ecx and edx is swapped when saved to make a proper vendor string #ifdef _WIN64 - __cpuid((int*)cpu_id_registers, input_eax); - unsigned int tmp = cpu_id_registers->edx; - cpu_id_registers->edx = cpu_id_registers->ecx; - cpu_id_registers->ecx = tmp; + __cpuid((int*)cpu_id_registers, input_eax); + unsigned int tmp = cpu_id_registers->edx; + cpu_id_registers->edx = cpu_id_registers->ecx; + cpu_id_registers->ecx = tmp; #else - __asm - { + __asm { mov eax, [input_eax] mov edi, [cpu_id_registers] @@ -513,13 +402,11 @@ int cpuid (int input_eax, CPU_ID_REGISTERS *cpu_id_registers) { mov [edi + 12], ecx } #endif - } - else { + } else { #ifdef _WIN64 - __cpuid((int*)cpu_id_registers, input_eax); + __cpuid((int*)cpu_id_registers, input_eax); #else - __asm - { + __asm { mov eax, [input_eax] mov edi, [cpu_id_registers] @@ -535,153 +422,144 @@ int cpuid (int input_eax, CPU_ID_REGISTERS *cpu_id_registers) { state = true; } - __except (1) - { + __except (1) { state = false; } return state; } -void parse_cpu_id (CPU_ID *cpu_id) { +void parse_cpu_id(CPU_ID *cpu_id) { + printf("CPUID\n"); + printf(" vendor = %s\n", cpu_id->cpu_vendor); + printf(" brand string %s\n", cpu_id->cpu_brand_string); + printf(" maximum_cpu_id_input = %u\n", cpu_id->maximum_cpu_id_input); + printf(" maximum extended information = 0x%X\n", cpu_id->cpu_id_registers_0x80000000.eax); - printf ("CPUID\n"); - printf (" vendor = %s \n", cpu_id -> cpu_vendor); - printf (" brand string %s \n", cpu_id -> cpu_brand_string); - printf (" maximum_cpu_id_input = %u \n", cpu_id -> maximum_cpu_id_input); - printf (" maximum extended information = 0x%X \n", cpu_id -> cpu_id_registers_0x80000000.eax); + printf(" MMX = %u\n", cpu_id->mmx); + printf(" SSE = %u\n", cpu_id->sse); + printf(" SSE2 = %u\n", cpu_id->sse2); + printf(" SSE3 = %u\n", cpu_id->sse3); - printf (" MMX = %u \n", cpu_id -> mmx); - printf (" SSE = %u \n", cpu_id -> sse); - printf (" SSE2 = %u \n", cpu_id -> sse2); - printf (" SSE3 = %u \n", cpu_id -> sse3); + printf(" EST = %u\n", cpu_id->est); - printf (" EST = %u \n", cpu_id -> est); + if (cpu_id->maximum_cpu_id_input >= 1) { + printf(" version_information\n"); + printf(" stepping_id %u\n", cpu_id->stepping_id); + printf(" model %u\n", cpu_id->model); + printf(" family %u\n", cpu_id->family); + printf(" processor_type %u\n", cpu_id->processor_type); + printf(" extended_model_id %u\n", cpu_id->extended_model_id); + printf(" extended_family_id %u\n", cpu_id->extended_family_id); - if (cpu_id -> maximum_cpu_id_input >= 1) { - printf (" version_information \n"); - printf (" stepping_id %u \n", cpu_id -> stepping_id); - printf (" model %u \n", cpu_id -> model); - printf (" family %u \n", cpu_id -> family); - printf (" processor_type %u \n", cpu_id -> processor_type); - printf (" extended_model_id %u \n", cpu_id -> extended_model_id); - printf (" extended_family_id %u \n", cpu_id -> extended_family_id); + printf(" brand_index %u\n", cpu_id->brand_index); + printf(" clflush %u\n", cpu_id->clflush); + printf(" maximum_logical_processors %u\n", cpu_id->maximum_logical_processors); + printf(" initial_apic_id %u\n", cpu_id->initial_apic_id); - printf (" brand_index %u \n", cpu_id -> brand_index); - printf (" clflush %u \n", cpu_id -> clflush); - printf (" maximum_logical_processors %u \n", cpu_id -> maximum_logical_processors); - printf (" initial_apic_id %u \n", cpu_id -> initial_apic_id); - -// printf (" cache_line_size %u \n", cpu_id -> cache_line_size); -// printf (" log_base_2_cache_line_size %u \n", cpu_id -> log_base_2_cache_line_size); +// printf(" cache_line_size %u\n", cpu_id->cache_line_size); +// printf(" log_base_2_cache_line_size %u\n", cpu_id->log_base_2_cache_line_size); } - if (cpu_id -> cpu_id_registers_0x80000000.eax >= 0x80000005) { - printf (" l1_data_cache_line_size %d \n", cpu_id -> l1_data_cache_line_size); - printf (" l1_data_associativity %d \n", cpu_id -> l1_data_associativity); - printf (" l1_data_cache_size %dK \n", cpu_id -> l1_data_cache_size); + if (cpu_id->cpu_id_registers_0x80000000.eax >= 0x80000005) { + printf(" l1_data_cache_line_size %d\n", cpu_id->l1_data_cache_line_size); + printf(" l1_data_associativity %d\n", cpu_id->l1_data_associativity); + printf(" l1_data_cache_size %dK\n", cpu_id->l1_data_cache_size); - printf (" l1_code_cache_line_size %d \n", cpu_id -> l1_code_cache_line_size); - printf (" l1_code_associativity %d \n", cpu_id -> l1_code_associativity); - printf (" l1_code_cache_size %dK \n", cpu_id -> l1_code_cache_size); + printf(" l1_code_cache_line_size %d\n", cpu_id->l1_code_cache_line_size); + printf(" l1_code_associativity %d\n", cpu_id->l1_code_associativity); + printf(" l1_code_cache_size %dK\n", cpu_id->l1_code_cache_size); } - if (cpu_id -> cpu_id_registers_0x80000000.eax >= 0x80000006) { - printf (" l2_cache_line_size %d \n", cpu_id -> l2_cache_line_size); - printf (" l2_associativity %d \n", cpu_id -> l2_associativity); - printf (" l2_cache_size %dK \n", cpu_id -> l2_cache_size); + if (cpu_id->cpu_id_registers_0x80000000.eax >= 0x80000006) { + printf(" l2_cache_line_size %d\n", cpu_id->l2_cache_line_size); + printf(" l2_associativity %d\n", cpu_id->l2_associativity); + printf(" l2_cache_size %dK\n", cpu_id->l2_cache_size); } } -int initialize_cpu_id (CPU_ID *cpu_id) { +int initialize_cpu_id(CPU_ID *cpu_id) { + int debug = false; + memset(cpu_id, 0, sizeof(CPU_ID)); - int state; - int debug; - - state = false; - debug = false; - memset (cpu_id, 0, sizeof (CPU_ID)); - - if (cpuid (0, &cpu_id -> cpu_id_registers_0)) { - if (cpu_id -> maximum_cpu_id_input >= 1) { - cpuid (1, &cpu_id -> cpu_id_registers_1); + if (cpuid(0, &cpu_id->cpu_id_registers_0)) { + if (cpu_id->maximum_cpu_id_input >= 1) { + cpuid(1, &cpu_id->cpu_id_registers_1); } - if (cpu_id -> maximum_cpu_id_input >= 2) { + if (cpu_id->maximum_cpu_id_input >= 2) { unsigned int index; - cpuid (2, &cpu_id -> cpu_id_registers_2); + cpuid(2, &cpu_id->cpu_id_registers_2); if (debug) { - printf (" al = %u \n", cpu_id -> cpu_id_registers_2.al); + printf(" al = %u\n", cpu_id->cpu_id_registers_2.al); } - - for (index = 1; index < cpu_id -> cpu_id_registers_2.al && index < MAXIMUM_2; index++) { - cpuid (2, &cpu_id -> cpu_id_registers_2_array [index]); + + for (index = 1; index < cpu_id->cpu_id_registers_2.al && index < MAXIMUM_2; index++) { + cpuid(2, &cpu_id->cpu_id_registers_2_array [index]); } for (index = 1; index < MAXIMUM_CHARACTERS; index++) { - if (cpu_id -> character_array_2 [index]) { + if (cpu_id->character_array_2 [index]) { if (debug) { - printf (" cache/TLB byte = %X \n", cpu_id -> character_array_2 [index]); + printf(" cache/TLB byte = %X\n", cpu_id->character_array_2 [index]); } - switch (cpu_id -> character_array_2 [index]) - { - case 0x0A: - case 0x0C: - cpu_id -> cache_line_size = 32; - cpu_id -> log_base_2_cache_line_size = 5; - break; + switch (cpu_id->character_array_2 [index]) { + case 0x0A: + case 0x0C: + cpu_id->cache_line_size = 32; + cpu_id->log_base_2_cache_line_size = 5; + break; - case 0x2C: - case 0x60: - case 0x66: - case 0x67: - case 0x68: - cpu_id -> cache_line_size = 64; - cpu_id -> log_base_2_cache_line_size = 6; - break; + case 0x2C: + case 0x60: + case 0x66: + case 0x67: + case 0x68: + cpu_id->cache_line_size = 64; + cpu_id->log_base_2_cache_line_size = 6; + break; } } } } - cpuid (0x80000000, &cpu_id -> cpu_id_registers_0x80000000); + cpuid(0x80000000, &cpu_id->cpu_id_registers_0x80000000); - if (cpu_id -> cpu_id_registers_0x80000000.eax >= 0x80000001) { - cpuid (0x80000001, &cpu_id -> cpu_id_registers_0x80000001); - } - - if (cpu_id -> cpu_id_registers_0x80000000.eax >= 0x80000004) { - cpuid (0x80000002, &cpu_id -> cpu_id_registers_0x80000002); - cpuid (0x80000003, &cpu_id -> cpu_id_registers_0x80000003); - cpuid (0x80000004, &cpu_id -> cpu_id_registers_0x80000004); + if (cpu_id->cpu_id_registers_0x80000000.eax >= 0x80000001) { + cpuid(0x80000001, &cpu_id->cpu_id_registers_0x80000001); } - if (cpu_id -> cpu_id_registers_0x80000000.eax >= 0x80000005) { - cpuid (0x80000005, &cpu_id -> cpu_id_registers_0x80000005); + if (cpu_id->cpu_id_registers_0x80000000.eax >= 0x80000004) { + cpuid(0x80000002, &cpu_id->cpu_id_registers_0x80000002); + cpuid(0x80000003, &cpu_id->cpu_id_registers_0x80000003); + cpuid(0x80000004, &cpu_id->cpu_id_registers_0x80000004); } - if (cpu_id -> cpu_id_registers_0x80000000.eax >= 0x80000006) { - cpuid (0x80000006, &cpu_id -> cpu_id_registers_0x80000006); + if (cpu_id->cpu_id_registers_0x80000000.eax >= 0x80000005) { + cpuid(0x80000005, &cpu_id->cpu_id_registers_0x80000005); } - if (cpu_id -> cpu_id_registers_0x80000000.eax >= 0x80000008) { - cpuid (0x80000008, &cpu_id -> cpu_id_registers_0x80000008); - } + if (cpu_id->cpu_id_registers_0x80000000.eax >= 0x80000006) { + cpuid(0x80000006, &cpu_id->cpu_id_registers_0x80000006); + } - state = true; + if (cpu_id->cpu_id_registers_0x80000000.eax >= 0x80000008) { + cpuid(0x80000008, &cpu_id->cpu_id_registers_0x80000008); + } + + return true; } - - return state; + + return false; } -int update_cpu_frequency_function (int processor_number, DisplayInformation *display_information) -{ +int update_cpu_frequency_function(int processor_number, DisplayInformation *display_information) { int update; - + update = false; - display_information -> _maximum_cpu_frequency = 0; - display_information -> _current_cpu_frequency = 0; - + display_information->_maximum_cpu_frequency = 0; + display_information->_current_cpu_frequency = 0; + if (CallNtPowerInformationFunction) { int i; @@ -692,38 +570,38 @@ int update_cpu_frequency_function (int processor_number, DisplayInformation *dis POWER_INFORMATION_LEVEL information_level; PROCESSOR_POWER_INFORMATION *processor_power_information; PROCESSOR_POWER_INFORMATION processor_power_information_array [MAXIMUM_PROCESSORS]; - - memset (processor_power_information_array, 0, sizeof (PROCESSOR_POWER_INFORMATION) * MAXIMUM_PROCESSORS); + + memset(processor_power_information_array, 0, sizeof(PROCESSOR_POWER_INFORMATION) * MAXIMUM_PROCESSORS); processor_power_information = processor_power_information_array; for (i = 0; i < MAXIMUM_PROCESSORS; i++) { - processor_power_information -> Number = 0xFFFFFFFF; + processor_power_information->Number = 0xFFFFFFFF; processor_power_information++; } - + information_level = ProcessorInformation; input_buffer = NULL; output_buffer = processor_power_information_array; input_buffer_size = 0; - output_buffer_size = sizeof (PROCESSOR_POWER_INFORMATION) * MAXIMUM_PROCESSORS; - if (CallNtPowerInformationFunction (information_level, input_buffer, input_buffer_size, output_buffer, output_buffer_size) == 0) { + output_buffer_size = sizeof(PROCESSOR_POWER_INFORMATION) * MAXIMUM_PROCESSORS; + if (CallNtPowerInformationFunction(information_level, input_buffer, input_buffer_size, output_buffer, output_buffer_size) == 0) { processor_power_information = processor_power_information_array; for (i = 0; i < MAXIMUM_PROCESSORS; i++) { - if (processor_power_information -> Number == processor_number) { + if (processor_power_information->Number == processor_number) { PN_uint64 value; - value = processor_power_information -> MaxMhz; - display_information -> _maximum_cpu_frequency = value * 1000000; + value = processor_power_information->MaxMhz; + display_information->_maximum_cpu_frequency = value * 1000000; - value = processor_power_information -> CurrentMhz; - display_information -> _current_cpu_frequency = value * 1000000; + value = processor_power_information->CurrentMhz; + display_information->_current_cpu_frequency = value * 1000000; update = true; break; } processor_power_information++; - } + } } } @@ -736,7 +614,7 @@ count_number_of_cpus(DisplayInformation *display_information) { int num_logical_cpus = 0; // Get a pointer to the GetLogicalProcessorInformation function. - typedef BOOL (WINAPI *LPFN_GLPI)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, + typedef BOOL (WINAPI *LPFN_GLPI)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD); LPFN_GLPI glpi; glpi = (LPFN_GLPI)GetProcAddress(GetModuleHandle(TEXT("kernel32")), @@ -801,11 +679,8 @@ count_number_of_cpus(DisplayInformation *display_information) { //////////////////////////////////////////////////////////////////// WinGraphicsPipe:: WinGraphicsPipe() { - - bool state; char string [512]; - state = false; _supported_types = OT_window | OT_fullscreen_window; // these fns arent defined on win95, so get dynamic ptrs to them @@ -819,15 +694,38 @@ WinGraphicsPipe() { } #ifdef HAVE_DX9 - if (request_dxdisplay_information){ + // Use D3D to get display info. This is disabled by default as it is slow. + if (request_dxdisplay_information) { DisplaySearchParameters display_search_parameters_dx9; int dx9_display_information (DisplaySearchParameters &display_search_parameters_dx9, DisplayInformation *display_information); + dx9_display_information(display_search_parameters_dx9, _display_information); + } else +#endif + { + // Use the Win32 API to query the available display modes. + pvector display_modes; + DEVMODE dm = {0}; + dm.dmSize = sizeof(dm); + for (int i = 0; EnumDisplaySettings(NULL, i, &dm) != 0; ++i) { + DisplayMode mode; + mode.width = dm.dmPelsWidth; + mode.height = dm.dmPelsHeight; + mode.bits_per_pixel = dm.dmBitsPerPel; + mode.refresh_rate = dm.dmDisplayFrequency; + mode.fullscreen_only = 0; + if (i == 0 || mode != display_modes.back()) { + display_modes.push_back(mode); + } + } - if (state == false && dx9_display_information (display_search_parameters_dx9, _display_information)) { - state = true; + // Copy this information to the DisplayInformation object. + _display_information->_total_display_modes = display_modes.size(); + if (!display_modes.empty()) { + _display_information->_display_mode_array = new DisplayMode[display_modes.size()]; + std::copy(display_modes.begin(), display_modes.end(), + _display_information->_display_mode_array); } } -#endif if (auto_cpu_data) { lookup_cpu_data(); @@ -836,15 +734,17 @@ WinGraphicsPipe() { OSVERSIONINFO version_info; version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (GetVersionEx (&version_info)) { - sprintf (string, "OS version: %d.%d.%d.%d \n", version_info.dwMajorVersion, version_info.dwMinorVersion, version_info.dwPlatformId, version_info.dwBuildNumber); - windisplay_cat.info() << string; - windisplay_cat.info() << " " << version_info.szCSDVersion << "\n"; + if (GetVersionEx(&version_info)) { + if (windisplay_cat.is_info()) { + sprintf(string, "OS version: %d.%d.%d.%d\n", version_info.dwMajorVersion, version_info.dwMinorVersion, version_info.dwPlatformId, version_info.dwBuildNumber); + windisplay_cat.info() << string; + windisplay_cat.info() << " " << version_info.szCSDVersion << "\n"; + } - _display_information -> _os_version_major = version_info.dwMajorVersion; - _display_information -> _os_version_minor = version_info.dwMinorVersion; - _display_information -> _os_version_build = version_info.dwBuildNumber; - _display_information -> _os_platform_id = version_info.dwPlatformId; + _display_information->_os_version_major = version_info.dwMajorVersion; + _display_information->_os_version_minor = version_info.dwMinorVersion; + _display_information->_os_version_build = version_info.dwBuildNumber; + _display_information->_os_platform_id = version_info.dwPlatformId; } // Screen size _display_width = GetSystemMetrics(SM_CXSCREEN); @@ -852,23 +752,19 @@ WinGraphicsPipe() { HMODULE power_dll; - power_dll = LoadLibrary ("PowrProf.dll"); + power_dll = LoadLibrary("PowrProf.dll"); if (power_dll) { - CallNtPowerInformationFunction = (CallNtPowerInformationType) GetProcAddress (power_dll, "CallNtPowerInformation"); + CallNtPowerInformationFunction = (CallNtPowerInformationType) GetProcAddress(power_dll, "CallNtPowerInformation"); if (CallNtPowerInformationFunction) { - _display_information -> _update_cpu_frequency_function = update_cpu_frequency_function; + _display_information->_update_cpu_frequency_function = update_cpu_frequency_function; update_cpu_frequency_function(0, _display_information); - sprintf (string, "max Mhz %I64d, current Mhz %I64d \n", _display_information -> _maximum_cpu_frequency, _display_information -> _current_cpu_frequency); + sprintf(string, "max Mhz %I64d, current Mhz %I64d\n", _display_information->_maximum_cpu_frequency, _display_information->_current_cpu_frequency); windisplay_cat.info() << string; } } - - if (state) { - - } } //////////////////////////////////////////////////////////////////// @@ -883,10 +779,10 @@ lookup_cpu_data() { char string [512]; // set callback for memory function - _display_information -> _get_memory_information_function = get_memory_information; + _display_information->_get_memory_information_function = get_memory_information; // set callback for cpu time function - _display_information -> _cpu_time_function = cpu_time_function; + _display_information->_cpu_time_function = cpu_time_function; // determine CPU frequency PN_uint64 time; @@ -900,7 +796,7 @@ lookup_cpu_data() { counter.QuadPart = 0; end.QuadPart = 0; frequency.QuadPart = 0; - + int priority; HANDLE thread; @@ -908,8 +804,8 @@ lookup_cpu_data() { thread = GetCurrentThread(); priority = GetThreadPriority (thread); SetThreadPriority(thread, THREAD_PRIORITY_TIME_CRITICAL); - - if (QueryPerformanceFrequency(&frequency)) { + + if (QueryPerformanceFrequency(&frequency)) { if (frequency.QuadPart > 0) { if (QueryPerformanceCounter (&counter)) { time = cpu_time_function(); @@ -919,15 +815,15 @@ lookup_cpu_data() { } end_time = cpu_time_function(); - _display_information -> _cpu_frequency = end_time - time; + _display_information->_cpu_frequency = end_time - time; } } } SetThreadPriority(thread, priority); - sprintf (string, "QueryPerformanceFrequency: %I64d\n", frequency.QuadPart); + sprintf(string, "QueryPerformanceFrequency: %I64d\n", frequency.QuadPart); windisplay_cat.info() << string; - sprintf (string, "CPU frequency: %I64d\n", _display_information -> _cpu_frequency); + sprintf(string, "CPU frequency: %I64d\n", _display_information->_cpu_frequency); windisplay_cat.info() << string; @@ -935,34 +831,33 @@ lookup_cpu_data() { CPU_ID cpu_id; windisplay_cat.info() << "start CPU ID\n"; - - if (initialize_cpu_id (&cpu_id)) { - CPU_ID_BINARY_DATA *cpu_id_binary_data; - - cpu_id_binary_data = new (CPU_ID_BINARY_DATA); - if (cpu_id_binary_data) { - cpu_id_to_cpu_id_binary_data (&cpu_id, cpu_id_binary_data); - _display_information -> _cpu_id_size = sizeof (CPU_ID_BINARY_DATA) / sizeof (unsigned int); - _display_information -> _cpu_id_data = (unsigned int *) cpu_id_binary_data; - _display_information -> _cpu_vendor_string = strdup(cpu_id.cpu_vendor); - _display_information -> _cpu_brand_string = strdup(cpu_id.cpu_brand_string); - _display_information -> _cpu_version_information = cpu_id.version_information; - _display_information -> _cpu_brand_index = cpu_id.brand_index; + if (initialize_cpu_id(&cpu_id)) { + CPU_ID_BINARY_DATA *cpu_id_binary_data; + + cpu_id_binary_data = new (CPU_ID_BINARY_DATA); + if (cpu_id_binary_data) { + cpu_id_to_cpu_id_binary_data(&cpu_id, cpu_id_binary_data); + _display_information->_cpu_id_size = sizeof(CPU_ID_BINARY_DATA) / sizeof(unsigned int); + _display_information->_cpu_id_data = (unsigned int *) cpu_id_binary_data; + + _display_information->_cpu_vendor_string = strdup(cpu_id.cpu_vendor); + _display_information->_cpu_brand_string = strdup(cpu_id.cpu_brand_string); + _display_information->_cpu_version_information = cpu_id.version_information; + _display_information->_cpu_brand_index = cpu_id.brand_index; if (windisplay_cat.is_debug()) { windisplay_cat.debug() - << hex << _display_information -> _cpu_id_version << dec << "|"; + << hex << _display_information->_cpu_id_version << dec << "|"; int index; - for (index = 0; index < _display_information -> _cpu_id_size; index++) { + for (index = 0; index < _display_information->_cpu_id_size; ++index) { unsigned int data; - - data = _display_information -> _cpu_id_data [index]; + data = _display_information->_cpu_id_data[index]; windisplay_cat.debug(false) << hex << data << dec; - if (index < (_display_information -> _cpu_id_size - 1)) { + if (index < _display_information->_cpu_id_size - 1) { windisplay_cat.debug(false) << "|"; } @@ -973,7 +868,7 @@ lookup_cpu_data() { } if (windisplay_cat.is_debug()) { - parse_cpu_id (&cpu_id); + parse_cpu_id(&cpu_id); } } @@ -986,7 +881,7 @@ lookup_cpu_data() { //////////////////////////////////////////////////////////////////// // Function: WinGraphicsPipe::Destructor // Access: Public, Virtual -// Description: +// Description: //////////////////////////////////////////////////////////////////// WinGraphicsPipe:: ~WinGraphicsPipe() { From 672a191d2a8e4a0d66ff6e88091238c2e83a5ef5 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Jul 2015 21:23:46 +0200 Subject: [PATCH 066/203] Improve error message when Cg support is not enabled --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index db342f423a..e05e1e2d8e 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -4828,8 +4828,8 @@ prepare_shader(Shader *se) { return NULL; } -#if defined(HAVE_CG) && !defined(OPENGLES) case Shader::SL_Cg: +#if defined(HAVE_CG) && !defined(OPENGLES) if (_supports_basic_shaders) { result = new CLP(CgShaderContext)(this, se); break; @@ -4838,6 +4838,10 @@ prepare_shader(Shader *se) { << "Tried to load Cg shader, but basic shaders not supported.\n"; return NULL; } +#elif defined(OPENGLES) + GLCAT.error() + << "Tried to load Cg shader, but Cg support is not available for OpenGL ES.\n"; + return NULL; #else GLCAT.error() << "Tried to load Cg shader, but Cg support not compiled in.\n"; From 87b23dfeb20778bd43160e94c561b3909f7d4b6d Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Jul 2015 21:31:24 +0200 Subject: [PATCH 067/203] Improve shader model detection mechanism --- panda/src/cocoadisplay/cocoaGraphicsPipe.mm | 1 + panda/src/display/displayInformation.cxx | 10 +- panda/src/display/displayInformation.h | 7 +- panda/src/display/graphicsPipe.cxx | 1 + panda/src/display/graphicsPipe.h | 2 +- panda/src/display/graphicsStateGuardian.I | 4 +- panda/src/display/graphicsStateGuardian.cxx | 8 ++ panda/src/display/graphicsStateGuardian.h | 11 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 132 ++++++++---------- panda/src/osxdisplay/osxGraphicsPipe.cxx | 1 + panda/src/windisplay/winDetectDx.h | 3 +- panda/src/x11display/x11GraphicsPipe.cxx | 1 + 12 files changed, 91 insertions(+), 90 deletions(-) diff --git a/panda/src/cocoadisplay/cocoaGraphicsPipe.mm b/panda/src/cocoadisplay/cocoaGraphicsPipe.mm index 1969ac4116..7883bad834 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsPipe.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsPipe.mm @@ -19,6 +19,7 @@ #include "cocoaPandaApp.h" #include "config_cocoadisplay.h" #include "frameBufferProperties.h" +#include "displayInformation.h" #import #import diff --git a/panda/src/display/displayInformation.cxx b/panda/src/display/displayInformation.cxx index 41eab9d020..3cdcd067ec 100644 --- a/panda/src/display/displayInformation.cxx +++ b/panda/src/display/displayInformation.cxx @@ -90,13 +90,12 @@ DisplayInformation() { int window_bits_per_pixel; int total_display_modes; DisplayMode *display_mode_array; - int shader_model; int video_memory; int texture_memory; PN_uint64 physical_memory; PN_uint64 available_physical_memory; - state = DisplayInformation::DS_unknown; + state = DisplayInformation::DS_unknown; get_adapter_display_mode_state = false; get_device_caps_state = false; window_width = 0; @@ -104,7 +103,6 @@ DisplayInformation() { window_bits_per_pixel = 0; total_display_modes = 0; display_mode_array = NULL; - shader_model = GraphicsStateGuardian::SM_00; video_memory = 0; texture_memory = 0; physical_memory = 0; @@ -118,7 +116,7 @@ DisplayInformation() { _window_bits_per_pixel = window_bits_per_pixel; _total_display_modes = total_display_modes; _display_mode_array = display_mode_array; - _shader_model = shader_model; + _shader_model = GraphicsStateGuardian::SM_00; _video_memory = video_memory; _texture_memory = texture_memory; @@ -328,8 +326,8 @@ get_display_mode_fullscreen_only (int display_index) { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -int DisplayInformation:: -get_shader_model ( ) { +GraphicsStateGuardian::ShaderModel DisplayInformation:: +get_shader_model() { return _shader_model; } diff --git a/panda/src/display/displayInformation.h b/panda/src/display/displayInformation.h index 32ee8c687e..c4d624097e 100644 --- a/panda/src/display/displayInformation.h +++ b/panda/src/display/displayInformation.h @@ -16,6 +16,7 @@ #define DISPLAYINFORMATION_H #include "typedef.h" +#include "graphicsStateGuardian.h" struct EXPCL_PANDA_DISPLAY DisplayMode { PUBLISHED: @@ -65,7 +66,7 @@ PUBLISHED: int get_display_mode_refresh_rate(int display_index); int get_display_mode_fullscreen_only(int display_index); - int get_shader_model(); + GraphicsStateGuardian::ShaderModel get_shader_model(); int get_video_memory(); int get_texture_memory(); @@ -126,9 +127,9 @@ public: int _maximum_window_width; int _maximum_window_height; int _window_bits_per_pixel; - int _total_display_modes; + int _total_display_modes; DisplayMode *_display_mode_array; - int _shader_model; + GraphicsStateGuardian::ShaderModel _shader_model; int _video_memory; int _texture_memory; diff --git a/panda/src/display/graphicsPipe.cxx b/panda/src/display/graphicsPipe.cxx index 4865e3da9f..0a6978db78 100644 --- a/panda/src/display/graphicsPipe.cxx +++ b/panda/src/display/graphicsPipe.cxx @@ -17,6 +17,7 @@ #include "graphicsBuffer.h" #include "config_display.h" #include "mutexHolder.h" +#include "displayInformation.h" TypeHandle GraphicsPipe::_type_handle; diff --git a/panda/src/display/graphicsPipe.h b/panda/src/display/graphicsPipe.h index 134a3baddd..d505af7a1e 100644 --- a/panda/src/display/graphicsPipe.h +++ b/panda/src/display/graphicsPipe.h @@ -21,7 +21,6 @@ #include "typedReferenceCount.h" #include "pointerTo.h" #include "lightMutex.h" -#include "displayInformation.h" class GraphicsEngine; class GraphicsOutput; @@ -32,6 +31,7 @@ class FrameBufferProperties; class WindowProperties; class Texture; class WindowHandle; +class DisplayInformation; //////////////////////////////////////////////////////////////////// // Class : GraphicsPipe diff --git a/panda/src/display/graphicsStateGuardian.I b/panda/src/display/graphicsStateGuardian.I index 9cfa0e3fed..15b2b89b78 100644 --- a/panda/src/display/graphicsStateGuardian.I +++ b/panda/src/display/graphicsStateGuardian.I @@ -876,7 +876,7 @@ get_maximum_simultaneous_render_targets() const { // Access: Published // Description: Returns the ShaderModel //////////////////////////////////////////////////////////////////// -INLINE int GraphicsStateGuardian:: +INLINE GraphicsStateGuardian::ShaderModel GraphicsStateGuardian:: get_shader_model() const { return _shader_model; } @@ -889,7 +889,7 @@ get_shader_model() const { // testing lower-end shaders. //////////////////////////////////////////////////////////////////// INLINE void GraphicsStateGuardian:: -set_shader_model(int shader_model) { +set_shader_model(ShaderModel shader_model) { if (shader_model <= _auto_detect_shader_model) { _shader_model = shader_model; } diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 15ebcd9dc2..b2fef6f469 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -3344,3 +3344,11 @@ int GraphicsStateGuardian:: get_driver_shader_version_minor() { return -1; } + +ostream & +operator << (ostream &out, GraphicsStateGuardian::ShaderModel sm) { + static const char *sm_strings[] = {"none", "1.1", "2.0", "2.x", "3.0", "4.0", "5.0", "5.1"}; + nassertr(sm >= 0 && sm <= GraphicsStateGuardian::SM_51, out); + out << sm_strings[sm]; + return out; +} diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index 7e9d8b6f47..cc3c78a1bc 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -83,6 +83,7 @@ PUBLISHED: SM_30, SM_40, SM_50, + SM_51, }; INLINE void release_all(); @@ -166,8 +167,8 @@ PUBLISHED: INLINE int get_max_color_targets() const; INLINE int get_maximum_simultaneous_render_targets() const; - INLINE int get_shader_model() const; - INLINE void set_shader_model(int shader_model); + INLINE ShaderModel get_shader_model() const; + INLINE void set_shader_model(ShaderModel shader_model); virtual int get_supported_geom_rendering() const; virtual bool get_supports_cg_profile(const string &name) const; @@ -545,8 +546,8 @@ protected: int _stereo_buffer_mask; - int _auto_detect_shader_model; - int _shader_model; + ShaderModel _auto_detect_shader_model; + ShaderModel _shader_model; static PT(TextureStage) _alpha_scale_texture_stage; @@ -664,6 +665,8 @@ private: friend class GraphicsEngine; }; +EXPCL_PANDA_DISPLAY ostream &operator << (ostream &out, GraphicsStateGuardian::ShaderModel sm); + #include "graphicsStateGuardian.I" #endif diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 02d03b0b66..2fc02f6eb0 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -64,6 +64,7 @@ #include "graphicsEngine.h" #include "shaderGenerator.h" #include "samplerState.h" +#include "displayInformation.h" #if defined(HAVE_CG) && !defined(OPENGLES) #include "Cg/cgGL.h" @@ -2450,58 +2451,39 @@ reset() { report_my_gl_errors(); -#if defined(HAVE_CG) && !defined(OPENGLES) - - typedef struct { - CGprofile cg_profile; - int shader_model; - } CG_PROFILE_TO_SHADER_MODEL; - - static CG_PROFILE_TO_SHADER_MODEL cg_profile_to_shader_model_array[] = { +#ifndef OPENGLES + if (_gl_shadlang_ver_major >= 4 || has_extension("GL_NV_gpu_program5")) { // gp5fp - OpenGL fragment profile for GeForce 400 Series and up - (CGprofile)7017, /*CG_PROFILE_GP5FP,*/ - SM_50, + _shader_model = SM_50; + } else if (_gl_shadlang_ver_major >= 3 || + has_extension("GL_NV_gpu_program4")) { // gp4fp - OpenGL fragment profile for G8x (GeForce 8xxx and up) - (CGprofile)7010, /*CG_PROFILE_GP4FP,*/ - SM_40, + _shader_model = SM_40; + } else if (has_extension("GL_NV_fragment_program2")) { // fp40 - OpenGL fragment profile for NV4x (GeForce 6xxx and 7xxx // Series, NV4x-based Quadro FX, etc.) - CG_PROFILE_FP40, - SM_30, + _shader_model = SM_30; + } else if (has_extension("GL_NV_fragment_program")) { // fp30 - OpenGL fragment profile for NV3x (GeForce FX, Quadro FX, etc.) - CG_PROFILE_FP30, - SM_2X, + _shader_model = SM_2X; + } else if (_gl_shadlang_ver_major >= 1 || + has_extension("GL_ARB_fragment_program")) { // This OpenGL profile corresponds to the per-fragment - // functionality introduced by GeForce FX and other DirectX 9 - // GPUs. - CG_PROFILE_ARBFP1, - SM_20, + // functionality introduced by GeForce FX and other DirectX 9 GPUs. + _shader_model = SM_20; + } else if (has_extension("GL_NV_texture_shader2")) { // fp20 - OpenGL fragment profile for NV2x (GeForce3, GeForce4 Ti, // Quadro DCC, etc.) - CG_PROFILE_FP20, - SM_11, + _shader_model = SM_11; - // no shader support - CG_PROFILE_UNKNOWN, - SM_00, - }; - - int index; - CG_PROFILE_TO_SHADER_MODEL *cg_profile_to_shader_model; - - index = 0; - cg_profile_to_shader_model = cg_profile_to_shader_model_array; - while (cg_profile_to_shader_model->shader_model != SM_00) { - if (cgGLIsProfileSupported(cg_profile_to_shader_model->cg_profile)) { - _shader_model = cg_profile_to_shader_model->shader_model; - break; - } - cg_profile_to_shader_model++; + } else { + // No shader support + _shader_model = SM_00; } // DisplayInformation may have better shader model detection @@ -2521,12 +2503,8 @@ reset() { } _auto_detect_shader_model = _shader_model; - CGprofile vertex_profile; - CGprofile pixel_profile; - - vertex_profile = cgGLGetLatestProfile(CG_GL_VERTEX); - pixel_profile = cgGLGetLatestProfile(CG_GL_FRAGMENT); if (GLCAT.is_debug()) { +#ifdef HAVE_CG #if CG_VERSION_NUM >= 2200 GLCAT.debug() << "Supported Cg profiles:\n"; int num_profiles = cgGetNumSupportedProfiles(); @@ -2539,22 +2517,25 @@ reset() { #endif // CG_VERSION_NUM >= 2200 #if CG_VERSION_NUM >= 3100 - if (GLCAT.is_debug()) { - CGGLglslversion ver = cgGLGetContextGLSLVersion(_cg_context); - GLCAT.debug() - << "Cg GLSL version: " << cgGLGetGLSLVersionString(ver) << "\n"; - } -#endif - + CGGLglslversion ver = cgGLGetContextGLSLVersion(_cg_context); GLCAT.debug() - << "\nCg latest vertex profile = " << cgGetProfileString(vertex_profile) << " id = " << vertex_profile - << "\nCg latest pixel profile = " << cgGetProfileString(pixel_profile) << " id = " << pixel_profile - << "\nshader model = " << _shader_model - << "\n"; - } - + << "Cg GLSL version: " << cgGLGetGLSLVersionString(ver) << "\n"; #endif + CGprofile vertex_profile = cgGLGetLatestProfile(CG_GL_VERTEX); + CGprofile pixel_profile = cgGLGetLatestProfile(CG_GL_FRAGMENT); + GLCAT.debug() + << "Cg latest vertex profile = " << cgGetProfileString(vertex_profile) + << " (" << vertex_profile << ")\n"; + GLCAT.debug() + << "Cg latest pixel profile = " << cgGetProfileString(pixel_profile) + << " (" << pixel_profile << ")\n"; +#endif // HAVE_CG + + GLCAT.debug() << "shader model = " << _shader_model << "\n"; + } +#endif // !OPENGLES + // OpenGL core profile requires a VAO to be bound. It's a bit silly, // because we can just bind a VAO and then forget about it. #if !defined(OPENGLES) @@ -6872,7 +6853,6 @@ query_gl_version() { return; } } -#endif // If we asked for a GL 3 context, let's first try and see if we // can use the OpenGL 3 way to query version. @@ -6890,6 +6870,7 @@ query_gl_version() { return; } } +#endif // !OPENGLES // Otherwise, parse the GL_VERSION string. if (_gl_version.empty()) { @@ -6946,31 +6927,36 @@ query_glsl_version() { _gl_shadlang_ver_minor = 0; #ifndef OPENGLES - if (_gl_version_major == 1) { - if (has_extension("GL_ARB_shading_language_100")) { - _gl_shadlang_ver_major = 1; - _gl_shadlang_ver_minor = 0; - } - } else if (_gl_version_major >= 2) { + // OpenGL 2.0 introduces GLSL in the core. In 1.x, it is an extension. + if (_gl_version_major >= 2 || has_extension("GL_ARB_shading_language_100")) { + string ver = show_gl_string("GL_SHADING_LANGUAGE_VERSION", GL_SHADING_LANGUAGE_VERSION); _gl_shadlang_ver_major = 1; - _gl_shadlang_ver_minor = 1; - const char *verstr = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION); - if (verstr == NULL || - sscanf(verstr, "%d.%d", &_gl_shadlang_ver_major, - &_gl_shadlang_ver_minor) != 2) { + _gl_shadlang_ver_minor = (_gl_version_major >= 2) ? 1 : 0; + if (ver.empty() || + sscanf(ver.c_str(), "%d.%d", &_gl_shadlang_ver_major, + &_gl_shadlang_ver_minor) != 2) { GLCAT.warning() << "Invalid GL_SHADING_LANGUAGE_VERSION format.\n"; } } -#elif defined(OPENGLES_2) +#elif !defined(OPENGLES_1) + // OpenGL ES 2.0 and above has shader support built-in. + string ver = show_gl_string("GL_SHADING_LANGUAGE_VERSION", GL_SHADING_LANGUAGE_VERSION); _gl_shadlang_ver_major = 1; _gl_shadlang_ver_minor = 0; - const char *verstr = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION); - if (verstr == NULL || - sscanf(verstr, "OpenGL ES GLSL %d.%d", &_gl_shadlang_ver_major, - &_gl_shadlang_ver_minor) != 2) { + if (ver.empty() || + sscanf(ver.c_str(), "OpenGL ES GLSL %d.%d", &_gl_shadlang_ver_major, + &_gl_shadlang_ver_minor) != 2) { GLCAT.warning() << "Invalid GL_SHADING_LANGUAGE_VERSION format.\n"; } #endif + +#ifndef OPENGLES_1 + if (GLCAT.is_debug()) { + GLCAT.debug() + << "Detected GLSL version: " + << _gl_shadlang_ver_major << "." << _gl_shadlang_ver_minor << "\n"; + } +#endif } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/osxdisplay/osxGraphicsPipe.cxx b/panda/src/osxdisplay/osxGraphicsPipe.cxx index 79e4d9c3c3..5c85bd018e 100644 --- a/panda/src/osxdisplay/osxGraphicsPipe.cxx +++ b/panda/src/osxdisplay/osxGraphicsPipe.cxx @@ -17,6 +17,7 @@ #include "pnmImage.h" #include "subprocessWindow.h" #include "nativeWindowHandle.h" +#include "displayInformation.h" #import // some macros to make code more readable. diff --git a/panda/src/windisplay/winDetectDx.h b/panda/src/windisplay/winDetectDx.h index f04d468090..b88901143d 100644 --- a/panda/src/windisplay/winDetectDx.h +++ b/panda/src/windisplay/winDetectDx.h @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include +#include "displayInformation.h" typedef struct { D3DFORMAT d3d_format; @@ -116,7 +117,7 @@ static int get_display_information (DisplaySearchParameters &display_search_para int get_adapter_display_mode_state; int get_device_caps_state; - int shader_model; + GraphicsStateGuardian::ShaderModel shader_model; UINT minimum_width; UINT maximum_width; UINT minimum_height; diff --git a/panda/src/x11display/x11GraphicsPipe.cxx b/panda/src/x11display/x11GraphicsPipe.cxx index 83ba8de3d4..e6fc85a3e3 100644 --- a/panda/src/x11display/x11GraphicsPipe.cxx +++ b/panda/src/x11display/x11GraphicsPipe.cxx @@ -16,6 +16,7 @@ #include "x11GraphicsWindow.h" #include "config_x11display.h" #include "frameBufferProperties.h" +#include "displayInformation.h" TypeHandle x11GraphicsPipe::_type_handle; From 1c2c60acba94c97004987165912e9f9c9759927c Mon Sep 17 00:00:00 2001 From: Michael Wass Date: Mon, 20 Jul 2015 11:03:42 -0400 Subject: [PATCH 068/203] Removed a nonexistent import from GridChild This import is nonexistent and has no calls to it. The purpose it serves right now is causing an ImportError :P. --- direct/src/distributed/GridChild.py | 1 - 1 file changed, 1 deletion(-) diff --git a/direct/src/distributed/GridChild.py b/direct/src/distributed/GridChild.py index d139adff4a..58ac9783b4 100755 --- a/direct/src/distributed/GridChild.py +++ b/direct/src/distributed/GridChild.py @@ -1,6 +1,5 @@ from direct.distributed.DistributedSmoothNodeBase import DistributedSmoothNodeBase from direct.distributed.GridParent import GridParent -from pandac.PandaModules import EmbeddedValue class GridChild: """ From 3ad274639d4aa702e5cf4d53c3bcc1181a779ca8 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 20 Jul 2015 19:59:26 +0200 Subject: [PATCH 069/203] Move Cg calls out of GSG reset() function - do profile detection entirely without Cg functions --- panda/src/glstuff/glCgShaderContext_src.cxx | 15 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 163 +++++++++++------- 2 files changed, 110 insertions(+), 68 deletions(-) diff --git a/panda/src/glstuff/glCgShaderContext_src.cxx b/panda/src/glstuff/glCgShaderContext_src.cxx index d8db598182..643fa4299a 100644 --- a/panda/src/glstuff/glCgShaderContext_src.cxx +++ b/panda/src/glstuff/glCgShaderContext_src.cxx @@ -49,7 +49,20 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte nassertv(s->get_language() == Shader::SL_Cg); - CGcontext context = _glgsg->_cg_context; + // Get a Cg context for this GSG. + CGcontext context = glgsg->_cg_context; + if (context == 0) { + // The GSG doesn't have a Cg context yet. Create one. + glgsg->_cg_context = context = cgCreateContext(); + +#if CG_VERSION_NUM >= 3100 + // This just sounds like a good thing to do. + cgGLSetContextGLSLVersion(context, cgGLDetectGLSLVersion()); + if (glgsg->_shader_caps._active_vprofile == CG_PROFILE_GLSLV) { + cgGLSetContextOptimalOptions(context, CG_PROFILE_GLSLC); + } +#endif + } // Ask the shader to compile itself for us and // to give us the resulting Cg program objects. diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 2fc02f6eb0..55ea62b8de 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1269,63 +1269,7 @@ reset() { } } -#if defined(HAVE_CG) && !defined(OPENGLES) - if (cgGLIsProfileSupported(CG_PROFILE_ARBFP1) && - cgGLIsProfileSupported(CG_PROFILE_ARBVP1)) { - _supports_basic_shaders = true; - if (basic_shaders_only) { - _shader_caps._active_vprofile = (int)CG_PROFILE_ARBVP1; - _shader_caps._active_fprofile = (int)CG_PROFILE_ARBFP1; - _shader_caps._active_gprofile = (int)CG_PROFILE_UNKNOWN; // No geometry shader if only using basic - } else { - _shader_caps._active_vprofile = (int)cgGLGetLatestProfile(CG_GL_VERTEX); - _shader_caps._active_fprofile = (int)cgGLGetLatestProfile(CG_GL_FRAGMENT); - _shader_caps._active_gprofile = (int)cgGLGetLatestProfile(CG_GL_GEOMETRY); - - // cgGLGetLatestProfile doesn't seem to return anything other - // arbvp1/arbfp1 on non-NVIDIA cards, which is severely limiting. - // So, if this happens, we set it to GLSL, which is - // usually supported on all cards. - // The GLSL profiles are horribly broken on non-NVIDIA cards, but - // I think I've worked around the issues sufficiently. - if ((_shader_caps._active_vprofile == CG_PROFILE_ARBVP1 || - _shader_caps._active_fprofile == CG_PROFILE_ARBFP1) && - cgGLIsProfileSupported(CG_PROFILE_GLSLV) && - cgGLIsProfileSupported(CG_PROFILE_GLSLF)) { - - _shader_caps._active_vprofile = (int)CG_PROFILE_GLSLV; - _shader_caps._active_fprofile = (int)CG_PROFILE_GLSLF; -#if CG_VERSION_NUM >= 2200 - if (cgGLIsProfileSupported(CG_PROFILE_GLSLG)) { - _shader_caps._active_gprofile = (int)CG_PROFILE_GLSLG; - } -#endif - } - } - _shader_caps._ultimate_vprofile = (int)CG_PROFILE_VP40; - _shader_caps._ultimate_fprofile = (int)CG_PROFILE_FP40; - _shader_caps._ultimate_gprofile = (int)CG_PROFILE_GPU_GP; - - _cg_context = cgCreateContext(); - -#if CG_VERSION_NUM >= 3100 - // This just sounds like a good thing to do. - cgGLSetContextGLSLVersion(_cg_context, cgGLDetectGLSLVersion()); - if (_shader_caps._active_vprofile == CG_PROFILE_GLSLV) { - cgGLSetContextOptimalOptions(_cg_context, CG_PROFILE_GLSLC); - } -#endif - - // Bug workaround for radeons. - if (_shader_caps._active_fprofile == CG_PROFILE_ARBFP1) { - if (has_extension("GL_ATI_draw_buffers")) { - _shader_caps._bug_list.insert(Shader::SBUG_ati_draw_buffers); - } - } - } -#endif // HAVE_CG - - + // Check for GLSL support. #if defined(OPENGLES_1) _supports_glsl = false; _supports_geometry_shaders = false; @@ -1335,7 +1279,7 @@ reset() { _supports_geometry_shaders = false; _supports_tessellation_shaders = false; #else - _supports_glsl = is_at_least_gl_version(2, 0) || has_extension("GL_ARB_shading_language_100"); + _supports_glsl = (_gl_shadlang_ver_major >= 1); _supports_tessellation_shaders = is_at_least_gl_version(4, 0) || has_extension("GL_ARB_tessellation_shader"); if (is_at_least_gl_version(3, 2)) { @@ -1363,6 +1307,79 @@ reset() { #endif _shader_caps._supports_glsl = _supports_glsl; + // Check for support for other types of shaders that can be used by Cg. + _supports_basic_shaders = false; +#if defined(HAVE_CG) && !defined(OPENGLES) + if (has_extension("GL_ARB_vertex_program") && + has_extension("GL_ARB_fragment_program")) { + _supports_basic_shaders = true; + _shader_caps._active_vprofile = (int)CG_PROFILE_ARBVP1; + _shader_caps._active_fprofile = (int)CG_PROFILE_ARBFP1; + _shader_caps._active_gprofile = (int)CG_PROFILE_UNKNOWN; // No geometry shader if only using basic + + if (basic_shaders_only) { + // We're happy with ARB programs, thanks. + } else if (has_extension("GL_NV_gpu_program5")) { + _shader_caps._active_vprofile = (int)CG_PROFILE_GP5VP; + _shader_caps._active_fprofile = (int)CG_PROFILE_GP5FP; + _shader_caps._active_gprofile = (int)CG_PROFILE_GP5GP; + + } else if (has_extension("GL_NV_gpu_program4")) { + _shader_caps._active_vprofile = (int)CG_PROFILE_GP4VP; + _shader_caps._active_fprofile = (int)CG_PROFILE_GP4FP; + _shader_caps._active_gprofile = (int)CG_PROFILE_GP4GP; + + } else if (has_extension("GL_NV_vertex_program3") && + has_extension("GL_NV_fragment_program2")) { + _shader_caps._active_vprofile = (int)CG_PROFILE_VP40; + _shader_caps._active_fprofile = (int)CG_PROFILE_FP40; + _shader_caps._active_gprofile = (int)CG_PROFILE_UNKNOWN; + + } else if (has_extension("GL_NV_vertex_program2") && + has_extension("GL_NV_fragment_program")) { + _shader_caps._active_vprofile = (int)CG_PROFILE_VP30; + _shader_caps._active_fprofile = (int)CG_PROFILE_FP30; + _shader_caps._active_gprofile = (int)CG_PROFILE_UNKNOWN; + + } else if (has_extension("GL_NV_vertex_program1_1") && + has_extension("GL_NV_texture_shader2") && + has_extension("GL_NV_register_combiners2")) { + _shader_caps._active_vprofile = (int)CG_PROFILE_VP20; + _shader_caps._active_fprofile = (int)CG_PROFILE_FP20; + _shader_caps._active_gprofile = (int)CG_PROFILE_UNKNOWN; + + } else if (_supports_glsl) { + // This is what will be available to non-NVIDIA cards. It is the last + // option since it is slower to compile GLSL than the other options. + _shader_caps._active_vprofile = (int)CG_PROFILE_GLSLV; + _shader_caps._active_fprofile = (int)CG_PROFILE_GLSLF; + if (_supports_geometry_shaders) { + _shader_caps._active_gprofile = (int)CG_PROFILE_GLSLG; + } + } + _shader_caps._ultimate_vprofile = (int)CG_PROFILE_VP40; + _shader_caps._ultimate_fprofile = (int)CG_PROFILE_FP40; + _shader_caps._ultimate_gprofile = (int)CG_PROFILE_GPU_GP; + + // Bug workaround for radeons. + if (_shader_caps._active_fprofile == CG_PROFILE_ARBFP1) { + if (has_extension("GL_ATI_draw_buffers")) { + _shader_caps._bug_list.insert(Shader::SBUG_ati_draw_buffers); + } + } + + } else if (_supports_glsl) { + // No, but we do support GLSL... + _shader_caps._active_vprofile = (int)CG_PROFILE_GLSLV; + _shader_caps._active_fprofile = (int)CG_PROFILE_GLSLF; + if (_supports_geometry_shaders) { + _shader_caps._active_gprofile = (int)CG_PROFILE_GLSLG; + } else { + _shader_caps._active_gprofile = (int)CG_PROFILE_UNKNOWN; + } + } +#endif // HAVE_CG + _supports_compute_shaders = false; #ifndef OPENGLES if (is_at_least_gl_version(4, 3) || has_extension("GL_ARB_compute_shader")) { @@ -2517,19 +2534,31 @@ reset() { #endif // CG_VERSION_NUM >= 2200 #if CG_VERSION_NUM >= 3100 - CGGLglslversion ver = cgGLGetContextGLSLVersion(_cg_context); - GLCAT.debug() - << "Cg GLSL version: " << cgGLGetGLSLVersionString(ver) << "\n"; + GLCAT.debug() << "Cg GLSL version = " + << cgGLGetGLSLVersionString(cgGLDetectGLSLVersion()) << "\n"; #endif - CGprofile vertex_profile = cgGLGetLatestProfile(CG_GL_VERTEX); - CGprofile pixel_profile = cgGLGetLatestProfile(CG_GL_FRAGMENT); GLCAT.debug() - << "Cg latest vertex profile = " << cgGetProfileString(vertex_profile) - << " (" << vertex_profile << ")\n"; + << "Cg latest vertex profile = " + << cgGetProfileString(cgGLGetLatestProfile(CG_GL_VERTEX)) << "\n"; GLCAT.debug() - << "Cg latest pixel profile = " << cgGetProfileString(pixel_profile) - << " (" << pixel_profile << ")\n"; + << "Cg latest fragment profile = " + << cgGetProfileString(cgGLGetLatestProfile(CG_GL_FRAGMENT)) << "\n"; +#if CG_VERSION_NUM >= 2000 + GLCAT.debug() + << "Cg latest geometry profile = " + << cgGetProfileString(cgGLGetLatestProfile(CG_GL_GEOMETRY)) << "\n"; +#endif + GLCAT.debug() << "basic-shaders-only " << basic_shaders_only << "\n"; + GLCAT.debug() + << "Cg active vertex profile = " + << cgGetProfileString((CGprofile)_shader_caps._active_vprofile) << "\n"; + GLCAT.debug() + << "Cg active fragment profile = " + << cgGetProfileString((CGprofile)_shader_caps._active_fprofile) << "\n"; + GLCAT.debug() + << "Cg active geometry profile = " + << cgGetProfileString((CGprofile)_shader_caps._active_gprofile) << "\n"; #endif // HAVE_CG GLCAT.debug() << "shader model = " << _shader_model << "\n"; From 49fdd56c09ff8a4e9361a2c027d6ef036f946214 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 20 Jul 2015 20:04:27 +0200 Subject: [PATCH 070/203] Remove DirectStart imports from shadows sample --- samples/shadows/advanced.py | 8 +++++--- samples/shadows/basic.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/samples/shadows/advanced.py b/samples/shadows/advanced.py index 6e8fbf5eb2..7211f9a087 100755 --- a/samples/shadows/advanced.py +++ b/samples/shadows/advanced.py @@ -4,7 +4,7 @@ from panda3d.core import * import sys import os -import direct.directbase.DirectStart +from direct.showbase.ShowBase import ShowBase from direct.interval.IntervalGlobal import * from direct.gui.DirectGui import OnscreenText from direct.showbase.DirectObject import DirectObject @@ -235,5 +235,7 @@ class World(DirectObject): 'A/Z: Increase/Decrease the Push-Bias [%F]' % self.pushBias) render.setShaderInput('push', self.pushBias) -w = World() -base.run() +if __name__ == '__main__': + base = ShowBase() + w = World() + base.run() diff --git a/samples/shadows/basic.py b/samples/shadows/basic.py index d6ec8671f5..95de1198a2 100755 --- a/samples/shadows/basic.py +++ b/samples/shadows/basic.py @@ -4,7 +4,7 @@ from panda3d.core import * import sys import os -import direct.directbase.DirectStart +from direct.showbase.ShowBase import ShowBase from direct.interval.IntervalGlobal import * from direct.gui.DirectGui import OnscreenText from direct.showbase.DirectObject import DirectObject @@ -176,5 +176,7 @@ class World(DirectObject): base.win.getGsg().getSupportsDepthTexture() and \ base.win.getGsg().getSupportsShadowFilter() -w = World() -base.run() +if __name__ == '__main__': + base = ShowBase() + w = World() + base.run() From 5413a267ba109755b7a49e078e9b2156beca2ddc Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 12:48:45 +0200 Subject: [PATCH 071/203] Fix error with AnimControlInterval --- direct/src/interval/AnimControlInterval.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/src/interval/AnimControlInterval.py b/direct/src/interval/AnimControlInterval.py index 3e1d1259d1..f53fe22057 100755 --- a/direct/src/interval/AnimControlInterval.py +++ b/direct/src/interval/AnimControlInterval.py @@ -152,7 +152,7 @@ class AnimControlInterval(Interval.Interval): else: frame = max(min(absFrame, numFrames - 1), 0) - self.controls.poseAll(frame) + self.controls.poseAll(int(frame)) self.state = CInterval.SStarted self.currT = t @@ -168,9 +168,9 @@ class AnimControlInterval(Interval.Interval): # a hitch in the animation when it plays back-to-back with # the next cycle. if self.reverse: - self.controls.poseAll(self.startFrame) + self.controls.poseAll(int(self.startFrame)) else: - self.controls.poseAll(self.endFrame) + self.controls.poseAll(int(self.endFrame)) else: # Otherwise, the user-specified duration determines which From e8e155f21847f0024874dcc43df7424427d5235f Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 12:56:13 +0200 Subject: [PATCH 072/203] AnimControlCollection methods should take floating-point frame numbers to match AnimInterface --- direct/src/interval/AnimControlInterval.py | 6 +++--- panda/src/chan/animControlCollection.I | 6 +++--- panda/src/chan/animControlCollection.cxx | 6 +++--- panda/src/chan/animControlCollection.h | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/direct/src/interval/AnimControlInterval.py b/direct/src/interval/AnimControlInterval.py index 9a92e0d589..bd2acc17ff 100755 --- a/direct/src/interval/AnimControlInterval.py +++ b/direct/src/interval/AnimControlInterval.py @@ -153,7 +153,7 @@ class AnimControlInterval(Interval.Interval): else: frame = max(min(absFrame, numFrames - 1), 0) - self.controls.poseAll(int(frame)) + self.controls.poseAll(frame) self.state = CInterval.SStarted self.currT = t @@ -169,9 +169,9 @@ class AnimControlInterval(Interval.Interval): # a hitch in the animation when it plays back-to-back with # the next cycle. if self.reverse: - self.controls.poseAll(int(self.startFrame)) + self.controls.poseAll(self.startFrame) else: - self.controls.poseAll(int(self.endFrame)) + self.controls.poseAll(self.endFrame) else: # Otherwise, the user-specified duration determines which diff --git a/panda/src/chan/animControlCollection.I b/panda/src/chan/animControlCollection.I index 95d21d2f81..4081d04f64 100644 --- a/panda/src/chan/animControlCollection.I +++ b/panda/src/chan/animControlCollection.I @@ -35,7 +35,7 @@ play(const string &anim_name) { // Description: Starts the named animation playing. //////////////////////////////////////////////////////////////////// INLINE bool AnimControlCollection:: -play(const string &anim_name, int from, int to) { +play(const string &anim_name, double from, double to) { AnimControl *control = find_anim(anim_name); if (control == (AnimControl *)NULL) { return false; @@ -67,7 +67,7 @@ loop(const string &anim_name, bool restart) { // Description: Starts the named animation looping. //////////////////////////////////////////////////////////////////// INLINE bool AnimControlCollection:: -loop(const string &anim_name, bool restart, int from, int to) { +loop(const string &anim_name, bool restart, double from, double to) { AnimControl *control = find_anim(anim_name); if (control == (AnimControl *)NULL) { return false; @@ -99,7 +99,7 @@ stop(const string &anim_name) { // Description: Sets to a particular frame in the named animation. //////////////////////////////////////////////////////////////////// INLINE bool AnimControlCollection:: -pose(const string &anim_name, int frame) { +pose(const string &anim_name, double frame) { AnimControl *control = find_anim(anim_name); if (control == (AnimControl *)NULL) { return false; diff --git a/panda/src/chan/animControlCollection.cxx b/panda/src/chan/animControlCollection.cxx index 075e73c0ab..87cb4b026b 100644 --- a/panda/src/chan/animControlCollection.cxx +++ b/panda/src/chan/animControlCollection.cxx @@ -191,7 +191,7 @@ play_all() { // Description: Starts all animations playing. //////////////////////////////////////////////////////////////////// void AnimControlCollection:: -play_all(int from, int to) { +play_all(double from, double to) { Controls::const_iterator ci; for (ci = _controls.begin(); ci != _controls.end(); ++ci) { (*ci)._control->play(from, to); @@ -219,7 +219,7 @@ loop_all(bool restart) { // Description: Starts all animations looping. //////////////////////////////////////////////////////////////////// void AnimControlCollection:: -loop_all(bool restart, int from, int to) { +loop_all(bool restart, double from, double to) { Controls::const_iterator ci; for (ci = _controls.begin(); ci != _controls.end(); ++ci) { (*ci)._control->loop(restart, from, to); @@ -254,7 +254,7 @@ stop_all() { // Description: Sets all animations to the indicated frame. //////////////////////////////////////////////////////////////////// void AnimControlCollection:: -pose_all(int frame) { +pose_all(double frame) { Controls::const_iterator ci; for (ci = _controls.begin(); ci != _controls.end(); ++ci) { (*ci)._control->pose(frame); diff --git a/panda/src/chan/animControlCollection.h b/panda/src/chan/animControlCollection.h index 38be5b9407..7435339660 100644 --- a/panda/src/chan/animControlCollection.h +++ b/panda/src/chan/animControlCollection.h @@ -55,19 +55,19 @@ PUBLISHED: // directly into the AnimControl's functionality by anim name. INLINE bool play(const string &anim_name); - INLINE bool play(const string &anim_name, int from, int to); + INLINE bool play(const string &anim_name, double from, double to); INLINE bool loop(const string &anim_name, bool restart); - INLINE bool loop(const string &anim_name, bool restart, int from, int to); + INLINE bool loop(const string &anim_name, bool restart, double from, double to); INLINE bool stop(const string &anim_name); - INLINE bool pose(const string &anim_name, int frame); + INLINE bool pose(const string &anim_name, double frame); // These functions operate on all anims at once. void play_all(); - void play_all(int from, int to); + void play_all(double from, double to); void loop_all(bool restart); - void loop_all(bool restart, int from, int to); + void loop_all(bool restart, double from, double to); bool stop_all(); - void pose_all(int frame); + void pose_all(double frame); INLINE int get_frame(const string &anim_name) const; INLINE int get_frame() const; From 4206e349c94dea9bc2bb31b9bd15746deea4f31f Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 12:57:06 +0200 Subject: [PATCH 073/203] Fix obscure GL crash --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 4 ++-- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 40a6d4fdcc..e440ecb988 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -155,7 +155,7 @@ begin_frame(FrameMode mode, Thread *current_thread) { for (it = _texture_contexts.begin(); it != _texture_contexts.end(); ++it) { CLP(TextureContext) *gtc = *it; - if (gtc->needs_barrier(GL_FRAMEBUFFER_BARRIER_BIT)) { + if (gtc != NULL && gtc->needs_barrier(GL_FRAMEBUFFER_BARRIER_BIT)) { glgsg->issue_memory_barrier(GL_FRAMEBUFFER_BARRIER_BIT); // If we've done it for one, we've done it for all. break; @@ -1656,7 +1656,7 @@ resolve_multisamples() { for (it = _texture_contexts.begin(); it != _texture_contexts.end(); ++it) { CLP(TextureContext) *gtc = *it; - if (gtc->needs_barrier(GL_FRAMEBUFFER_BARRIER_BIT)) { + if (gtc != NULL && gtc->needs_barrier(GL_FRAMEBUFFER_BARRIER_BIT)) { glgsg->issue_memory_barrier(GL_FRAMEBUFFER_BARRIER_BIT); // If we've done it for one, we've done it for all. break; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 55ea62b8de..8ab2c7b872 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -7045,6 +7045,9 @@ report_extensions() const { out.put(' '); } out << ' ' << (*ei); + } else { + out.put('\n'); + break; } } out.put('\n'); From c0e1a3cdb4696b4dd5c254ac2ff332f8e6d15fcc Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 14:23:17 +0200 Subject: [PATCH 074/203] Keysyms for dead acute and dead grave keys to better support int'l keyboards --- panda/src/x11display/x11GraphicsWindow.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 785ab51ff0..709911479e 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -1641,6 +1641,7 @@ map_button(KeySym key) const { case XK_ampersand: return KeyboardButton::ascii_key('&'); case XK_apostrophe: // == XK_quoteright + case XK_dead_acute: // on int'l keyboards return KeyboardButton::ascii_key('\''); case XK_parenleft: return KeyboardButton::ascii_key('('); @@ -1772,6 +1773,7 @@ map_button(KeySym key) const { case XK_underscore: return KeyboardButton::ascii_key('_'); case XK_grave: // == XK_quoteleft + case XK_dead_grave: // on int'l keyboards return KeyboardButton::ascii_key('`'); case XK_a: return KeyboardButton::ascii_key('a'); @@ -1914,15 +1916,20 @@ map_button(KeySym key) const { case XK_Alt_R: return KeyboardButton::ralt(); case XK_Meta_L: + case XK_Super_L: return KeyboardButton::lmeta(); case XK_Meta_R: + case XK_Super_R: return KeyboardButton::rmeta(); case XK_Caps_Lock: return KeyboardButton::caps_lock(); case XK_Shift_Lock: return KeyboardButton::shift_lock(); } - + if (x11display_cat.is_debug()) { + x11display_cat.debug() + << "Unrecognized keysym 0x" << hex << key << dec << "\n"; + } return ButtonHandle::none(); } From 75019784f4e7adb964c45786e2e3fd21d0c3e9b8 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 15:39:15 +0200 Subject: [PATCH 075/203] Changes to inlining so we can use FORCE_INLINING in gcc as well --- dtool/src/dtoolbase/atomicAdjustDummyImpl.I | 28 ++++++++++----------- dtool/src/dtoolbase/atomicAdjustDummyImpl.h | 26 +++++++++---------- dtool/src/dtoolbase/atomicAdjustWin32Impl.I | 12 ++++----- dtool/src/dtoolbase/atomicAdjustWin32Impl.h | 18 ++++++------- dtool/src/dtoolbase/dtoolbase_cc.h | 13 ++++++++-- dtool/src/dtoolbase/typeHandle.I | 21 ---------------- dtool/src/dtoolbase/typeHandle.cxx | 21 ++++++++++++++++ dtool/src/dtoolbase/typeHandle.h | 2 +- dtool/src/prc/configFlags.I | 4 +-- dtool/src/prc/configFlags.h | 4 +-- panda/src/pgraph/nodePath.I | 17 ------------- panda/src/pgraph/nodePath.cxx | 17 +++++++++++++ panda/src/pgraph/nodePath.h | 3 +-- 13 files changed, 97 insertions(+), 89 deletions(-) diff --git a/dtool/src/dtoolbase/atomicAdjustDummyImpl.I b/dtool/src/dtoolbase/atomicAdjustDummyImpl.I index aa86d2c83e..d7b405ae15 100644 --- a/dtool/src/dtoolbase/atomicAdjustDummyImpl.I +++ b/dtool/src/dtoolbase/atomicAdjustDummyImpl.I @@ -18,7 +18,7 @@ // Access: Public, Static // Description: Atomically increments the indicated variable. //////////////////////////////////////////////////////////////////// -INLINE void AtomicAdjustDummyImpl:: +ALWAYS_INLINE void AtomicAdjustDummyImpl:: inc(TVOLATILE AtomicAdjustDummyImpl::Integer &var) { ++var; } @@ -30,7 +30,7 @@ inc(TVOLATILE AtomicAdjustDummyImpl::Integer &var) { // returns true if the new value is nonzero, false if it // is zero. //////////////////////////////////////////////////////////////////// -INLINE bool AtomicAdjustDummyImpl:: +ALWAYS_INLINE bool AtomicAdjustDummyImpl:: dec(TVOLATILE AtomicAdjustDummyImpl::Integer &var) { return (--var) != 0; } @@ -41,7 +41,7 @@ dec(TVOLATILE AtomicAdjustDummyImpl::Integer &var) { // Description: Atomically computes var += delta. It is legal for // delta to be negative. //////////////////////////////////////////////////////////////////// -INLINE void AtomicAdjustDummyImpl:: +ALWAYS_INLINE void AtomicAdjustDummyImpl:: add(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer delta) { var += delta; } @@ -52,7 +52,7 @@ add(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Intege // Description: Atomically changes the indicated variable and // returns the original value. //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl:: +ALWAYS_INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl:: set(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer new_value) { Integer orig_value = var; var = new_value; @@ -68,7 +68,7 @@ set(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Intege // asynchronously setting, incrementing, or decrementing // (via other AtomicAjust methods). //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl:: +ALWAYS_INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl:: get(const TVOLATILE AtomicAdjustDummyImpl::Integer &var) { return var; } @@ -79,8 +79,8 @@ get(const TVOLATILE AtomicAdjustDummyImpl::Integer &var) { // Description: Atomically changes the indicated variable and // returns the original value. //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl:: -set_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &var, +ALWAYS_INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl:: +set_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &var, AtomicAdjustDummyImpl::Pointer new_value) { Pointer orig_value = var; var = new_value; @@ -96,7 +96,7 @@ set_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &var, // asynchronously setting, incrementing, or decrementing // (via other AtomicAjust methods). //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl:: +ALWAYS_INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl:: get_ptr(const TVOLATILE AtomicAdjustDummyImpl::Pointer &var) { return var; } @@ -104,15 +104,15 @@ get_ptr(const TVOLATILE AtomicAdjustDummyImpl::Pointer &var) { //////////////////////////////////////////////////////////////////// // Function: AtomicAdjustDummyImpl::compare_and_exchange // Access: Public, Static -// Description: Atomic compare and exchange. +// Description: Atomic compare and exchange. // // If mem is equal to old_value, store new_value in mem. // In either case, return the original value of mem. // The caller can test for success by comparing // return_value == old_value. //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl:: -compare_and_exchange(TVOLATILE AtomicAdjustDummyImpl::Integer &mem, +ALWAYS_INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl:: +compare_and_exchange(TVOLATILE AtomicAdjustDummyImpl::Integer &mem, AtomicAdjustDummyImpl::Integer old_value, AtomicAdjustDummyImpl::Integer new_value) { Integer orig_value = mem; @@ -125,12 +125,12 @@ compare_and_exchange(TVOLATILE AtomicAdjustDummyImpl::Integer &mem, //////////////////////////////////////////////////////////////////// // Function: AtomicAdjustDummyImpl::compare_and_exchange_ptr // Access: Public, Static -// Description: Atomic compare and exchange. +// Description: Atomic compare and exchange. // // As above, but works on pointers instead of integers. //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl:: -compare_and_exchange_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &mem, +ALWAYS_INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl:: +compare_and_exchange_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &mem, AtomicAdjustDummyImpl::Pointer old_value, AtomicAdjustDummyImpl::Pointer new_value) { Pointer orig_value = mem; diff --git a/dtool/src/dtoolbase/atomicAdjustDummyImpl.h b/dtool/src/dtoolbase/atomicAdjustDummyImpl.h index 17e03c04e6..c77f527dc1 100644 --- a/dtool/src/dtoolbase/atomicAdjustDummyImpl.h +++ b/dtool/src/dtoolbase/atomicAdjustDummyImpl.h @@ -31,22 +31,22 @@ public: typedef long Integer; typedef void *Pointer; - INLINE static void inc(TVOLATILE Integer &var); - INLINE static bool dec(TVOLATILE Integer &var); - INLINE static void add(TVOLATILE Integer &var, Integer delta); - INLINE static Integer set(TVOLATILE Integer &var, Integer new_value); - INLINE static Integer get(const TVOLATILE Integer &var); + ALWAYS_INLINE static void inc(TVOLATILE Integer &var); + ALWAYS_INLINE static bool dec(TVOLATILE Integer &var); + ALWAYS_INLINE static void add(TVOLATILE Integer &var, Integer delta); + ALWAYS_INLINE static Integer set(TVOLATILE Integer &var, Integer new_value); + ALWAYS_INLINE static Integer get(const TVOLATILE Integer &var); - INLINE static Pointer set_ptr(TVOLATILE Pointer &var, Pointer new_value); - INLINE static Pointer get_ptr(const TVOLATILE Pointer &var); + ALWAYS_INLINE static Pointer set_ptr(TVOLATILE Pointer &var, Pointer new_value); + ALWAYS_INLINE static Pointer get_ptr(const TVOLATILE Pointer &var); - INLINE static Integer compare_and_exchange(TVOLATILE Integer &mem, - Integer old_value, - Integer new_value); + ALWAYS_INLINE static Integer compare_and_exchange(TVOLATILE Integer &mem, + Integer old_value, + Integer new_value); - INLINE static Pointer compare_and_exchange_ptr(TVOLATILE Pointer &mem, - Pointer old_value, - Pointer new_value); + ALWAYS_INLINE static Pointer compare_and_exchange_ptr(TVOLATILE Pointer &mem, + Pointer old_value, + Pointer new_value); }; #include "atomicAdjustDummyImpl.I" diff --git a/dtool/src/dtoolbase/atomicAdjustWin32Impl.I b/dtool/src/dtoolbase/atomicAdjustWin32Impl.I index d96fe98bc1..f04dfbe8fa 100644 --- a/dtool/src/dtoolbase/atomicAdjustWin32Impl.I +++ b/dtool/src/dtoolbase/atomicAdjustWin32Impl.I @@ -18,7 +18,7 @@ // Access: Public, Static // Description: Atomically increments the indicated variable. //////////////////////////////////////////////////////////////////// -INLINE void AtomicAdjustWin32Impl:: +ALWAYS_INLINE void AtomicAdjustWin32Impl:: inc(TVOLATILE AtomicAdjustWin32Impl::Integer &var) { assert((((size_t)&var) & (sizeof(Integer) - 1)) == 0); #ifdef _WIN64 @@ -35,7 +35,7 @@ inc(TVOLATILE AtomicAdjustWin32Impl::Integer &var) { // returns true if the new value is nonzero, false if it // is zero. //////////////////////////////////////////////////////////////////// -INLINE bool AtomicAdjustWin32Impl:: +ALWAYS_INLINE bool AtomicAdjustWin32Impl:: dec(TVOLATILE AtomicAdjustWin32Impl::Integer &var) { assert((((size_t)&var) & (sizeof(Integer) - 1)) == 0); #ifdef _WIN64 @@ -70,7 +70,7 @@ add(TVOLATILE AtomicAdjustWin32Impl::Integer &var, AtomicAdjustWin32Impl::Intege // Description: Atomically changes the indicated variable and // returns the original value. //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustWin32Impl::Integer AtomicAdjustWin32Impl:: +ALWAYS_INLINE AtomicAdjustWin32Impl::Integer AtomicAdjustWin32Impl:: set(TVOLATILE AtomicAdjustWin32Impl::Integer &var, AtomicAdjustWin32Impl::Integer new_value) { assert((((size_t)&var) & (sizeof(Integer) - 1)) == 0); @@ -90,7 +90,7 @@ set(TVOLATILE AtomicAdjustWin32Impl::Integer &var, // asynchronously setting, incrementing, or decrementing // (via other AtomicAjust methods). //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustWin32Impl::Integer AtomicAdjustWin32Impl:: +ALWAYS_INLINE AtomicAdjustWin32Impl::Integer AtomicAdjustWin32Impl:: get(const TVOLATILE AtomicAdjustWin32Impl::Integer &var) { // On Intel platforms, word-aligned loads are atomic (if performed // in a single instruction). We can't guarantee the compiler will @@ -107,7 +107,7 @@ get(const TVOLATILE AtomicAdjustWin32Impl::Integer &var) { // Description: Atomically changes the indicated variable and // returns the original value. //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustWin32Impl::Pointer AtomicAdjustWin32Impl:: +ALWAYS_INLINE AtomicAdjustWin32Impl::Pointer AtomicAdjustWin32Impl:: set_ptr(TVOLATILE AtomicAdjustWin32Impl::Pointer &var, AtomicAdjustWin32Impl::Pointer new_value) { assert((((size_t)&var) & (sizeof(Pointer) - 1)) == 0); @@ -123,7 +123,7 @@ set_ptr(TVOLATILE AtomicAdjustWin32Impl::Pointer &var, // asynchronously setting, incrementing, or decrementing // (via other AtomicAjust methods). //////////////////////////////////////////////////////////////////// -INLINE AtomicAdjustWin32Impl::Pointer AtomicAdjustWin32Impl:: +ALWAYS_INLINE AtomicAdjustWin32Impl::Pointer AtomicAdjustWin32Impl:: get_ptr(const TVOLATILE AtomicAdjustWin32Impl::Pointer &var) { // As in get(), make sure the address is word-aligned. assert((((size_t)&var) & (sizeof(Pointer) - 1)) == 0); diff --git a/dtool/src/dtoolbase/atomicAdjustWin32Impl.h b/dtool/src/dtoolbase/atomicAdjustWin32Impl.h index 2ead06d0fe..2018560577 100644 --- a/dtool/src/dtoolbase/atomicAdjustWin32Impl.h +++ b/dtool/src/dtoolbase/atomicAdjustWin32Impl.h @@ -45,20 +45,20 @@ public: typedef ALIGN_4BYTE UnalignedPointer Pointer; #endif // _WIN64 - INLINE static void inc(TVOLATILE Integer &var); - INLINE static bool dec(TVOLATILE Integer &var); + ALWAYS_INLINE static void inc(TVOLATILE Integer &var); + ALWAYS_INLINE static bool dec(TVOLATILE Integer &var); INLINE static void add(TVOLATILE Integer &var, Integer delta); - INLINE static Integer set(TVOLATILE Integer &var, Integer new_value); - INLINE static Integer get(const TVOLATILE Integer &var); + ALWAYS_INLINE static Integer set(TVOLATILE Integer &var, Integer new_value); + ALWAYS_INLINE static Integer get(const TVOLATILE Integer &var); - INLINE static Pointer set_ptr(TVOLATILE Pointer &var, Pointer new_value); - INLINE static Pointer get_ptr(const TVOLATILE Pointer &var); + ALWAYS_INLINE static Pointer set_ptr(TVOLATILE Pointer &var, Pointer new_value); + ALWAYS_INLINE static Pointer get_ptr(const TVOLATILE Pointer &var); - INLINE static Integer compare_and_exchange(TVOLATILE Integer &mem, + INLINE static Integer compare_and_exchange(TVOLATILE Integer &mem, Integer old_value, Integer new_value); - - INLINE static Pointer compare_and_exchange_ptr(TVOLATILE Pointer &mem, + + INLINE static Pointer compare_and_exchange_ptr(TVOLATILE Pointer &mem, Pointer old_value, Pointer new_value); }; diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index efefd36e9e..60ea4bd37f 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -32,6 +32,7 @@ using namespace std; #define INLINE inline +#define ALWAYS_INLINE inline #define TYPENAME typename #define CONSTEXPR #define NOEXCEPT noexcept @@ -115,11 +116,19 @@ typedef ios::iostate ios_iostate; typedef ios::seekdir ios_seekdir; #endif -#if defined(WIN32_VC) && defined(FORCE_INLINING) +#ifdef _MSC_VER +#define ALWAYS_INLINE __forceinline +#elif defined(__GNUC__) +#define ALWAYS_INLINE __attribute__((always_inline)) inline +#else +#define ALWAYS_INLINE inline +#endif + +#ifdef FORCE_INLINING // If FORCE_INLINING is defined, we use the keyword __forceinline, // which tells MS VC++ to override its internal benefit heuristic // and inline the fn if it is technically possible to do so. -#define INLINE __forceinline +#define INLINE ALWAYS_INLINE #else #define INLINE inline #endif diff --git a/dtool/src/dtoolbase/typeHandle.I b/dtool/src/dtoolbase/typeHandle.I index e489fd4099..867bdb4cea 100644 --- a/dtool/src/dtoolbase/typeHandle.I +++ b/dtool/src/dtoolbase/typeHandle.I @@ -263,24 +263,3 @@ INLINE TypeHandle:: operator bool () const { return (_index != 0); } - -//////////////////////////////////////////////////////////////////// -// Function: get_best_parent_from_Set -// Access: Published -// Description: Return the Index of the BEst fit Classs from a set -//////////////////////////////////////////////////////////////////// -INLINE int TypeHandle::get_best_parent_from_Set(const std::set< int > &legal_vals) const -{ - if(legal_vals.find(_index) != legal_vals.end()) - return _index; - - for(int pi = 0; pi < get_num_parent_classes() ; pi++) - { - TypeHandle ph = get_parent_class(pi); - int val = ph.get_best_parent_from_Set(legal_vals); - if(val > 0) - return val; - - } - return -1; -} diff --git a/dtool/src/dtoolbase/typeHandle.cxx b/dtool/src/dtoolbase/typeHandle.cxx index cca55062c1..d807a298b6 100644 --- a/dtool/src/dtoolbase/typeHandle.cxx +++ b/dtool/src/dtoolbase/typeHandle.cxx @@ -84,6 +84,27 @@ dec_memory_usage(MemoryClass memory_class, size_t size) { } #endif // DO_MEMORY_USAGE +//////////////////////////////////////////////////////////////////// +// Function: get_best_parent_from_Set +// Access: Published +// Description: Return the Index of the BEst fit Classs from a set +//////////////////////////////////////////////////////////////////// +int TypeHandle:: +get_best_parent_from_Set(const std::set< int > &legal_vals) const { + if (legal_vals.find(_index) != legal_vals.end()) { + return _index; + } + + for (int pi = 0; pi < get_num_parent_classes(); ++pi) { + TypeHandle ph = get_parent_class(pi); + int val = ph.get_best_parent_from_Set(legal_vals); + if (val > 0) { + return val; + } + } + return -1; +} + ostream & operator << (ostream &out, TypeHandle::MemoryClass mem_class) { switch (mem_class) { diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index c669fa8084..f94e983447 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -123,7 +123,7 @@ PUBLISHED: INLINE TypeHandle get_parent_towards(TypeHandle ancestor, TypedObject *object = (TypedObject *)NULL) const; - INLINE int get_best_parent_from_Set(const std::set< int > &legal_vals) const; + int get_best_parent_from_Set(const std::set< int > &legal_vals) const; #ifdef DO_MEMORY_USAGE int get_memory_usage(MemoryClass memory_class) const; diff --git a/dtool/src/prc/configFlags.I b/dtool/src/prc/configFlags.I index f0bb39bf51..d13cdd2699 100644 --- a/dtool/src/prc/configFlags.I +++ b/dtool/src/prc/configFlags.I @@ -20,7 +20,7 @@ // valid (based on a comparison of the supplied // local_modified value with the global_modified value). //////////////////////////////////////////////////////////////////// -INLINE bool ConfigFlags:: +ALWAYS_INLINE bool ConfigFlags:: is_cache_valid(AtomicAdjust::Integer local_modified) { return local_modified == _global_modified; } @@ -32,7 +32,7 @@ is_cache_valid(AtomicAdjust::Integer local_modified) { // the cache will appear to be valid, until someone next // calls invalidate_cache(). //////////////////////////////////////////////////////////////////// -INLINE void ConfigFlags:: +ALWAYS_INLINE void ConfigFlags:: mark_cache_valid(AtomicAdjust::Integer &local_modified) { local_modified = _global_modified; } diff --git a/dtool/src/prc/configFlags.h b/dtool/src/prc/configFlags.h index a90bdc1f33..b7a3205468 100644 --- a/dtool/src/prc/configFlags.h +++ b/dtool/src/prc/configFlags.h @@ -62,8 +62,8 @@ PUBLISHED: }; protected: - INLINE static bool is_cache_valid(AtomicAdjust::Integer local_modified); - INLINE static void mark_cache_valid(AtomicAdjust::Integer &local_modified); + ALWAYS_INLINE static bool is_cache_valid(AtomicAdjust::Integer local_modified); + ALWAYS_INLINE static void mark_cache_valid(AtomicAdjust::Integer &local_modified); INLINE static AtomicAdjust::Integer initial_invalid_cache(); INLINE static void invalidate_cache(); diff --git a/panda/src/pgraph/nodePath.I b/panda/src/pgraph/nodePath.I index ce0228174a..4c19e3fdc2 100644 --- a/panda/src/pgraph/nodePath.I +++ b/panda/src/pgraph/nodePath.I @@ -517,23 +517,6 @@ reverse_ls() const { reverse_ls(nout); } -//////////////////////////////////////////////////////////////////// -// Function: NodePath::reverse_ls -// Access: Published -// Description: Lists the hierarchy at and above the referenced node. -//////////////////////////////////////////////////////////////////// -INLINE int NodePath:: -reverse_ls(ostream &out, int indent_level) const { - if (is_empty()) { - out << "(empty)\n"; - return 0; - } else if (has_parent()) { - indent_level = get_parent().reverse_ls(out, indent_level); - } - node()->write(out, indent_level); - return indent_level + 2; -} - //////////////////////////////////////////////////////////////////// // Function: NodePath::set_state // Access: Published diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index 20a2f90ab4..5fe2c1ab3b 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -810,6 +810,23 @@ detach_node(Thread *current_thread) { } } +//////////////////////////////////////////////////////////////////// +// Function: NodePath::reverse_ls +// Access: Published +// Description: Lists the hierarchy at and above the referenced node. +//////////////////////////////////////////////////////////////////// +int NodePath:: +reverse_ls(ostream &out, int indent_level) const { + if (is_empty()) { + out << "(empty)\n"; + return 0; + } else if (has_parent()) { + indent_level = get_parent().reverse_ls(out, indent_level); + } + node()->write(out, indent_level); + return indent_level + 2; +} + //////////////////////////////////////////////////////////////////// // Function: NodePath::output // Access: Published diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 4e7a098601..0762600b2e 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -278,8 +278,7 @@ PUBLISHED: INLINE void ls() const; INLINE void ls(ostream &out, int indent_level = 0) const; INLINE void reverse_ls() const; - INLINE int reverse_ls(ostream &out, int indent_level = 0) const; - + int reverse_ls(ostream &out, int indent_level = 0) const; // Aggregate transform and state information. const RenderState *get_state(Thread *current_thread = Thread::get_current_thread()) const; From 6cf2da9e562739e2639f478230a939a36e1bb28a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 15:55:12 +0200 Subject: [PATCH 076/203] Fix error when loading a particle effect in particle panel --- direct/src/tkpanels/ParticlePanel.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/direct/src/tkpanels/ParticlePanel.py b/direct/src/tkpanels/ParticlePanel.py index ccc622bdc6..addd503191 100644 --- a/direct/src/tkpanels/ParticlePanel.py +++ b/direct/src/tkpanels/ParticlePanel.py @@ -19,6 +19,8 @@ import Pmw, os,Placer from panda3d.core import * from panda3d.physics import * +from panda3d.direct import getParticlePath + class ParticlePanel(AppShell): # Override class variables From f33e4508230e01fb1a4bfb3e55da65b4b1b22f36 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 16:32:57 +0200 Subject: [PATCH 077/203] A lot of performance changes, particularly wrt dcasts and state management --- dtool/src/dtoolbase/typedObject.I | 4 +- panda/src/char/character.cxx | 15 +- panda/src/char/characterJointBundle.cxx | 4 +- panda/src/cull/cullBinBackToFront.cxx | 4 +- panda/src/cull/cullBinFrontToBack.cxx | 4 +- panda/src/display/displayRegion.I | 11 +- panda/src/display/displayRegion.h | 2 +- panda/src/display/graphicsEngine.cxx | 11 +- panda/src/display/graphicsStateGuardian.cxx | 49 +- panda/src/display/standardMunger.cxx | 35 +- panda/src/egg2pg/characterMaker.cxx | 4 +- panda/src/egg2pg/eggBinner.cxx | 20 +- panda/src/glstuff/glCgShaderContext_src.cxx | 9 +- panda/src/glstuff/glGeomMunger_src.cxx | 8 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 25 +- .../src/glstuff/glGraphicsStateGuardian_src.h | 4 +- panda/src/gobj/geom.I | 2 +- panda/src/gobj/geom.cxx | 4 +- panda/src/gobj/geom.h | 6 +- panda/src/gobj/geomPrimitive.I | 4 +- panda/src/mathutil/boundingVolume.cxx | 12 + panda/src/mathutil/boundingVolume.h | 1 + .../src/mathutil/geometricBoundingVolume.cxx | 14 +- panda/src/mathutil/geometricBoundingVolume.h | 3 +- panda/src/pgraph/alphaTestAttrib.cxx | 6 +- panda/src/pgraph/alphaTestAttrib.h | 4 +- panda/src/pgraph/antialiasAttrib.cxx | 36 +- panda/src/pgraph/antialiasAttrib.h | 9 +- panda/src/pgraph/audioVolumeAttrib.cxx | 10 +- panda/src/pgraph/audioVolumeAttrib.h | 4 +- panda/src/pgraph/auxBitplaneAttrib.cxx | 4 +- panda/src/pgraph/auxBitplaneAttrib.h | 2 +- panda/src/pgraph/clipPlaneAttrib.h | 2 +- panda/src/pgraph/colorAttrib.cxx | 4 +- panda/src/pgraph/colorAttrib.h | 3 +- panda/src/pgraph/colorBlendAttrib.cxx | 3 +- panda/src/pgraph/colorBlendAttrib.h | 2 +- panda/src/pgraph/colorScaleAttrib.cxx | 10 +- panda/src/pgraph/colorScaleAttrib.h | 3 +- panda/src/pgraph/colorWriteAttrib.cxx | 3 +- panda/src/pgraph/colorWriteAttrib.h | 2 +- panda/src/pgraph/config_pgraph.cxx | 5 - panda/src/pgraph/config_pgraph.h | 1 - panda/src/pgraph/cullBinAttrib.cxx | 4 +- panda/src/pgraph/cullBinAttrib.h | 2 +- panda/src/pgraph/cullFaceAttrib.cxx | 10 +- panda/src/pgraph/cullFaceAttrib.h | 3 +- panda/src/pgraph/cullResult.cxx | 5 +- panda/src/pgraph/cullTraverserData.cxx | 14 +- panda/src/pgraph/cullableObject.cxx | 3 +- panda/src/pgraph/depthOffsetAttrib.cxx | 12 +- panda/src/pgraph/depthOffsetAttrib.h | 3 +- panda/src/pgraph/depthTestAttrib.cxx | 4 +- panda/src/pgraph/depthTestAttrib.h | 2 +- panda/src/pgraph/depthWriteAttrib.cxx | 4 +- panda/src/pgraph/depthWriteAttrib.h | 2 +- panda/src/pgraph/fogAttrib.cxx | 3 +- panda/src/pgraph/fogAttrib.h | 2 +- panda/src/pgraph/lightAttrib.cxx | 6 +- panda/src/pgraph/lightAttrib.h | 2 +- panda/src/pgraph/lightRampAttrib.cxx | 4 +- panda/src/pgraph/lightRampAttrib.h | 2 +- panda/src/pgraph/materialAttrib.cxx | 3 +- panda/src/pgraph/materialAttrib.h | 2 +- panda/src/pgraph/renderAttrib.I | 19 +- panda/src/pgraph/renderAttrib.cxx | 13 +- panda/src/pgraph/renderAttrib.h | 9 +- panda/src/pgraph/renderAttribRegistry.I | 46 +- panda/src/pgraph/renderAttribRegistry.cxx | 85 +-- panda/src/pgraph/renderAttribRegistry.h | 22 +- panda/src/pgraph/renderModeAttrib.cxx | 7 +- panda/src/pgraph/renderModeAttrib.h | 3 +- panda/src/pgraph/renderState.I | 31 +- panda/src/pgraph/renderState.cxx | 93 +-- panda/src/pgraph/renderState.h | 15 +- panda/src/pgraph/rescaleNormalAttrib.I | 13 + panda/src/pgraph/rescaleNormalAttrib.cxx | 69 +- panda/src/pgraph/rescaleNormalAttrib.h | 15 +- panda/src/pgraph/scissorAttrib.cxx | 6 +- panda/src/pgraph/scissorAttrib.h | 5 +- panda/src/pgraph/shadeModelAttrib.cxx | 6 +- panda/src/pgraph/shadeModelAttrib.h | 2 +- panda/src/pgraph/shaderAttrib.cxx | 7 +- panda/src/pgraph/shaderAttrib.h | 2 +- panda/src/pgraph/stateMunger.cxx | 13 +- panda/src/pgraph/stateMunger.h | 4 +- panda/src/pgraph/stencilAttrib.cxx | 3 +- panda/src/pgraph/stencilAttrib.h | 2 +- panda/src/pgraph/texGenAttrib.cxx | 9 +- panda/src/pgraph/texGenAttrib.h | 2 +- panda/src/pgraph/texMatrixAttrib.cxx | 11 +- panda/src/pgraph/texMatrixAttrib.h | 2 +- panda/src/pgraph/textureAttrib.cxx | 6 +- panda/src/pgraph/textureAttrib.h | 2 +- panda/src/pgraph/transparencyAttrib.cxx | 4 +- panda/src/pgraph/transparencyAttrib.h | 2 +- panda/src/putil/p3putil_composite2.cxx | 1 + panda/src/putil/weakKeyHashMap.I | 714 ++++++++++++++++++ panda/src/putil/weakKeyHashMap.cxx | 15 + panda/src/putil/weakKeyHashMap.h | 115 +++ 100 files changed, 1322 insertions(+), 511 deletions(-) create mode 100644 panda/src/putil/weakKeyHashMap.I create mode 100644 panda/src/putil/weakKeyHashMap.cxx create mode 100644 panda/src/putil/weakKeyHashMap.h diff --git a/dtool/src/dtoolbase/typedObject.I b/dtool/src/dtoolbase/typedObject.I index 684d0e8143..7c2917072f 100644 --- a/dtool/src/dtoolbase/typedObject.I +++ b/dtool/src/dtoolbase/typedObject.I @@ -61,7 +61,9 @@ get_type_index() const { //////////////////////////////////////////////////////////////////// INLINE bool TypedObject:: is_of_type(TypeHandle handle) const { - return get_type().is_derived_from(handle, (TypedObject *)this); + // Shortcut for the common case where the type matches exactly. + TypeHandle my_type = get_type(); + return handle == my_type || my_type.is_derived_from(handle, (TypedObject *)this); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/char/character.cxx b/panda/src/char/character.cxx index 9be6fe87d5..6d3ce17d94 100644 --- a/panda/src/char/character.cxx +++ b/panda/src/char/character.cxx @@ -420,8 +420,7 @@ find_joint(const string &name) const { int num_bundles = get_num_bundles(); for (int i = 0; i < num_bundles; ++i) { PartGroup *part = get_bundle(i)->find_child(name); - if (part != (PartGroup *)NULL && - part->is_of_type(CharacterJoint::get_class_type())) { + if (part != (PartGroup *)NULL && part->is_character_joint()) { return DCAST(CharacterJoint, part); } } @@ -728,7 +727,7 @@ r_merge_bundles(Character::JointMap &joint_map, PartGroup *old_group, PartGroup *new_group) { joint_map[old_group] = new_group; - if (new_group->is_of_type(CharacterJoint::get_class_type())) { + if (new_group->is_character_joint()) { CharacterJoint *new_joint; DCAST_INTO_V(new_joint, new_group); @@ -736,7 +735,7 @@ r_merge_bundles(Character::JointMap &joint_map, new_joint->_character = this; if (old_group != new_group && - old_group->is_of_type(CharacterJoint::get_class_type())) { + old_group->is_character_joint()) { CharacterJoint *old_joint; DCAST_INTO_V(old_joint, old_group); @@ -763,7 +762,7 @@ r_merge_bundles(Character::JointMap &joint_map, if (old_group == new_group) { return; } - + int i = 0, j = 0; int old_num_children = old_group->get_num_children(); int new_num_children = new_group->get_num_children(); @@ -809,7 +808,7 @@ r_merge_bundles(Character::JointMap &joint_map, // new_group. Duplicate it. PartGroup *new_pc = pc->make_copy(); new_children.push_back(new_pc); - + r_merge_bundles(joint_map, pc, new_pc); i++; } @@ -968,7 +967,7 @@ copy_geom(const Geom *source, const Character::JointMap &joint_map, void Character:: copy_node_pointers(const Character::NodeMap &node_map, PartGroup *dest, const PartGroup *source) { - if (dest->is_of_type(CharacterJoint::get_class_type())) { + if (dest->is_character_joint()) { nassertv(dest != source); const CharacterJoint *source_joint; CharacterJoint *dest_joint; @@ -1204,7 +1203,7 @@ redirect_slider(const VertexSlider *vs, Character::GeomSliderMap &gsmap) { //////////////////////////////////////////////////////////////////// void Character:: r_clear_joint_characters(PartGroup *part) { - if (part->is_of_type(CharacterJoint::get_class_type())) { + if (part->is_character_joint()) { CharacterJoint *joint = DCAST(CharacterJoint, part); // It is possible for the joint to reference a different Character diff --git a/panda/src/char/characterJointBundle.cxx b/panda/src/char/characterJointBundle.cxx index 8732d5a2ac..ba045369c4 100644 --- a/panda/src/char/characterJointBundle.cxx +++ b/panda/src/char/characterJointBundle.cxx @@ -102,8 +102,8 @@ r_set_character(PartGroup *group, Character *character) { return; } - if (group->is_of_type(CharacterJoint::get_class_type())) { - DCAST(CharacterJoint, group)->set_character(character); + if (group->is_character_joint()) { + ((CharacterJoint *)group)->set_character(character); } Children::const_iterator ci; diff --git a/panda/src/cull/cullBinBackToFront.cxx b/panda/src/cull/cullBinBackToFront.cxx index 6a734c0092..9e67adc36b 100644 --- a/panda/src/cull/cullBinBackToFront.cxx +++ b/panda/src/cull/cullBinBackToFront.cxx @@ -64,8 +64,8 @@ add_object(CullableObject *object, Thread *current_thread) { return; } - const GeometricBoundingVolume *gbv; - DCAST_INTO_V(gbv, volume); + const GeometricBoundingVolume *gbv = volume->as_geometric_bounding_volume(); + nassertv(gbv != NULL); LPoint3 center = gbv->get_approx_center(); nassertv(object->_internal_transform != (const TransformState *)NULL); diff --git a/panda/src/cull/cullBinFrontToBack.cxx b/panda/src/cull/cullBinFrontToBack.cxx index 91e8c99133..ba2103a0f7 100644 --- a/panda/src/cull/cullBinFrontToBack.cxx +++ b/panda/src/cull/cullBinFrontToBack.cxx @@ -64,8 +64,8 @@ add_object(CullableObject *object, Thread *current_thread) { return; } - const GeometricBoundingVolume *gbv; - DCAST_INTO_V(gbv, volume); + const GeometricBoundingVolume *gbv = volume->as_geometric_bounding_volume(); + nassertv(gbv != NULL); LPoint3 center = gbv->get_approx_center(); nassertv(object->_internal_transform != (const TransformState *)NULL); diff --git a/panda/src/display/displayRegion.I b/panda/src/display/displayRegion.I index 53d68ff00d..112b612de4 100644 --- a/panda/src/display/displayRegion.I +++ b/panda/src/display/displayRegion.I @@ -597,11 +597,16 @@ get_region_pixels_i(int i, int &xo, int &yo, int &w, int &h) const { // to all upstream pipeline stages. //////////////////////////////////////////////////////////////////// INLINE void DisplayRegion:: -set_cull_result(CullResult *cull_result, SceneSetup *scene_setup, +set_cull_result(PT(CullResult) cull_result, PT(SceneSetup) scene_setup, Thread *current_thread) { CDCullWriter cdata(_cycler_cull, true, current_thread); - cdata->_cull_result = cull_result; - cdata->_scene_setup = scene_setup; +#ifdef USE_MOVE_SEMANTICS + cdata->_cull_result = std::move(cull_result); + cdata->_scene_setup = std::move(scene_setup); +#else + swap(cdata->_cull_result, cull_result); + swap(cdata->_scene_setup, scene_setup); +#endif } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 811b913e5c..3b33590996 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -161,7 +161,7 @@ public: virtual bool supports_pixel_zoom() const; - INLINE void set_cull_result(CullResult *cull_result, SceneSetup *scene_setup, + INLINE void set_cull_result(PT(CullResult) cull_result, PT(SceneSetup) scene_setup, Thread *current_thread); INLINE CullResult *get_cull_result(Thread *current_thread) const; INLINE SceneSetup *get_scene_setup(Thread *current_thread) const; diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 2cac310b0c..892d70361d 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -41,7 +41,6 @@ #include "bamCache.h" #include "cullableObject.h" #include "geomVertexArrayData.h" -#include "omniBoundingVolume.h" #include "vertexDataSaveFile.h" #include "vertexDataBook.h" #include "vertexDataPage.h" @@ -1248,12 +1247,12 @@ do_cull(CullHandler *cull_handler, SceneSetup *scene_setup, // from the lens. PT(BoundingVolume) bv = scene_setup->get_cull_bounds(); - if (bv != (BoundingVolume *)NULL && - bv->is_of_type(GeometricBoundingVolume::get_class_type()) && - !bv->is_of_type(OmniBoundingVolume::get_class_type())) { + if (bv != (BoundingVolume *)NULL && !bv->is_infinite() && + bv->as_geometric_bounding_volume() != NULL) { // Transform it into the appropriate coordinate space. PT(GeometricBoundingVolume) local_frustum; - local_frustum = DCAST(GeometricBoundingVolume, bv->make_copy()); + local_frustum = bv->make_copy()->as_geometric_bounding_volume(); + nassertv(!local_frustum.is_null()); NodePath scene_parent = scene_setup->get_scene_root().get_parent(current_thread); CPT(TransformState) cull_center_transform = @@ -1580,7 +1579,7 @@ cull_to_bins(GraphicsOutput *win, DisplayRegion *dr, Thread *current_thread) { } // Save the results for next frame. - dr->set_cull_result(cull_result, scene_setup, current_thread); + dr->set_cull_result(MOVE(cull_result), MOVE(scene_setup), current_thread); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index b2fef6f469..de9b8d0036 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -40,6 +40,7 @@ #include "graphicsOutput.h" #include "texturePool.h" #include "geomMunger.h" +#include "stateMunger.h" #include "ambientLight.h" #include "directionalLight.h" #include "pointLight.h" @@ -814,38 +815,42 @@ dispatch_compute(int num_groups_x, int num_groups_y, int num_groups_z) { //////////////////////////////////////////////////////////////////// PT(GeomMunger) GraphicsStateGuardian:: get_geom_munger(const RenderState *state, Thread *current_thread) { - // Before we even look up the map, see if the _last_mi value points - // to this GSG. This is likely because we tend to visit the same - // state multiple times during a frame. Also, this might well be - // the only GSG in the world anyway. - if (!state->_mungers.empty()) { - RenderState::Mungers::const_iterator mi = state->_last_mi; - if (!(*mi).first.was_deleted() && (*mi).first == this) { - if ((*mi).second->is_registered()) { - return (*mi).second; + RenderState::Mungers &mungers = state->_mungers; + + if (mungers.is_empty()) { + // Before we even look up the map, see if the _last_mi value points + // to this GSG. This is likely because we tend to visit the same + // state multiple times during a frame. Also, this might well be + // the only GSG in the world anyway. + int mi = state->_last_mi; + if (mi >= 0 && mungers.has_element(mi) && mungers.get_key(mi) == this) { + PT(GeomMunger) munger = mungers.get_data(mi); + if (munger->is_registered()) { + return munger; } } - } - // Nope, we have to look it up in the map. - RenderState::Mungers::iterator mi = state->_mungers.find(this); - if (mi != state->_mungers.end() && !(*mi).first.was_deleted()) { - if ((*mi).second->is_registered()) { - state->_last_mi = mi; - return (*mi).second; + // Nope, we have to look it up in the map. + mi = mungers.find(this); + if (mi >= 0) { + PT(GeomMunger) munger = mungers.get_data(mi); + if (munger->is_registered()) { + state->_last_mi = mi; + return munger; + } else { + // This GeomMunger is no longer registered. Remove it from + // the map. + mungers.remove_element(mi); + } } - // This GeomMunger is no longer registered. Remove it from the - // map. - state->_mungers.erase(mi); } // Nothing in the map; create a new entry. PT(GeomMunger) munger = make_geom_munger(state, current_thread); nassertr(munger != (GeomMunger *)NULL && munger->is_registered(), munger); + nassertr(munger->is_of_type(StateMunger::get_class_type()), munger); - mi = state->_mungers.insert(RenderState::Mungers::value_type(this, munger)).first; - state->_last_mi = mi; - + state->_last_mi = mungers.store(this, munger); return munger; } diff --git a/panda/src/display/standardMunger.cxx b/panda/src/display/standardMunger.cxx index 85ddd0f3e1..53b4485303 100644 --- a/panda/src/display/standardMunger.cxx +++ b/panda/src/display/standardMunger.cxx @@ -15,7 +15,6 @@ #include "standardMunger.h" #include "renderState.h" #include "graphicsStateGuardian.h" -#include "dcast.h" #include "config_gobj.h" #include "displayRegion.h" @@ -43,16 +42,15 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, _auto_shader(false), _shader_skinning(false) { - _render_mode = DCAST(RenderModeAttrib, state->get_attrib(RenderModeAttrib::get_class_slot())); + _render_mode = (const RenderModeAttrib *) + state->get_attrib(RenderModeAttrib::get_class_slot()); if (!get_gsg()->get_runtime_color_scale()) { // We might need to munge the colors. - const ColorAttrib *color_attrib = (const ColorAttrib *) - state->get_attrib(ColorAttrib::get_class_slot()); - const ColorScaleAttrib *color_scale_attrib = (const ColorScaleAttrib *) - state->get_attrib(ColorScaleAttrib::get_class_slot()); + const ColorAttrib *color_attrib; + const ColorScaleAttrib *color_scale_attrib; - if (color_attrib != (ColorAttrib *)NULL && + if (state->get_attrib(color_attrib) && color_attrib->get_color_type() == ColorAttrib::T_flat) { if (!get_gsg()->get_color_scale_via_lighting()) { @@ -60,7 +58,7 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, // can't cheat the color via lighting (presumably, in this case, // by applying a material). _color = color_attrib->get_color(); - if (color_scale_attrib != (ColorScaleAttrib *)NULL && + if (state->get_attrib(color_scale_attrib) && color_scale_attrib->has_scale()) { const LVecBase4 &cs = color_scale_attrib->get_scale(); _color.set(_color[0] * cs[0], @@ -70,11 +68,11 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, } _munge_color = true; } - - } else if (color_scale_attrib != (ColorScaleAttrib *)NULL && + + } else if (state->get_attrib(color_scale_attrib) && color_scale_attrib->has_scale()) { _color_scale = color_scale_attrib->get_scale(); - + const TextureAttrib *tex_attrib = (const TextureAttrib *) state->get_attrib(TextureAttrib::get_class_slot()); @@ -106,7 +104,7 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, //////////////////////////////////////////////////////////////////// // Function: StandardMunger::Destructor // Access: Public, Virtual -// Description: +// Description: //////////////////////////////////////////////////////////////////// StandardMunger:: ~StandardMunger() { @@ -126,7 +124,7 @@ munge_data_impl(const GeomVertexData *data) { new_data = new_data->set_color(_color, _num_components, _numeric_type, _contents); } else if (_munge_color_scale) { - new_data = new_data->scale_color(_color_scale, _num_components, + new_data = new_data->scale_color(_color_scale, _num_components, _numeric_type, _contents); } @@ -142,9 +140,9 @@ munge_data_impl(const GeomVertexData *data) { const TransformBlendTable *table = new_data->get_transform_blend_table(); if (table != (TransformBlendTable *)NULL && table->get_num_transforms() != 0 && - table->get_max_simultaneous_transforms() <= + table->get_max_simultaneous_transforms() <= get_gsg()->get_max_vertex_transforms()) { - if (matrix_palette && + if (matrix_palette && table->get_num_transforms() <= get_gsg()->get_max_vertex_transform_indices()) { if (table->get_num_transforms() == table->get_max_simultaneous_transforms()) { @@ -186,7 +184,7 @@ munge_data_impl(const GeomVertexData *data) { // Description: Converts a Geom and/or its data as necessary. //////////////////////////////////////////////////////////////////// void StandardMunger:: -munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data, +munge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data, Thread *) { int supported_geom_rendering = get_gsg()->get_supported_geom_rendering(); @@ -289,7 +287,7 @@ premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data) { //////////////////////////////////////////////////////////////////// int StandardMunger:: compare_to_impl(const GeomMunger *other) const { - const StandardMunger *om = DCAST(StandardMunger, other); + const StandardMunger *om = (const StandardMunger *)other; if (_render_mode != om->_render_mode) { return _render_mode < om->_render_mode ? -1 : 1; @@ -335,7 +333,8 @@ compare_to_impl(const GeomMunger *other) const { //////////////////////////////////////////////////////////////////// int StandardMunger:: geom_compare_to_impl(const GeomMunger *other) const { - const StandardMunger *om = DCAST(StandardMunger, other); + const StandardMunger *om = (const StandardMunger *)other; + if (_munge_color != om->_munge_color) { return (int)_munge_color - (int)om->_munge_color; } diff --git a/panda/src/egg2pg/characterMaker.cxx b/panda/src/egg2pg/characterMaker.cxx index 18b688f3e1..5450a3ab6d 100644 --- a/panda/src/egg2pg/characterMaker.cxx +++ b/panda/src/egg2pg/characterMaker.cxx @@ -156,7 +156,7 @@ PandaNode *CharacterMaker:: part_to_node(PartGroup *part, const string &name) const { PandaNode *node = _character_node; - if (part->is_of_type(CharacterJoint::get_class_type())) { + if (part->is_character_joint()) { CharacterJoint *joint = DCAST(CharacterJoint, part); if (joint->_geom_node != (PandaNode *)NULL) { node = joint->_geom_node; @@ -343,7 +343,7 @@ build_joint_hierarchy(EggNode *egg_node, PartGroup *part, int index) { //////////////////////////////////////////////////////////////////// void CharacterMaker:: parent_joint_nodes(PartGroup *part) { - if (part->is_of_type(CharacterJoint::get_class_type())) { + if (part->is_character_joint()) { CharacterJoint *joint = DCAST(CharacterJoint, part); PandaNode *joint_node = joint->_geom_node; if (joint_node != NULL) { diff --git a/panda/src/egg2pg/eggBinner.cxx b/panda/src/egg2pg/eggBinner.cxx index 89d5db08a6..f06cf04ff9 100644 --- a/panda/src/egg2pg/eggBinner.cxx +++ b/panda/src/egg2pg/eggBinner.cxx @@ -57,16 +57,7 @@ prepare_node(EggNode *node) { //////////////////////////////////////////////////////////////////// int EggBinner:: get_bin_number(const EggNode *node) { - if (node->is_of_type(EggNurbsSurface::get_class_type())) { - return (int)BN_nurbs_surface; - - } else if (node->is_of_type(EggNurbsCurve::get_class_type())) { - return (int)BN_nurbs_curve; - - } else if (node->is_of_type(EggPatch::get_class_type())) { - return (int)BN_patches; - - } else if (node->is_of_type(EggPrimitive::get_class_type())) { + if (node->is_of_type(EggPrimitive::get_class_type())) { return (int)BN_polyset; } else if (node->is_of_type(EggGroup::get_class_type())) { @@ -74,6 +65,15 @@ get_bin_number(const EggNode *node) { if (group->has_lod()) { return (int)BN_lod; } + + } else if (node->is_of_type(EggNurbsSurface::get_class_type())) { + return (int)BN_nurbs_surface; + + } else if (node->is_of_type(EggNurbsCurve::get_class_type())) { + return (int)BN_nurbs_curve; + + } else if (node->is_of_type(EggPatch::get_class_type())) { + return (int)BN_patches; } return (int)BN_none; diff --git a/panda/src/glstuff/glCgShaderContext_src.cxx b/panda/src/glstuff/glCgShaderContext_src.cxx index 643fa4299a..a2301e74a7 100644 --- a/panda/src/glstuff/glCgShaderContext_src.cxx +++ b/panda/src/glstuff/glCgShaderContext_src.cxx @@ -991,8 +991,8 @@ update_shader_texture_bindings(ShaderContext *prev) { // We get the TextureAttrib directly from the _target_rs, not the // filtered TextureAttrib in _target_texture. - const TextureAttrib *texattrib = DCAST(TextureAttrib, _glgsg->_target_rs->get_attrib_def(TextureAttrib::get_class_slot())); - nassertv(texattrib != (TextureAttrib *)NULL); + const TextureAttrib *texattrib; + _glgsg->_target_rs->get_attrib_def(texattrib); for (int i = 0; i < (int)_shader->_tex_spec.size(); ++i) { Shader::ShaderTexSpec &spec = _shader->_tex_spec[i]; @@ -1053,8 +1053,9 @@ update_shader_texture_bindings(ShaderContext *prev) { continue; } - _glgsg->apply_texture(tc); - _glgsg->apply_sampler(texunit, sampler, tc); + CLP(TextureContext) *gtc = (CLP(TextureContext) *)tc; + _glgsg->apply_texture(gtc); + _glgsg->apply_sampler(texunit, sampler, gtc); } cg_report_errors(); diff --git a/panda/src/glstuff/glGeomMunger_src.cxx b/panda/src/glstuff/glGeomMunger_src.cxx index 778fb71d95..7be5a50d50 100644 --- a/panda/src/glstuff/glGeomMunger_src.cxx +++ b/panda/src/glstuff/glGeomMunger_src.cxx @@ -26,8 +26,8 @@ ALLOC_DELETED_CHAIN_DEF(CLP(GeomMunger)); CLP(GeomMunger):: CLP(GeomMunger)(GraphicsStateGuardian *gsg, const RenderState *state) : StandardMunger(gsg, state, 4, NT_uint8, C_color), - _texture(DCAST(TextureAttrib, state->get_attrib(TextureAttrib::get_class_slot()))), - _tex_gen(DCAST(TexGenAttrib, state->get_attrib(TexGenAttrib::get_class_slot()))) + _texture((const TextureAttrib *)state->get_attrib(TextureAttrib::get_class_slot())), + _tex_gen((const TexGenAttrib *)state->get_attrib(TexGenAttrib::get_class_slot())) { // Set a callback to unregister ourselves when either the Texture or // the TexGen object gets deleted. @@ -475,7 +475,7 @@ premunge_geom_impl(CPT(Geom) &geom, CPT(GeomVertexData) &vertex_data) { //////////////////////////////////////////////////////////////////// int CLP(GeomMunger):: compare_to_impl(const GeomMunger *other) const { - const CLP(GeomMunger) *om = DCAST(CLP(GeomMunger), other); + const CLP(GeomMunger) *om = (CLP(GeomMunger) *)other; if (_texture != om->_texture) { return _texture < om->_texture ? -1 : 1; } @@ -499,7 +499,7 @@ compare_to_impl(const GeomMunger *other) const { //////////////////////////////////////////////////////////////////// int CLP(GeomMunger):: geom_compare_to_impl(const GeomMunger *other) const { - const CLP(GeomMunger) *om = DCAST(CLP(GeomMunger), other); + const CLP(GeomMunger) *om = (CLP(GeomMunger) *)other; #ifdef OPENGLES if (get_render_mode() != om->get_render_mode()) { return get_render_mode() < om->get_render_mode() ? -1 : 1; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 8ab2c7b872..89227ee1bf 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -4512,13 +4512,14 @@ prepare_texture(Texture *tex, int view) { //////////////////////////////////////////////////////////////////// bool CLP(GraphicsStateGuardian):: update_texture(TextureContext *tc, bool force) { - CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc); + CLP(TextureContext) *gtc; + DCAST_INTO_R(gtc, tc, false); if (gtc->was_image_modified() || !gtc->_has_storage) { PStatGPUTimer timer(this, _texture_update_pcollector); // If the texture image was modified, reload the texture. - apply_texture(tc); + apply_texture(gtc); Texture *tex = tc->get_texture(); if (gtc->was_properties_modified()) { @@ -4536,7 +4537,7 @@ update_texture(TextureContext *tc, bool force) { // If only the properties have been modified, we don't necessarily // need to reload the texture. - apply_texture(tc); + apply_texture(gtc); Texture *tex = tc->get_texture(); if (specify_texture(gtc, tex->get_default_sampler())) { @@ -9649,8 +9650,10 @@ update_standard_texture_bindings() { glDisable(target); continue; } - apply_texture(tc); - apply_sampler(i, _target_texture->get_on_sampler(stage), tc); + // Don't DCAST(); we already did the verification in update_texture. + CLP(TextureContext) *gtc = (CLP(TextureContext) *)tc; + apply_texture(gtc); + apply_sampler(i, _target_texture->get_on_sampler(stage), gtc); if (stage->involves_color_scale() && _color_scale_enabled) { LColor color = stage->get_color(); @@ -10487,9 +10490,7 @@ specify_texture(CLP(TextureContext) *gtc, const SamplerState &sampler) { // for rendering. //////////////////////////////////////////////////////////////////// bool CLP(GraphicsStateGuardian):: -apply_texture(TextureContext *tc) { - CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc); - +apply_texture(CLP(TextureContext) *gtc) { gtc->set_active(true); GLenum target = get_texture_target(gtc->get_texture()->get_texture_type()); if (target == GL_NONE) { @@ -10520,9 +10521,7 @@ apply_texture(TextureContext *tc) { // context instead. //////////////////////////////////////////////////////////////////// bool CLP(GraphicsStateGuardian):: -apply_sampler(GLuint unit, const SamplerState &sampler, TextureContext *tc) { - CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc); - +apply_sampler(GLuint unit, const SamplerState &sampler, CLP(TextureContext) *gtc) { #ifndef OPENGLES if (_supports_sampler_objects) { // We support sampler objects. Prepare the sampler object and @@ -10547,7 +10546,7 @@ apply_sampler(GLuint unit, const SamplerState &sampler, TextureContext *tc) { // texture and change the texture parameters if they don't match. if (gtc->_active_sampler != sampler) { _glActiveTexture(GL_TEXTURE0 + unit); - apply_texture(tc); + apply_texture(gtc); specify_texture(gtc, sampler); } } @@ -10555,7 +10554,7 @@ apply_sampler(GLuint unit, const SamplerState &sampler, TextureContext *tc) { if (sampler.uses_mipmaps() && !gtc->_uses_mipmaps) { // The texture wasn't created with mipmaps, but we are trying // to sample it with mipmaps. We will need to reload it. - apply_texture(tc); + apply_texture(gtc); gtc->mark_needs_reload(); bool okflag = upload_texture(gtc, false, true); if (!okflag) { diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 63c4cb8abd..f38dd5326c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -531,8 +531,8 @@ protected: #endif // NDEBUG bool specify_texture(CLP(TextureContext) *gtc, const SamplerState &sampler); - bool apply_texture(TextureContext *tc); - bool apply_sampler(GLuint unit, const SamplerState &sampler, TextureContext *tc); + bool apply_texture(CLP(TextureContext) *gtc); + bool apply_sampler(GLuint unit, const SamplerState &sampler, CLP(TextureContext) *gtc); bool upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps); bool upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, bool uses_mipmaps, int mipmap_bias, diff --git a/panda/src/gobj/geom.I b/panda/src/gobj/geom.I index 823e9798a4..b639041c85 100644 --- a/panda/src/gobj/geom.I +++ b/panda/src/gobj/geom.I @@ -832,7 +832,7 @@ get_modified() const { INLINE GeomContext *GeomPipelineReader:: prepare_now(PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg) const { - return ((Geom *)_object.p())->prepare_now(prepared_objects, gsg); + return ((Geom *)_object)->prepare_now(prepared_objects, gsg); } INLINE ostream & diff --git a/panda/src/gobj/geom.cxx b/panda/src/gobj/geom.cxx index fe82255c6e..40166e15bc 100644 --- a/panda/src/gobj/geom.cxx +++ b/panda/src/gobj/geom.cxx @@ -1897,7 +1897,7 @@ check_usage_hint() const { #ifdef DO_PIPELINING unref_delete((CycleData *)_cdata); #endif - Geom::CDWriter fresh_cdata(((Geom *)_object.p())->_cycler, + Geom::CDWriter fresh_cdata(((Geom *)_object)->_cycler, false, _current_thread); ((GeomPipelineReader *)this)->_cdata = fresh_cdata; #ifdef DO_PIPELINING @@ -1906,7 +1906,7 @@ check_usage_hint() const { if (!fresh_cdata->_got_usage_hint) { // The cache is still stale. We have to do the work of // freshening it. - ((Geom *)_object.p())->reset_usage_hint(fresh_cdata); + ((Geom *)_object)->reset_usage_hint(fresh_cdata); nassertv(fresh_cdata->_got_usage_hint); } diff --git a/panda/src/gobj/geom.h b/panda/src/gobj/geom.h index 5e5b269f10..e1acb5f465 100644 --- a/panda/src/gobj/geom.h +++ b/panda/src/gobj/geom.h @@ -397,6 +397,10 @@ private: // Class : GeomPipelineReader // Description : Encapsulates the data from a Geom, // pre-fetched for one stage of the pipeline. +// +// Does not hold a reference to the Geom. The caller +// must ensure that the Geom persists for at least the +// lifetime of the GeomPipelineReader. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_GOBJ GeomPipelineReader : public GeomEnums { public: @@ -434,7 +438,7 @@ public: bool force) const; private: - CPT(Geom) _object; + const Geom *_object; Thread *_current_thread; const Geom::CData *_cdata; diff --git a/panda/src/gobj/geomPrimitive.I b/panda/src/gobj/geomPrimitive.I index 9eb42022db..cbaede08be 100644 --- a/panda/src/gobj/geomPrimitive.I +++ b/panda/src/gobj/geomPrimitive.I @@ -107,8 +107,8 @@ is_composite() const { //////////////////////////////////////////////////////////////////// INLINE bool GeomPrimitive:: is_indexed() const { - GeomPrimitivePipelineReader reader(this, Thread::get_current_thread()); - return reader.is_indexed(); + CDReader cdata(_cycler); + return (!cdata->_vertices.is_null()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/mathutil/boundingVolume.cxx b/panda/src/mathutil/boundingVolume.cxx index 48ca7a8bab..de223c05bf 100644 --- a/panda/src/mathutil/boundingVolume.cxx +++ b/panda/src/mathutil/boundingVolume.cxx @@ -84,6 +84,18 @@ write(ostream &out, int indent_level) const { indent(out, indent_level) << *this << "\n"; } +//////////////////////////////////////////////////////////////////// +// Function: BoundingVolume::as_geometric_bounding_volume +// Access: Public, Virtual +// Description: Virtual downcast method. Returns this object as a +// pointer of the indicated type, if it is in fact that +// type. Returns NULL if it is not that type. +//////////////////////////////////////////////////////////////////// +GeometricBoundingVolume *BoundingVolume:: +as_geometric_bounding_volume() { + return NULL; +} + //////////////////////////////////////////////////////////////////// // Function: BoundingVolume::as_geometric_bounding_volume // Access: Public, Virtual diff --git a/panda/src/mathutil/boundingVolume.h b/panda/src/mathutil/boundingVolume.h index 3af3e7fa2d..ab6f02578f 100644 --- a/panda/src/mathutil/boundingVolume.h +++ b/panda/src/mathutil/boundingVolume.h @@ -112,6 +112,7 @@ PUBLISHED: }; public: + virtual GeometricBoundingVolume *as_geometric_bounding_volume(); virtual const GeometricBoundingVolume *as_geometric_bounding_volume() const; virtual const FiniteBoundingVolume *as_finite_bounding_volume() const; virtual const BoundingSphere *as_bounding_sphere() const; diff --git a/panda/src/mathutil/geometricBoundingVolume.cxx b/panda/src/mathutil/geometricBoundingVolume.cxx index 756f86dca0..829c705d85 100644 --- a/panda/src/mathutil/geometricBoundingVolume.cxx +++ b/panda/src/mathutil/geometricBoundingVolume.cxx @@ -19,7 +19,19 @@ TypeHandle GeometricBoundingVolume::_type_handle; //////////////////////////////////////////////////////////////////// // Function: GeometricBoundingVolume::as_geometric_bounding_volume -// Access: Public, Virtual +// Access: Public, Virtual, Final +// Description: Virtual downcast method. Returns this object as a +// pointer of the indicated type, if it is in fact that +// type. Returns NULL if it is not that type. +//////////////////////////////////////////////////////////////////// +GeometricBoundingVolume *GeometricBoundingVolume:: +as_geometric_bounding_volume() { + return this; +} + +//////////////////////////////////////////////////////////////////// +// Function: GeometricBoundingVolume::as_geometric_bounding_volume +// Access: Public, Virtual, Final // Description: Virtual downcast method. Returns this object as a // pointer of the indicated type, if it is in fact that // type. Returns NULL if it is not that type. diff --git a/panda/src/mathutil/geometricBoundingVolume.h b/panda/src/mathutil/geometricBoundingVolume.h index 4bd53591e3..a1e191285c 100644 --- a/panda/src/mathutil/geometricBoundingVolume.h +++ b/panda/src/mathutil/geometricBoundingVolume.h @@ -53,7 +53,8 @@ PUBLISHED: virtual void xform(const LMatrix4 &mat)=0; public: - virtual const GeometricBoundingVolume *as_geometric_bounding_volume() const; + virtual GeometricBoundingVolume *as_geometric_bounding_volume() FINAL; + virtual const GeometricBoundingVolume *as_geometric_bounding_volume() const FINAL; protected: // Some virtual functions to implement fundamental bounding diff --git a/panda/src/pgraph/alphaTestAttrib.cxx b/panda/src/pgraph/alphaTestAttrib.cxx index 8819fe74f0..b9f4531bc5 100644 --- a/panda/src/pgraph/alphaTestAttrib.cxx +++ b/panda/src/pgraph/alphaTestAttrib.cxx @@ -76,13 +76,13 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int AlphaTestAttrib:: compare_to_impl(const RenderAttrib *other) const { - const AlphaTestAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const AlphaTestAttrib *ta = (const AlphaTestAttrib *)other; + int compare_result = ((int)_mode - (int)ta->_mode) ; if (compare_result != 0) { return compare_result; } - + if (_reference_alpha != ta->_reference_alpha) { return _reference_alpha < ta->_reference_alpha ? -1 : 1; } diff --git a/panda/src/pgraph/alphaTestAttrib.h b/panda/src/pgraph/alphaTestAttrib.h index 2e3cf9e539..3714f39d9d 100644 --- a/panda/src/pgraph/alphaTestAttrib.h +++ b/panda/src/pgraph/alphaTestAttrib.h @@ -65,7 +65,7 @@ public: protected: static TypedWritable *make_from_bam(const FactoryParams ¶ms); void fillin(DatagramIterator &scan, BamReader *manager); - + public: static TypeHandle get_class_type() { return _type_handle; @@ -74,7 +74,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "AlphaTestAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new AlphaTestAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/antialiasAttrib.cxx b/panda/src/pgraph/antialiasAttrib.cxx index 54c41096f1..e2242f34be 100644 --- a/panda/src/pgraph/antialiasAttrib.cxx +++ b/panda/src/pgraph/antialiasAttrib.cxx @@ -75,11 +75,7 @@ make(unsigned short mode) { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) AntialiasAttrib:: make_default() { - if (default_antialias_enable) { - return return_new(new AntialiasAttrib(M_auto)); - } else { - return return_new(new AntialiasAttrib(M_none)); - } + return RenderAttribRegistry::quick_get_global_ptr()->get_slot_default(_attrib_slot); } //////////////////////////////////////////////////////////////////// @@ -146,8 +142,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int AntialiasAttrib:: compare_to_impl(const RenderAttrib *other) const { - const AntialiasAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const AntialiasAttrib *ta = (const AntialiasAttrib *)other; + if (_mode != ta->_mode) { return (int)_mode - (int)ta->_mode; } @@ -190,8 +186,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) AntialiasAttrib:: compose_impl(const RenderAttrib *other) const { - const AntialiasAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const AntialiasAttrib *ta = (const AntialiasAttrib *)other; unsigned short mode_type; unsigned short mode_quality; @@ -277,3 +272,26 @@ fillin(DatagramIterator &scan, BamReader *manager) { _mode = scan.get_uint16(); } + +//////////////////////////////////////////////////////////////////// +// Function: AntialiasAttrib::init_type +// Access: Public, Static +// Description: +//////////////////////////////////////////////////////////////////// +void AntialiasAttrib:: +init_type() { + RenderAttrib::init_type(); + register_type(_type_handle, "AntialiasAttrib", + RenderAttrib::get_class_type()); + + // This is defined here, since we have otherwise no guarantee that + // the config var has already been constructed by the time we call + // init_type() at static init time. + static ConfigVariableBool default_antialias_enable + ("default-antialias-enable", false, + PRC_DESC("Set this true to enable the M_auto antialiasing mode for all " + "nodes by default.")); + + _attrib_slot = register_slot(_type_handle, 100, + new AntialiasAttrib(default_antialias_enable ? M_auto : M_none)); +} diff --git a/panda/src/pgraph/antialiasAttrib.h b/panda/src/pgraph/antialiasAttrib.h index ae7fbfddb1..d975f60575 100644 --- a/panda/src/pgraph/antialiasAttrib.h +++ b/panda/src/pgraph/antialiasAttrib.h @@ -80,17 +80,12 @@ public: protected: static TypedWritable *make_from_bam(const FactoryParams ¶ms); void fillin(DatagramIterator &scan, BamReader *manager); - + public: static TypeHandle get_class_type() { return _type_handle; } - static void init_type() { - RenderAttrib::init_type(); - register_type(_type_handle, "AntialiasAttrib", - RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); - } + static void init_type(); virtual TypeHandle get_type() const { return get_class_type(); } diff --git a/panda/src/pgraph/audioVolumeAttrib.cxx b/panda/src/pgraph/audioVolumeAttrib.cxx index 05f546ad55..59c055f447 100644 --- a/panda/src/pgraph/audioVolumeAttrib.cxx +++ b/panda/src/pgraph/audioVolumeAttrib.cxx @@ -147,8 +147,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int AudioVolumeAttrib:: compare_to_impl(const RenderAttrib *other) const { - const AudioVolumeAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const AudioVolumeAttrib *ta = (const AudioVolumeAttrib *)other; if (_off != ta->_off) { return (int)_off - (int)ta->_off; @@ -198,8 +197,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) AudioVolumeAttrib:: compose_impl(const RenderAttrib *other) const { - const AudioVolumeAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const AudioVolumeAttrib *ta = (const AudioVolumeAttrib *)other; if (ta->is_off()) { return ta; @@ -223,8 +221,8 @@ invert_compose_impl(const RenderAttrib *other) const { if (is_off()) { return other; } - const AudioVolumeAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const AudioVolumeAttrib *ta = (const AudioVolumeAttrib *)other; + PN_stdfloat new_volume = _volume == 0.0f ? 1.0f : ta->_volume / _volume; AudioVolumeAttrib *attrib = new AudioVolumeAttrib(false, new_volume); diff --git a/panda/src/pgraph/audioVolumeAttrib.h b/panda/src/pgraph/audioVolumeAttrib.h index 5f616425a0..ebfab1077d 100644 --- a/panda/src/pgraph/audioVolumeAttrib.h +++ b/panda/src/pgraph/audioVolumeAttrib.h @@ -73,7 +73,7 @@ public: protected: static TypedWritable *make_from_bam(const FactoryParams ¶ms); void fillin(DatagramIterator &scan, BamReader *manager); - + public: static TypeHandle get_class_type() { return _type_handle; @@ -82,7 +82,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "AudioVolumeAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new AudioVolumeAttrib(false, 1)); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/auxBitplaneAttrib.cxx b/panda/src/pgraph/auxBitplaneAttrib.cxx index 2972bcd227..5f836a0b87 100644 --- a/panda/src/pgraph/auxBitplaneAttrib.cxx +++ b/panda/src/pgraph/auxBitplaneAttrib.cxx @@ -88,8 +88,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int AuxBitplaneAttrib:: compare_to_impl(const RenderAttrib *other) const { - const AuxBitplaneAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const AuxBitplaneAttrib *ta = (const AuxBitplaneAttrib *)other; + int compare_result = _outputs - ta->_outputs; if (compare_result != 0) { return compare_result; diff --git a/panda/src/pgraph/auxBitplaneAttrib.h b/panda/src/pgraph/auxBitplaneAttrib.h index 7c918db7bc..4285294f33 100644 --- a/panda/src/pgraph/auxBitplaneAttrib.h +++ b/panda/src/pgraph/auxBitplaneAttrib.h @@ -108,7 +108,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "AuxBitplaneAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new AuxBitplaneAttrib(0)); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/clipPlaneAttrib.h b/panda/src/pgraph/clipPlaneAttrib.h index f8651800b0..f6f6a05b96 100644 --- a/panda/src/pgraph/clipPlaneAttrib.h +++ b/panda/src/pgraph/clipPlaneAttrib.h @@ -148,7 +148,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ClipPlaneAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new ClipPlaneAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/colorAttrib.cxx b/panda/src/pgraph/colorAttrib.cxx index 9e0b299e13..9cb2095bc9 100644 --- a/panda/src/pgraph/colorAttrib.cxx +++ b/panda/src/pgraph/colorAttrib.cxx @@ -122,8 +122,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int ColorAttrib:: compare_to_impl(const RenderAttrib *other) const { - const ColorAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ColorAttrib *ta = (const ColorAttrib *)other; + if (_type != ta->_type) { return (int)_type - (int)ta->_type; } diff --git a/panda/src/pgraph/colorAttrib.h b/panda/src/pgraph/colorAttrib.h index c30131159a..8a7e70a6e1 100644 --- a/panda/src/pgraph/colorAttrib.h +++ b/panda/src/pgraph/colorAttrib.h @@ -86,7 +86,8 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ColorAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, + new ColorAttrib(T_off, LColor(1, 1, 1, 1))); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/colorBlendAttrib.cxx b/panda/src/pgraph/colorBlendAttrib.cxx index 2ad7bb5065..7c6c5aea23 100644 --- a/panda/src/pgraph/colorBlendAttrib.cxx +++ b/panda/src/pgraph/colorBlendAttrib.cxx @@ -113,8 +113,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int ColorBlendAttrib:: compare_to_impl(const RenderAttrib *other) const { - const ColorBlendAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ColorBlendAttrib *ta = (const ColorBlendAttrib *)other; if (_mode != ta->_mode) { return (int)_mode - (int)ta->_mode; diff --git a/panda/src/pgraph/colorBlendAttrib.h b/panda/src/pgraph/colorBlendAttrib.h index 85ee3b2164..dc2975985f 100644 --- a/panda/src/pgraph/colorBlendAttrib.h +++ b/panda/src/pgraph/colorBlendAttrib.h @@ -129,7 +129,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ColorBlendAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new ColorBlendAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/colorScaleAttrib.cxx b/panda/src/pgraph/colorScaleAttrib.cxx index 04d9db0b9b..dbdf0511cd 100644 --- a/panda/src/pgraph/colorScaleAttrib.cxx +++ b/panda/src/pgraph/colorScaleAttrib.cxx @@ -186,8 +186,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int ColorScaleAttrib:: compare_to_impl(const RenderAttrib *other) const { - const ColorScaleAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ColorScaleAttrib *ta = (const ColorScaleAttrib *)other; if (is_off() != ta->is_off()) { return (int)is_off() - (int)ta->is_off(); @@ -233,8 +232,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) ColorScaleAttrib:: compose_impl(const RenderAttrib *other) const { - const ColorScaleAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ColorScaleAttrib *ta = (const ColorScaleAttrib *)other; if (ta->is_off()) { return ta; @@ -263,8 +261,8 @@ invert_compose_impl(const RenderAttrib *other) const { if (is_off()) { return other; } - const ColorScaleAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ColorScaleAttrib *ta = (const ColorScaleAttrib *)other; + LVecBase4 new_scale(_scale[0] == 0.0f ? 1.0f : ta->_scale[0] / _scale[0], _scale[1] == 0.0f ? 1.0f : ta->_scale[1] / _scale[1], _scale[2] == 0.0f ? 1.0f : ta->_scale[2] / _scale[2], diff --git a/panda/src/pgraph/colorScaleAttrib.h b/panda/src/pgraph/colorScaleAttrib.h index ca947ec049..2fd09b5c3c 100644 --- a/panda/src/pgraph/colorScaleAttrib.h +++ b/panda/src/pgraph/colorScaleAttrib.h @@ -92,7 +92,8 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ColorScaleAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, + new ColorScaleAttrib(false, LVecBase4(1, 1, 1, 1))); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/colorWriteAttrib.cxx b/panda/src/pgraph/colorWriteAttrib.cxx index 66b7218e35..66e2ab329f 100644 --- a/panda/src/pgraph/colorWriteAttrib.cxx +++ b/panda/src/pgraph/colorWriteAttrib.cxx @@ -89,8 +89,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int ColorWriteAttrib:: compare_to_impl(const RenderAttrib *other) const { - const ColorWriteAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ColorWriteAttrib *ta = (const ColorWriteAttrib *)other; return (int)_channels - (int)ta->_channels; } diff --git a/panda/src/pgraph/colorWriteAttrib.h b/panda/src/pgraph/colorWriteAttrib.h index bb77709bc4..a9c4442e14 100644 --- a/panda/src/pgraph/colorWriteAttrib.h +++ b/panda/src/pgraph/colorWriteAttrib.h @@ -85,7 +85,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ColorWriteAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new ColorWriteAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index a79eb0c23d..2c879aba12 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/panda/src/pgraph/config_pgraph.cxx @@ -310,11 +310,6 @@ ConfigVariableInt max_lenses "this can be used as a simple sanity check. Set it larger or " "smaller to suit your needs.")); -ConfigVariableBool default_antialias_enable -("default-antialias-enable", false, - PRC_DESC("Set this true to enable the M_auto antialiasing mode for all " - "nodes by default.")); - ConfigVariableBool polylight_info ("polylight-info", false, PRC_DESC("Set this true to view some info statements regarding the polylight. " diff --git a/panda/src/pgraph/config_pgraph.h b/panda/src/pgraph/config_pgraph.h index a7158b5a86..876eae7485 100644 --- a/panda/src/pgraph/config_pgraph.h +++ b/panda/src/pgraph/config_pgraph.h @@ -58,7 +58,6 @@ extern EXPCL_PANDA_PGRAPH ConfigVariableBool premunge_data; extern ConfigVariableBool preserve_geom_nodes; extern ConfigVariableBool flatten_geoms; extern EXPCL_PANDA_PGRAPH ConfigVariableInt max_lenses; -extern ConfigVariableBool default_antialias_enable; extern ConfigVariableBool polylight_info; diff --git a/panda/src/pgraph/cullBinAttrib.cxx b/panda/src/pgraph/cullBinAttrib.cxx index 7b4773bfc7..3d7707b93e 100644 --- a/panda/src/pgraph/cullBinAttrib.cxx +++ b/panda/src/pgraph/cullBinAttrib.cxx @@ -84,8 +84,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int CullBinAttrib:: compare_to_impl(const RenderAttrib *other) const { - const CullBinAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const CullBinAttrib *ta = (const CullBinAttrib *)other; + if (_draw_order != ta->_draw_order) { return _draw_order - ta->_draw_order; } diff --git a/panda/src/pgraph/cullBinAttrib.h b/panda/src/pgraph/cullBinAttrib.h index 09430302fb..f1a0809caf 100644 --- a/panda/src/pgraph/cullBinAttrib.h +++ b/panda/src/pgraph/cullBinAttrib.h @@ -73,7 +73,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "CullBinAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new CullBinAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/cullFaceAttrib.cxx b/panda/src/pgraph/cullFaceAttrib.cxx index 88d9586081..8fa8b1c19b 100644 --- a/panda/src/pgraph/cullFaceAttrib.cxx +++ b/panda/src/pgraph/cullFaceAttrib.cxx @@ -154,8 +154,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int CullFaceAttrib:: compare_to_impl(const RenderAttrib *other) const { - const CullFaceAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const CullFaceAttrib *ta = (const CullFaceAttrib *)other; + if (_mode != ta->_mode) { return (int)_mode - (int)ta->_mode; } @@ -199,8 +199,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) CullFaceAttrib:: compose_impl(const RenderAttrib *other) const { - const CullFaceAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const CullFaceAttrib *ta = (const CullFaceAttrib *)other; if (!_reverse && ta->_mode != M_cull_unchanged) { // The normal case (there is nothing funny going on): the second @@ -231,8 +230,7 @@ compose_impl(const RenderAttrib *other) const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) CullFaceAttrib:: invert_compose_impl(const RenderAttrib *other) const { - const CullFaceAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const CullFaceAttrib *ta = (const CullFaceAttrib *)other; // The invert case is the same as the normal case, except that the // meaning of _reverse is inverted. See compose_impl(), above. diff --git a/panda/src/pgraph/cullFaceAttrib.h b/panda/src/pgraph/cullFaceAttrib.h index 54e55b4173..7ac2427e91 100644 --- a/panda/src/pgraph/cullFaceAttrib.h +++ b/panda/src/pgraph/cullFaceAttrib.h @@ -84,7 +84,8 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "CullFaceAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, + new CullFaceAttrib(M_cull_clockwise, false)); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/cullResult.cxx b/panda/src/pgraph/cullResult.cxx index 67a80b4c43..cd27cc29f5 100644 --- a/panda/src/pgraph/cullResult.cxx +++ b/panda/src/pgraph/cullResult.cxx @@ -237,9 +237,8 @@ add_object(CullableObject *object, const CullTraverser *traverser) { } // Check for a special wireframe setting. - const RenderModeAttrib *rmode = (const RenderModeAttrib *) - object->_state->get_attrib(RenderModeAttrib::get_class_slot()); - if (rmode != (const RenderModeAttrib *)NULL) { + const RenderModeAttrib *rmode; + if (object->_state->get_attrib(rmode)) { if (rmode->get_mode() == RenderModeAttrib::M_filled_wireframe) { CullableObject *wireframe_part = new CullableObject(*object); wireframe_part->_state = get_wireframe_overlay_state(rmode); diff --git a/panda/src/pgraph/cullTraverserData.cxx b/panda/src/pgraph/cullTraverserData.cxx index ce665e4806..2fc0f1665c 100644 --- a/panda/src/pgraph/cullTraverserData.cxx +++ b/panda/src/pgraph/cullTraverserData.cxx @@ -93,7 +93,9 @@ apply_transform_and_state(CullTraverser *trav, // Copy the bounding volumes for the frustums so we can // transform them. if (_view_frustum != (GeometricBoundingVolume *)NULL) { - _view_frustum = DCAST(GeometricBoundingVolume, _view_frustum->make_copy()); + _view_frustum = _view_frustum->make_copy()->as_geometric_bounding_volume(); + nassertv(_view_frustum != (GeometricBoundingVolume *)NULL); + _view_frustum->xform(inv_transform->get_mat()); } @@ -106,9 +108,9 @@ apply_transform_and_state(CullTraverser *trav, if (clip_plane_cull) { _cull_planes = _cull_planes->apply_state(trav, this, - DCAST(ClipPlaneAttrib, node_state->get_attrib(ClipPlaneAttrib::get_class_slot())), + (const ClipPlaneAttrib *)node_state->get_attrib(ClipPlaneAttrib::get_class_slot()), DCAST(ClipPlaneAttrib, off_clip_planes), - DCAST(OccluderEffect, node_effects->get_effect(OccluderEffect::get_class_type()))); + (const OccluderEffect *)node_effects->get_effect(OccluderEffect::get_class_type())); } } @@ -122,7 +124,8 @@ is_in_view_impl() { const GeometricBoundingVolume *node_gbv = NULL; if (_view_frustum != (GeometricBoundingVolume *)NULL) { - DCAST_INTO_R(node_gbv, _node_reader.get_bounds(), false) + node_gbv = _node_reader.get_bounds()->as_geometric_bounding_volume(); + nassertr(node_gbv != (const GeometricBoundingVolume *)NULL, false); int result = _view_frustum->contains(node_gbv); @@ -168,7 +171,8 @@ is_in_view_impl() { if (!_cull_planes->is_empty()) { if (node_gbv == (const GeometricBoundingVolume *)NULL) { - DCAST_INTO_R(node_gbv, _node_reader.get_bounds(), false) + node_gbv = _node_reader.get_bounds()->as_geometric_bounding_volume(); + nassertr(node_gbv != (const GeometricBoundingVolume *)NULL, false); } // Also cull against the current clip planes. diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index b842850db7..5ad7a9b5f2 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -140,8 +140,7 @@ munge_geom(GraphicsStateGuardianBase *gsg, } } - StateMunger *state_munger; - DCAST_INTO_R(state_munger, munger, false); + StateMunger *state_munger = (StateMunger *)munger; _state = state_munger->munge_state(_state); // If there is any animation left in the vertex data after it diff --git a/panda/src/pgraph/depthOffsetAttrib.cxx b/panda/src/pgraph/depthOffsetAttrib.cxx index f30fd68266..8861947048 100644 --- a/panda/src/pgraph/depthOffsetAttrib.cxx +++ b/panda/src/pgraph/depthOffsetAttrib.cxx @@ -95,8 +95,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int DepthOffsetAttrib:: compare_to_impl(const RenderAttrib *other) const { - const DepthOffsetAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const DepthOffsetAttrib *ta = (const DepthOffsetAttrib *)other; + if (_offset != ta->_offset) { return _offset - ta->_offset; } @@ -147,8 +147,8 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) DepthOffsetAttrib:: compose_impl(const RenderAttrib *other) const { - const DepthOffsetAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const DepthOffsetAttrib *ta = (const DepthOffsetAttrib *)other; + int new_offset = ta->_offset + _offset; DepthOffsetAttrib *attrib = new DepthOffsetAttrib(new_offset, ta->_min_value, ta->_max_value); @@ -166,8 +166,8 @@ compose_impl(const RenderAttrib *other) const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) DepthOffsetAttrib:: invert_compose_impl(const RenderAttrib *other) const { - const DepthOffsetAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const DepthOffsetAttrib *ta = (const DepthOffsetAttrib *)other; + int new_offset = ta->_offset - _offset; DepthOffsetAttrib *attrib = new DepthOffsetAttrib(new_offset, ta->_min_value, ta->_max_value); diff --git a/panda/src/pgraph/depthOffsetAttrib.h b/panda/src/pgraph/depthOffsetAttrib.h index 8ff94e8c2c..626d24707f 100644 --- a/panda/src/pgraph/depthOffsetAttrib.h +++ b/panda/src/pgraph/depthOffsetAttrib.h @@ -107,7 +107,8 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "DepthOffsetAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, + new DepthOffsetAttrib(0, 0, 1)); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/depthTestAttrib.cxx b/panda/src/pgraph/depthTestAttrib.cxx index 2c80d010af..f1cb49a429 100644 --- a/panda/src/pgraph/depthTestAttrib.cxx +++ b/panda/src/pgraph/depthTestAttrib.cxx @@ -74,8 +74,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int DepthTestAttrib:: compare_to_impl(const RenderAttrib *other) const { - const DepthTestAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const DepthTestAttrib *ta = (const DepthTestAttrib *)other; + return (int)_mode - (int)ta->_mode; } diff --git a/panda/src/pgraph/depthTestAttrib.h b/panda/src/pgraph/depthTestAttrib.h index a2cea148c7..373fd48723 100644 --- a/panda/src/pgraph/depthTestAttrib.h +++ b/panda/src/pgraph/depthTestAttrib.h @@ -69,7 +69,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "DepthTestAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new DepthTestAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/depthWriteAttrib.cxx b/panda/src/pgraph/depthWriteAttrib.cxx index 8aaa94159e..db0d724a54 100644 --- a/panda/src/pgraph/depthWriteAttrib.cxx +++ b/panda/src/pgraph/depthWriteAttrib.cxx @@ -81,8 +81,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int DepthWriteAttrib:: compare_to_impl(const RenderAttrib *other) const { - const DepthWriteAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const DepthWriteAttrib *ta = (const DepthWriteAttrib *)other; + return (int)_mode - (int)ta->_mode; } diff --git a/panda/src/pgraph/depthWriteAttrib.h b/panda/src/pgraph/depthWriteAttrib.h index a9e601a971..9b6af606a5 100644 --- a/panda/src/pgraph/depthWriteAttrib.h +++ b/panda/src/pgraph/depthWriteAttrib.h @@ -75,7 +75,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "DepthWriteAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new DepthWriteAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/fogAttrib.cxx b/panda/src/pgraph/fogAttrib.cxx index 4c0cd2e0cf..c830277651 100644 --- a/panda/src/pgraph/fogAttrib.cxx +++ b/panda/src/pgraph/fogAttrib.cxx @@ -91,8 +91,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int FogAttrib:: compare_to_impl(const RenderAttrib *other) const { - const FogAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const FogAttrib *ta = (const FogAttrib *)other; // Comparing pointers by subtraction is problematic. Instead of // doing this, we'll just depend on the built-in != and < operators diff --git a/panda/src/pgraph/fogAttrib.h b/panda/src/pgraph/fogAttrib.h index 99afd79cde..0b93e24126 100644 --- a/panda/src/pgraph/fogAttrib.h +++ b/panda/src/pgraph/fogAttrib.h @@ -72,7 +72,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "FogAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new FogAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/lightAttrib.cxx b/panda/src/pgraph/lightAttrib.cxx index 4a0f0f2fe1..c063746824 100644 --- a/panda/src/pgraph/lightAttrib.cxx +++ b/panda/src/pgraph/lightAttrib.cxx @@ -696,8 +696,7 @@ write(ostream &out, int indent_level) const { //////////////////////////////////////////////////////////////////// int LightAttrib:: compare_to_impl(const RenderAttrib *other) const { - const LightAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const LightAttrib *ta = (const LightAttrib *)other; if (_off_all_lights != ta->_off_all_lights) { return (int)_off_all_lights - (int)ta->_off_all_lights; @@ -803,8 +802,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) LightAttrib:: compose_impl(const RenderAttrib *other) const { - const LightAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const LightAttrib *ta = (const LightAttrib *)other; if (ta->_off_all_lights) { // If the other type turns off all lights, it doesn't matter what diff --git a/panda/src/pgraph/lightAttrib.h b/panda/src/pgraph/lightAttrib.h index 393e5436b6..af45e5570f 100644 --- a/panda/src/pgraph/lightAttrib.h +++ b/panda/src/pgraph/lightAttrib.h @@ -162,7 +162,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "LightAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 20, make_default); + _attrib_slot = register_slot(_type_handle, 20, new LightAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/lightRampAttrib.cxx b/panda/src/pgraph/lightRampAttrib.cxx index 399754a69c..3f9c15cfbb 100644 --- a/panda/src/pgraph/lightRampAttrib.cxx +++ b/panda/src/pgraph/lightRampAttrib.cxx @@ -241,8 +241,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int LightRampAttrib:: compare_to_impl(const RenderAttrib *other) const { - const LightRampAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const LightRampAttrib *ta = (const LightRampAttrib *)other; + int compare_result = ((int)_mode - (int)ta->_mode) ; if (compare_result != 0) { return compare_result; diff --git a/panda/src/pgraph/lightRampAttrib.h b/panda/src/pgraph/lightRampAttrib.h index 1fc427c1ea..bb7236cd3f 100644 --- a/panda/src/pgraph/lightRampAttrib.h +++ b/panda/src/pgraph/lightRampAttrib.h @@ -95,7 +95,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "LightRampAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new LightRampAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/materialAttrib.cxx b/panda/src/pgraph/materialAttrib.cxx index 26912d6d09..d77c47a969 100644 --- a/panda/src/pgraph/materialAttrib.cxx +++ b/panda/src/pgraph/materialAttrib.cxx @@ -92,8 +92,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int MaterialAttrib:: compare_to_impl(const RenderAttrib *other) const { - const MaterialAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const MaterialAttrib *ta = (const MaterialAttrib *)other; // Comparing pointers by subtraction is problematic. Instead of // doing this, we'll just depend on the built-in != and < operators diff --git a/panda/src/pgraph/materialAttrib.h b/panda/src/pgraph/materialAttrib.h index 5272375852..f43ec7e07c 100644 --- a/panda/src/pgraph/materialAttrib.h +++ b/panda/src/pgraph/materialAttrib.h @@ -75,7 +75,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "MaterialAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new MaterialAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/renderAttrib.I b/panda/src/pgraph/renderAttrib.I index a32e666c3c..91ab7332a0 100644 --- a/panda/src/pgraph/renderAttrib.I +++ b/panda/src/pgraph/renderAttrib.I @@ -49,20 +49,6 @@ invert_compose(const RenderAttrib *other) const { return invert_compose_impl(other); } -//////////////////////////////////////////////////////////////////// -// Function: RenderAttrib::always_reissue -// Access: Public -// Description: Returns true if the RenderAttrib should be reissued -// to the GSG with every state change, even if it is the -// same pointer as it was before; or false for the -// normal case, to reissue only when the RenderAttrib -// pointer changes. -//////////////////////////////////////////////////////////////////// -INLINE bool RenderAttrib:: -always_reissue() const { - return _always_reissue; -} - //////////////////////////////////////////////////////////////////// // Function: RenderAttrib::compare_to // Access: Published @@ -160,8 +146,7 @@ calc_hash() { // number. See RenderAttribRegistry. //////////////////////////////////////////////////////////////////// INLINE int RenderAttrib:: -register_slot(TypeHandle type_handle, int sort, - RenderAttribRegistry::MakeDefaultFunc *make_default_func) { +register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib) { RenderAttribRegistry *reg = RenderAttribRegistry::get_global_ptr(); - return reg->register_slot(type_handle, sort, make_default_func); + return reg->register_slot(type_handle, sort, default_attrib); } diff --git a/panda/src/pgraph/renderAttrib.cxx b/panda/src/pgraph/renderAttrib.cxx index 419a9094c9..c7397d0429 100644 --- a/panda/src/pgraph/renderAttrib.cxx +++ b/panda/src/pgraph/renderAttrib.cxx @@ -38,8 +38,6 @@ RenderAttrib() { init_attribs(); } _saved_entry = -1; - - _always_reissue = false; } //////////////////////////////////////////////////////////////////// @@ -435,13 +433,14 @@ return_unique(RenderAttrib *attrib) { return attrib; } - // Save the attrib in a local PointerTo so that it will be freed at - // the end of this function if no one else uses it. - CPT(RenderAttrib) pt_attrib = attrib; - int si = _attribs->find(attrib); if (si != -1) { // There's an equivalent attrib already in the set. Return it. + // If this is a newly created RenderAttrib, though, be sure to + // delete it. + if (attrib->get_ref_count() == 0) { + delete attrib; + } return _attribs->get_key(si); } @@ -456,7 +455,7 @@ return_unique(RenderAttrib *attrib) { // Save the index and return the input attrib. attrib->_saved_entry = si; - return pt_attrib; + return attrib; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/renderAttrib.h b/panda/src/pgraph/renderAttrib.h index d3d9c67c40..92386cba1e 100644 --- a/panda/src/pgraph/renderAttrib.h +++ b/panda/src/pgraph/renderAttrib.h @@ -73,8 +73,6 @@ PUBLISHED: virtual bool lower_attrib_can_override() const; public: - INLINE bool always_reissue() const; - virtual bool has_cull_callback() const; virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const; @@ -190,14 +188,11 @@ protected: public: INLINE static int register_slot(TypeHandle type_handle, int sort, - RenderAttribRegistry::MakeDefaultFunc *make_default_func); + RenderAttrib *default_attrib); private: void release_new(); -protected: - bool _always_reissue; - public: static void init_attribs(); @@ -218,6 +213,8 @@ private: static PStatCollector _garbage_collect_pcollector; + friend class RenderAttribRegistry; + public: virtual void write_datagram(BamWriter *manager, Datagram &dg); static TypedWritable *change_this(TypedWritable *old_ptr, BamReader *manager); diff --git a/panda/src/pgraph/renderAttribRegistry.I b/panda/src/pgraph/renderAttribRegistry.I index ba8da15691..6b3da8d567 100644 --- a/panda/src/pgraph/renderAttribRegistry.I +++ b/panda/src/pgraph/renderAttribRegistry.I @@ -30,7 +30,7 @@ get_slot(TypeHandle type_handle) const { //////////////////////////////////////////////////////////////////// // Function: RenderAttribRegistry::get_max_slots -// Access: Published +// Access: Published, Static // Description: Returns the maximum number that any slot number is // allowed to grow. Actually, this number will be one // higher than the highest possible slot number. This @@ -41,8 +41,8 @@ get_slot(TypeHandle type_handle) const { // This number will not change during the lifetime of // the application. //////////////////////////////////////////////////////////////////// -INLINE int RenderAttribRegistry:: -get_max_slots() const { +CONSTEXPR int RenderAttribRegistry:: +get_max_slots() { return _max_slots; } @@ -80,6 +80,20 @@ get_slot_sort(int slot) const { return _registry[slot]._sort; } +//////////////////////////////////////////////////////////////////// +// Function: RenderAttribRegistry::get_slot_default +// Access: Published +// Description: Returns the default RenderAttrib object associated +// with slot n. This is the attrib that should be +// applied in the absence of any other attrib of this +// type. +//////////////////////////////////////////////////////////////////// +INLINE const RenderAttrib *RenderAttribRegistry:: +get_slot_default(int slot) const { + nassertr(slot >= 0 && slot < (int)_registry.size(), 0); + return _registry[slot]._default_attrib; +} + //////////////////////////////////////////////////////////////////// // Function: RenderAttribRegistry::get_num_sorted_slots // Access: Published @@ -104,18 +118,6 @@ get_sorted_slot(int n) const { return _sorted_slots[n]; } -//////////////////////////////////////////////////////////////////// -// Function: RenderAttribRegistry::get_array_chain -// Access: Published -// Description: Returns the DeletedBufferChain object that may be -// used to allocated appropriately-sized arrays of -// RenderState::Attribute objects. -//////////////////////////////////////////////////////////////////// -INLINE DeletedBufferChain *RenderAttribRegistry:: -get_array_chain() const { - return _array_chain; -} - //////////////////////////////////////////////////////////////////// // Function: RenderAttribRegistry::get_global_ptr // Access: Published, Static @@ -154,9 +156,21 @@ SortSlots(RenderAttribRegistry *reg) : _reg(reg) { //////////////////////////////////////////////////////////////////// // Function: RenderAttribRegistry::SortSlots::operator () // Access: Public -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE bool RenderAttribRegistry::SortSlots:: operator () (int a, int b) const { return _reg->get_slot_sort(a) < _reg->get_slot_sort(b); } + +//////////////////////////////////////////////////////////////////// +// Function: RenderAttribRegistry::RegistryNode::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE RenderAttribRegistry::RegistryNode:: +RegistryNode(TypeHandle type, int sort, const RenderAttrib *default_attrib) : + _type(type), + _sort(sort), + _default_attrib(default_attrib) { +} diff --git a/panda/src/pgraph/renderAttribRegistry.cxx b/panda/src/pgraph/renderAttribRegistry.cxx index 7dd633fb0e..fc7f8d1076 100644 --- a/panda/src/pgraph/renderAttribRegistry.cxx +++ b/panda/src/pgraph/renderAttribRegistry.cxx @@ -26,37 +26,12 @@ RenderAttribRegistry *RenderAttribRegistry::_global_ptr; //////////////////////////////////////////////////////////////////// RenderAttribRegistry:: RenderAttribRegistry() { - ConfigVariableInt max_attribs - ("max-attribs", SlotMask::get_max_num_bits(), - PRC_DESC("This specifies the maximum number of different RenderAttrib " - "types that may be defined at runtime. Normally you should " - "never need to change this, but if the default value is too " - "low for the number of attribs that Panda actually defines, " - "you may need to raise this number.")); - - // Assign this number once, at startup, and never change it again. - _max_slots = max((int)max_attribs, 1); - if (_max_slots > SlotMask::get_max_num_bits()) { - pgraph_cat->warning() - << "Value for max-attribs too large: cannot exceed " - << SlotMask::get_max_num_bits() - << " in this build. To raise this limit, change the typedef " - << "for SlotMask in renderAttribRegistry.h and recompile.\n"; - - _max_slots = SlotMask::get_max_num_bits(); - } - - // Get a DeletedBufferChain to manage the arrays of RenderAttribs that are - // allocated within each RenderState object. - init_memory_hook(); - _array_chain = memory_hook->get_deleted_chain(_max_slots * sizeof(RenderState::Attribute)); + _registry.reserve(_max_slots); + _sorted_slots.reserve(_max_slots); // Reserve slot 0 for TypeHandle::none(), and for types that exceed // max_slots. - RegistryNode node; - node._sort = 0; - node._make_default_func = NULL; - _registry.push_back(node); + _registry.push_back(RegistryNode(TypeHandle::none(), 0, NULL)); } //////////////////////////////////////////////////////////////////// @@ -86,9 +61,9 @@ RenderAttribRegistry:: // RenderAttribs (that is, those which are more // expensive to change) have lower sort values. // -// The make_default_func pointer is a function that may -// be called to generate a default RenderAttrib to apply -// in the absence of any other attrib of this type. +// The default_attrib pointer should be a newly +// created instance of this attribute that represents +// the default state for this attribute. // // register_slot() is intended to be called at // application start for each different RenderAttrib @@ -96,8 +71,11 @@ RenderAttribRegistry:: // slot number to each one. //////////////////////////////////////////////////////////////////// int RenderAttribRegistry:: -register_slot(TypeHandle type_handle, int sort, - RenderAttribRegistry::MakeDefaultFunc *make_default_func) { +register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib) { + // Sanity check; if this triggers, you either passed a wrong argument, + // or you didn't use the type system correctly. + nassertr(default_attrib->get_type() == type_handle, 0); + int type_index = type_handle.get_index(); while (type_index >= (int)_slots_by_type.size()) { _slots_by_type.push_back(0); @@ -111,19 +89,33 @@ register_slot(TypeHandle type_handle, int sort, int slot = (int)_registry.size(); if (slot >= _max_slots) { pgraph_cat->error() - << "Too many registered RenderAttribs; not registering " + << "Too many registered RenderAttribs; not registering " << type_handle << "\n"; nassertr(false, 0); return 0; } + // Register the default attribute. We don't use return_unique and + // register it even if the state cache is disabled, because we can't read + // the state_cache config variable yet at this time. It probably doesn't + // hurt to have these 32 entries around in the attrib cache. + if (default_attrib != (RenderAttrib *)NULL) { + default_attrib->calc_hash(); + + if (default_attrib->_saved_entry == -1) { + // If this attribute was already registered, something odd is going on. + nassertr(RenderAttrib::_attribs->find(default_attrib) == -1, 0); + default_attrib->_saved_entry = + RenderAttrib::_attribs->store(default_attrib, RenderAttrib::Empty()); + } + + // It effectively lives forever. Might as well make it official. + default_attrib->local_object(); + } + _slots_by_type[type_index] = slot; - RegistryNode node; - node._type = type_handle; - node._sort = sort; - node._make_default_func = make_default_func; - _registry.push_back(node); + _registry.push_back(RegistryNode(type_handle, sort, default_attrib)); _sorted_slots.push_back(slot); ::sort(_sorted_slots.begin(), _sorted_slots.end(), SortSlots(this)); @@ -143,27 +135,12 @@ set_slot_sort(int slot, int sort) { // Re-sort the slot list. _sorted_slots.clear(); - _sorted_slots.reserve(_registry.size() - 1); for (int i = 1; i < (int)_registry.size(); ++i) { _sorted_slots.push_back(i); } ::sort(_sorted_slots.begin(), _sorted_slots.end(), SortSlots(this)); } -//////////////////////////////////////////////////////////////////// -// Function: RenderAttribRegistry::get_slot_default -// Access: Published -// Description: Returns the default RenderAttrib object associated -// with slot n. This is the attrib that should be -// applied in the absence of any other attrib of this -// type. -//////////////////////////////////////////////////////////////////// -CPT(RenderAttrib) RenderAttribRegistry:: -get_slot_default(int slot) const { - nassertr(slot >= 0 && slot < (int)_registry.size(), 0); - return (*_registry[slot]._make_default_func)(); -} - //////////////////////////////////////////////////////////////////// // Function: RenderAttribRegistry::init_global_ptr // Access: Private, Static diff --git a/panda/src/pgraph/renderAttribRegistry.h b/panda/src/pgraph/renderAttribRegistry.h index 207171c505..7c8f049ddb 100644 --- a/panda/src/pgraph/renderAttribRegistry.h +++ b/panda/src/pgraph/renderAttribRegistry.h @@ -48,24 +48,26 @@ public: // or a DoubleBitMask will be faster on a 32-bit machine. typedef BitMask32 SlotMask; + // Raise this number whenever we add a new attrib. This used to be + // determined at runtime, but it's better to have it as a constexpr. + static const int _max_slots = 29; + int register_slot(TypeHandle type_handle, int sort, - MakeDefaultFunc *make_default_func); + RenderAttrib *default_attrib); PUBLISHED: INLINE int get_slot(TypeHandle type_handle) const; - INLINE int get_max_slots() const; + static CONSTEXPR int get_max_slots(); INLINE int get_num_slots() const; INLINE TypeHandle get_slot_type(int slot) const; INLINE int get_slot_sort(int slot) const; void set_slot_sort(int slot, int sort); - CPT(RenderAttrib) get_slot_default(int slot) const; + INLINE const RenderAttrib *get_slot_default(int slot) const; INLINE int get_num_sorted_slots() const; INLINE int get_sorted_slot(int n) const; - INLINE DeletedBufferChain *get_array_chain() const; - INLINE static RenderAttribRegistry *get_global_ptr(); public: @@ -75,8 +77,6 @@ private: static void init_global_ptr(); private: - int _max_slots; - class SortSlots { public: INLINE SortSlots(RenderAttribRegistry *reg); @@ -86,9 +86,12 @@ private: class RegistryNode { public: + INLINE RegistryNode(TypeHandle type, int sort, + const RenderAttrib *default_attrib); + TypeHandle _type; int _sort; - MakeDefaultFunc *_make_default_func; + const RenderAttrib *_default_attrib; }; typedef pvector Registry; Registry _registry; @@ -96,12 +99,9 @@ private: vector_int _slots_by_type; vector_int _sorted_slots; - DeletedBufferChain *_array_chain; - static RenderAttribRegistry *_global_ptr; }; #include "renderAttribRegistry.I" #endif - diff --git a/panda/src/pgraph/renderModeAttrib.cxx b/panda/src/pgraph/renderModeAttrib.cxx index cb91cdcf6e..83a3fe9282 100644 --- a/panda/src/pgraph/renderModeAttrib.cxx +++ b/panda/src/pgraph/renderModeAttrib.cxx @@ -128,8 +128,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int RenderModeAttrib:: compare_to_impl(const RenderAttrib *other) const { - const RenderModeAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const RenderModeAttrib *ta = (const RenderModeAttrib *)other; + if (_mode != ta->_mode) { return (int)_mode - (int)ta->_mode; } @@ -186,8 +186,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) RenderModeAttrib:: compose_impl(const RenderAttrib *other) const { - const RenderModeAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const RenderModeAttrib *ta = (const RenderModeAttrib *)other; // The special mode M_unchanged means to keep the current mode. Mode mode = ta->get_mode(); diff --git a/panda/src/pgraph/renderModeAttrib.h b/panda/src/pgraph/renderModeAttrib.h index 401b1d0152..1003abc328 100644 --- a/panda/src/pgraph/renderModeAttrib.h +++ b/panda/src/pgraph/renderModeAttrib.h @@ -106,7 +106,8 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "RenderModeAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, + new RenderModeAttrib(M_filled, 1, false)); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/renderState.I b/panda/src/pgraph/renderState.I index 6bce566751..bc7bbad4fe 100644 --- a/panda/src/pgraph/renderState.I +++ b/panda/src/pgraph/renderState.I @@ -58,35 +58,9 @@ has_cull_callback() const { //////////////////////////////////////////////////////////////////// INLINE CPT(RenderState) RenderState:: make_empty() { - // The empty state is asked for so often, we make it a special case - // and store a pointer forever once we find it the first time. - if (_empty_state == (RenderState *)NULL) { - RenderState *state = new RenderState; - _empty_state = return_unique(state); - } - return _empty_state; } -//////////////////////////////////////////////////////////////////// -// Function: RenderState::make_full_default -// Access: Published, Static -// Description: Returns a RenderState with all possible attributes -// set to their default value. -//////////////////////////////////////////////////////////////////// -INLINE CPT(RenderState) RenderState:: -make_full_default() { - // The empty state is asked for so often, we make it a special case - // and store a pointer forever once we find it the first time. - if (_full_default_state == (RenderState *)NULL) { - RenderState *state = new RenderState; - state->fill_default(); - _full_default_state = return_unique(state); - } - - return _full_default_state; -} - //////////////////////////////////////////////////////////////////// // Function: RenderState::remove_attrib // Access: Published @@ -144,7 +118,7 @@ get_attrib(TypeHandle type) const { // index, or NULL if there is no such RenderAttrib in // the state. //////////////////////////////////////////////////////////////////// -INLINE const RenderAttrib *RenderState:: +ALWAYS_INLINE const RenderAttrib *RenderState:: get_attrib(int slot) const { return _attributes[slot]._attrib; } @@ -161,7 +135,8 @@ get_attrib_def(int slot) const { if (_attributes[slot]._attrib != (RenderAttrib *)NULL) { return _attributes[slot]._attrib; } - return make_full_default()->get_attrib(slot); + RenderAttribRegistry *reg = RenderAttribRegistry::quick_get_global_ptr(); + return reg->get_slot_default(slot); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/renderState.cxx b/panda/src/pgraph/renderState.cxx index a7cf3ecddc..69a5f502f7 100644 --- a/panda/src/pgraph/renderState.cxx +++ b/panda/src/pgraph/renderState.cxx @@ -40,8 +40,7 @@ LightReMutex *RenderState::_states_lock = NULL; RenderState::States *RenderState::_states = NULL; -CPT(RenderState) RenderState::_empty_state; -CPT(RenderState) RenderState::_full_default_state; +const RenderState *RenderState::_empty_state = NULL; UpdateSeq RenderState::_last_cycle_detect; int RenderState::_garbage_index = 0; @@ -72,20 +71,11 @@ RenderState() : _auto_shader_state(NULL), _lock("RenderState") { - // Allocate the _attributes array. - RenderAttribRegistry *reg = RenderAttribRegistry::get_global_ptr(); - _attributes = (Attribute *)reg->get_array_chain()->allocate(reg->get_max_slots() * sizeof(Attribute), get_class_type()); - - // Also make sure each element gets initialized. - for (int i = 0; i < reg->get_max_slots(); ++i) { - new(&_attributes[i]) Attribute(); - } - if (_states == (States *)NULL) { init_states(); } _saved_entry = -1; - _last_mi = _mungers.end(); + _last_mi = -1; _cache_stats.add_num_states(1); _read_overrides = NULL; _generated_shader = NULL; @@ -103,17 +93,13 @@ RenderState(const RenderState ©) : _auto_shader_state(NULL), _lock("RenderState") { - // Allocate the _attributes array. - RenderAttribRegistry *reg = RenderAttribRegistry::get_global_ptr(); - _attributes = (Attribute *)reg->get_array_chain()->allocate(reg->get_max_slots() * sizeof(Attribute), get_class_type()); - - // Also make sure each element gets initialized, as a copy. - for (int i = 0; i < reg->get_max_slots(); ++i) { - new(&_attributes[i]) Attribute(copy._attributes[i]); + // Copy over the attributes. + for (int i = 0; i < RenderAttribRegistry::_max_slots; ++i) { + _attributes[i] = copy._attributes[i]; } _saved_entry = -1; - _last_mi = _mungers.end(); + _last_mi = -1; _cache_stats.add_num_states(1); _read_overrides = NULL; _generated_shader = NULL; @@ -159,14 +145,6 @@ RenderState:: // longer true now, probably we've been double-deleted. nassertv(get_ref_count() == 0); _cache_stats.add_num_states(-1); - - // Free the _attributes array. - RenderAttribRegistry *reg = RenderAttribRegistry::get_global_ptr(); - for (int i = 0; i < reg->get_max_slots(); ++i) { - _attributes[i].~Attribute(); - } - reg->get_array_chain()->deallocate(_attributes, get_class_type()); - _attributes = NULL; } //////////////////////////////////////////////////////////////////// @@ -360,7 +338,7 @@ make(const RenderAttrib *attrib1, CPT(RenderState) RenderState:: make(const RenderAttrib * const *attrib, int num_attribs, int override) { if (num_attribs == 0) { - return make_empty(); + return _empty_state; } RenderState *state = new RenderState; for (int i = 0; i < num_attribs; i++) { @@ -490,7 +468,7 @@ invert_compose(const RenderState *other) const { if (other == this) { // a->invert_compose(a) always produces identity. - return make_empty(); + return _empty_state; } if (!state_cache) { @@ -633,7 +611,7 @@ remove_attrib(int slot) const { // Will this bring us down to the empty state? if (_filled_slots.get_num_on_bits() == 1) { - return make_empty(); + return _empty_state; } RenderState *new_state = new RenderState(*this); @@ -1110,7 +1088,7 @@ clear_munger_cache() { } RenderState *state = (RenderState *)(_states->get_key(si)); state->_mungers.clear(); - state->_last_mi = state->_mungers.end(); + state->_last_mi = -1; } } @@ -1314,17 +1292,17 @@ validate_states() { //////////////////////////////////////////////////////////////////// int RenderState:: get_geom_rendering(int geom_rendering) const { - const RenderModeAttrib *render_mode = DCAST(RenderModeAttrib, get_attrib(RenderModeAttrib::get_class_slot())); - const TexGenAttrib *tex_gen = DCAST(TexGenAttrib, get_attrib(TexGenAttrib::get_class_slot())); - const TexMatrixAttrib *tex_matrix = DCAST(TexMatrixAttrib, get_attrib(TexMatrixAttrib::get_class_slot())); + const RenderModeAttrib *render_mode; + const TexGenAttrib *tex_gen; + const TexMatrixAttrib *tex_matrix; - if (render_mode != (const RenderModeAttrib *)NULL) { + if (get_attrib(render_mode)) { geom_rendering = render_mode->get_geom_rendering(geom_rendering); } - if (tex_gen != (const TexGenAttrib *)NULL) { + if (get_attrib(tex_gen)) { geom_rendering = tex_gen->get_geom_rendering(geom_rendering); } - if (tex_matrix != (const TexMatrixAttrib *)NULL) { + if (get_attrib(tex_matrix)) { geom_rendering = tex_matrix->get_geom_rendering(geom_rendering); } @@ -1507,7 +1485,7 @@ return_new(RenderState *state) { //////////////////////////////////////////////////////////////////// CPT(RenderState) RenderState:: return_unique(RenderState *state) { - nassertr(state != (RenderState *)NULL, state); + nassertr(state != (RenderState *)NULL, NULL); if (!state_cache) { return state; @@ -1523,14 +1501,10 @@ return_unique(RenderState *state) { if (state->_saved_entry != -1) { // This state is already in the cache. - //nassertr(_states->find(state) == state->_saved_entry, state); + //nassertr(_states->find(state) == state->_saved_entry, pt_state); return state; } - // Save the state in a local PointerTo so that it will be freed at - // the end of this function if no one else uses it. - CPT(RenderState) pt_state = state; - // Ensure each of the individual attrib pointers has been uniquified // before we add the state to the cache. if (!uniquify_attribs && !state->is_empty()) { @@ -1538,7 +1512,7 @@ return_unique(RenderState *state) { int slot = mask.get_lowest_on_bit(); while (slot >= 0) { Attribute &attrib = state->_attributes[slot]; - nassertr(attrib._attrib != (RenderAttrib *)NULL, state); + nassertd(attrib._attrib != (RenderAttrib *)NULL) continue; attrib._attrib = attrib._attrib->get_unique(); mask.clear_bit(slot); slot = mask.get_lowest_on_bit(); @@ -1548,6 +1522,11 @@ return_unique(RenderState *state) { int si = _states->find(state); if (si != -1) { // There's an equivalent state already in the set. Return it. + // The state that was passed may be newly created and therefore + // may not be automatically deleted. Do that if necessary. + if (state->get_ref_count() == 0) { + delete state; + } return _states->get_key(si); } @@ -1562,7 +1541,7 @@ return_unique(RenderState *state) { // Save the index and return the input state. state->_saved_entry = si; - return pt_state; + return state; } //////////////////////////////////////////////////////////////////// @@ -1621,15 +1600,6 @@ do_compose(const RenderState *other) const { slot = mask.get_lowest_on_bit(); } - // If we have any ShaderAttrib with auto-shader enabled, - // remove any shader inputs on it. This is a workaround for an - // issue that makes the shader-generator regenerate the shader - // every time a shader input changes. - CPT(ShaderAttrib) sattrib = DCAST(ShaderAttrib, new_state->get_attrib_def(ShaderAttrib::get_class_slot())); - if (sattrib->auto_shader()) { - sattrib = DCAST(ShaderAttrib, sattrib->clear_all_shader_inputs()); - } - return return_new(new_state); } @@ -1660,9 +1630,8 @@ do_invert_compose(const RenderState *other) const { } else if (b._attrib == NULL) { // A wins. Invert it. - CPT(RenderState) full_default = make_full_default(); - CPT(RenderAttrib) default_attrib = full_default->get_attrib(slot); - result.set(a._attrib->invert_compose(default_attrib), 0); + RenderAttribRegistry *reg = RenderAttribRegistry::quick_get_global_ptr(); + result.set(a._attrib->invert_compose(reg->get_slot_default(slot)), 0); } else { // Both are good. (Overrides are not used in invert_compose.) @@ -2162,8 +2131,14 @@ init_states() { _states_lock = new LightReMutex("RenderState::_states_lock"); _cache_stats.init(); nassertv(Thread::get_current_thread() == Thread::get_main_thread()); -} + // Initialize the empty state object as well. It is used so often + // that it is declared globally, and lives forever. + RenderState *state = new RenderState; + state->local_object(); + state->_saved_entry = _states->store(state, Empty()); + _empty_state = state; +} //////////////////////////////////////////////////////////////////// // Function: RenderState::register_with_read_factory diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index 4a59fb5302..bd97d7594e 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -31,10 +31,11 @@ #include "lightMutex.h" #include "deletedChain.h" #include "simpleHashMap.h" +#include "weakKeyHashMap.h" #include "cacheStats.h" #include "renderAttribRegistry.h" +#include "graphicsStateGuardianBase.h" -class GraphicsStateGuardianBase; class FactoryParams; class ShaderAttrib; @@ -76,7 +77,6 @@ PUBLISHED: bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const; INLINE static CPT(RenderState) make_empty(); - INLINE static CPT(RenderState) make_full_default(); static CPT(RenderState) make(const RenderAttrib *attrib, int override = 0); static CPT(RenderState) make(const RenderAttrib *attrib1, const RenderAttrib *attrib2, int override = 0); @@ -104,7 +104,7 @@ PUBLISHED: INLINE bool has_attrib(TypeHandle type) const; INLINE bool has_attrib(int slot) const; INLINE const RenderAttrib *get_attrib(TypeHandle type) const; - INLINE const RenderAttrib *get_attrib(int slot) const; + ALWAYS_INLINE const RenderAttrib *get_attrib(int slot) const; INLINE const RenderAttrib *get_attrib_def(int slot) const; INLINE int get_override(TypeHandle type) const; INLINE int get_override(int slot) const; @@ -233,8 +233,7 @@ private: }; typedef SimpleHashMap > States; static States *_states; - static CPT(RenderState) _empty_state; - static CPT(RenderState) _full_default_state; + static const RenderState *_empty_state; // This iterator records the entry corresponding to this // RenderState object in the above global set. We keep the index @@ -270,9 +269,9 @@ private: // since there are likely to be far fewer GSG's than RenderStates. // The code to manage this map lives in // GraphicsStateGuardian::get_geom_munger(). - typedef pmap Mungers; + typedef WeakKeyHashMap Mungers; mutable Mungers _mungers; - mutable Mungers::const_iterator _last_mi; + mutable int _last_mi; // This is used to mark nodes as we visit them to detect cycles. UpdateSeq _cycle_detect; @@ -307,7 +306,7 @@ private: CPT(RenderAttrib) _attrib; int _override; }; - Attribute *_attributes; + Attribute _attributes[RenderAttribRegistry::_max_slots]; // We also store a bitmask of the non-NULL attributes in the above // array. This is redundant, but it is a useful cache. diff --git a/panda/src/pgraph/rescaleNormalAttrib.I b/panda/src/pgraph/rescaleNormalAttrib.I index ed9633bf81..2825f44431 100644 --- a/panda/src/pgraph/rescaleNormalAttrib.I +++ b/panda/src/pgraph/rescaleNormalAttrib.I @@ -25,6 +25,19 @@ RescaleNormalAttrib(RescaleNormalAttrib::Mode mode) : { } +//////////////////////////////////////////////////////////////////// +// Function: RescaleNormalAttrib::make_default +// Access: Published, Static +// Description: Constructs a RescaleNormalAttrib object that's +// suitable for putting at the top of a scene graph. +// This will contain whatever attrib was suggested by +// the user's rescale-normals Config variable. +//////////////////////////////////////////////////////////////////// +INLINE CPT(RenderAttrib) RescaleNormalAttrib:: +make_default() { + return RenderAttribRegistry::quick_get_global_ptr()->get_slot_default(_attrib_slot); +} + //////////////////////////////////////////////////////////////////// // Function: RescaleNormalAttrib::get_mode // Access: Published diff --git a/panda/src/pgraph/rescaleNormalAttrib.cxx b/panda/src/pgraph/rescaleNormalAttrib.cxx index 7c20896810..33de69efe7 100644 --- a/panda/src/pgraph/rescaleNormalAttrib.cxx +++ b/panda/src/pgraph/rescaleNormalAttrib.cxx @@ -25,18 +25,7 @@ TypeHandle RescaleNormalAttrib::_type_handle; int RescaleNormalAttrib::_attrib_slot; - -// This variable is defined here instead of in config_pgraph.cxx, -// because it depends on rescaleNormalAttrib.h having already been -// included. -static ConfigVariableEnum rescale_normals -("rescale-normals", RescaleNormalAttrib::M_auto, - PRC_DESC("Specifies the kind of RescaleNormalAttrib that should be " - "created for the top of the scene graph. This can automatically " - "ensure that your lighting normals are unit-length, which may be " - "particularly necessary in the presence of scales in the scene " - "graph. Turning it off ('none') may produce a small performance " - "benefit.")); +CPT(RenderAttrib) RescaleNormalAttrib::_attribs[RescaleNormalAttrib::M_auto + 1]; //////////////////////////////////////////////////////////////////// // Function: RescaleNormalAttrib::make @@ -47,28 +36,18 @@ static ConfigVariableEnum rescale_normals //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) RescaleNormalAttrib:: make(RescaleNormalAttrib::Mode mode) { - RescaleNormalAttrib *attrib = new RescaleNormalAttrib(mode); - return return_new(attrib); -} - -//////////////////////////////////////////////////////////////////// -// Function: RescaleNormalAttrib::make_default -// Access: Published, Static -// Description: Constructs a RescaleNoramlAttrib object that's -// suitable for putting at the top of a scene graph. -// This will contain whatever attrib was suggested by -// the user's rescale-normals Config variable. -//////////////////////////////////////////////////////////////////// -CPT(RenderAttrib) RescaleNormalAttrib:: -make_default() { - RescaleNormalAttrib *attrib = new RescaleNormalAttrib(rescale_normals); - return return_new(attrib); + if (_attribs[mode].is_null()) { + // Don't bother with return_new, since this is the only way a + // RescaleNormalAttrib can be made anyway. + _attribs[mode] = new RescaleNormalAttrib(mode); + } + return _attribs[mode]; } //////////////////////////////////////////////////////////////////// // Function: RescaleNormalAttrib::output // Access: Public, Virtual -// Description: +// Description: //////////////////////////////////////////////////////////////////// void RescaleNormalAttrib:: output(ostream &out) const { @@ -92,8 +71,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int RescaleNormalAttrib:: compare_to_impl(const RenderAttrib *other) const { - const RescaleNormalAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const RescaleNormalAttrib *ta = (const RescaleNormalAttrib *)other; return (int)_mode - (int)ta->_mode; } @@ -187,6 +165,35 @@ fillin(DatagramIterator &scan, BamReader *manager) { _mode = (Mode)scan.get_int8(); } +//////////////////////////////////////////////////////////////////// +// Function: RescaleNormalAttrib::init_type +// Access: Public, Static +// Description: +//////////////////////////////////////////////////////////////////// +void RescaleNormalAttrib:: +init_type() { + RenderAttrib::init_type(); + register_type(_type_handle, "RescaleNormalAttrib", + RenderAttrib::get_class_type()); + + // This is defined here, since we have otherwise no guarantee that + // the config var has already been constructed by the time we call + // init_type() at static init time. + static ConfigVariableEnum rescale_normals + ("rescale-normals", RescaleNormalAttrib::M_auto, + PRC_DESC("Specifies the kind of RescaleNormalAttrib that should be " + "created for the top of the scene graph. This can automatically " + "ensure that your lighting normals are unit-length, which may be " + "particularly necessary in the presence of scales in the scene " + "graph. Turning it off ('none') may produce a small performance " + "benefit.")); + + Mode mode = rescale_normals; + RescaleNormalAttrib *attrib = new RescaleNormalAttrib(mode); + _attrib_slot = register_slot(_type_handle, 100, attrib); + _attribs[mode] = attrib; +} + //////////////////////////////////////////////////////////////////// // Function: RescaleNormalAttrib::Mode output operator // Description: diff --git a/panda/src/pgraph/rescaleNormalAttrib.h b/panda/src/pgraph/rescaleNormalAttrib.h index 04f5575614..4634d504bb 100644 --- a/panda/src/pgraph/rescaleNormalAttrib.h +++ b/panda/src/pgraph/rescaleNormalAttrib.h @@ -49,7 +49,7 @@ private: PUBLISHED: static CPT(RenderAttrib) make(Mode mode); - static CPT(RenderAttrib) make_default(); + INLINE static CPT(RenderAttrib) make_default(); INLINE Mode get_mode() const; @@ -64,6 +64,10 @@ protected: private: Mode _mode; + // There are so few possible combinations, and it's used fairly often, so + // we keep an array of the possible attributes. + static CPT(RenderAttrib) _attribs[M_auto + 1]; + PUBLISHED: static int get_class_slot() { return _attrib_slot; @@ -79,17 +83,12 @@ public: protected: static TypedWritable *make_from_bam(const FactoryParams ¶ms); void fillin(DatagramIterator &scan, BamReader *manager); - + public: static TypeHandle get_class_type() { return _type_handle; } - static void init_type() { - RenderAttrib::init_type(); - register_type(_type_handle, "RescaleNormalAttrib", - RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); - } + static void init_type(); virtual TypeHandle get_type() const { return get_class_type(); } diff --git a/panda/src/pgraph/scissorAttrib.cxx b/panda/src/pgraph/scissorAttrib.cxx index 24b5111f99..29814d9668 100644 --- a/panda/src/pgraph/scissorAttrib.cxx +++ b/panda/src/pgraph/scissorAttrib.cxx @@ -113,8 +113,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int ScissorAttrib:: compare_to_impl(const RenderAttrib *other) const { - const ScissorAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ScissorAttrib *ta = (const ScissorAttrib *)other; if (!_off && !ta->_off) { return 0; @@ -173,8 +172,7 @@ compose_impl(const RenderAttrib *other) const { return other; } - const ScissorAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ScissorAttrib *ta = (const ScissorAttrib *)other; if (ta->_off) { return this; diff --git a/panda/src/pgraph/scissorAttrib.h b/panda/src/pgraph/scissorAttrib.h index e3e63f6685..88475a50fc 100644 --- a/panda/src/pgraph/scissorAttrib.h +++ b/panda/src/pgraph/scissorAttrib.h @@ -89,7 +89,10 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ScissorAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + + ScissorAttrib *attrib = new ScissorAttrib(LVecBase4(0, 1, 0, 1)); + attrib->_off = true; + _attrib_slot = register_slot(_type_handle, 100, attrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/shadeModelAttrib.cxx b/panda/src/pgraph/shadeModelAttrib.cxx index 1787ec3411..24f6ef3585 100644 --- a/panda/src/pgraph/shadeModelAttrib.cxx +++ b/panda/src/pgraph/shadeModelAttrib.cxx @@ -84,8 +84,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int ShadeModelAttrib:: compare_to_impl(const RenderAttrib *other) const { - const ShadeModelAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ShadeModelAttrib *ta = (const ShadeModelAttrib *)other; return (int)_mode - (int)ta->_mode; } @@ -125,8 +124,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) ShadeModelAttrib:: compose_impl(const RenderAttrib *other) const { - const ShadeModelAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const ShadeModelAttrib *ta = (const ShadeModelAttrib *)other; Mode mode = ta->get_mode(); return make(mode); diff --git a/panda/src/pgraph/shadeModelAttrib.h b/panda/src/pgraph/shadeModelAttrib.h index b120b5555b..b2edff59ed 100644 --- a/panda/src/pgraph/shadeModelAttrib.h +++ b/panda/src/pgraph/shadeModelAttrib.h @@ -77,7 +77,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ShadeModelAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new ShadeModelAttrib(M_smooth)); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/shaderAttrib.cxx b/panda/src/pgraph/shaderAttrib.cxx index 82f05cfbad..21145802d6 100644 --- a/panda/src/pgraph/shaderAttrib.cxx +++ b/panda/src/pgraph/shaderAttrib.cxx @@ -542,8 +542,7 @@ get_shader() const { //////////////////////////////////////////////////////////////////// int ShaderAttrib:: compare_to_impl(const RenderAttrib *other) const { - const ShaderAttrib *that; - DCAST_INTO_R(that, other, 0); + const ShaderAttrib *that = (const ShaderAttrib *)other; if (this->_shader != that->_shader) { return (this->_shader < that->_shader) ? -1 : 1; @@ -643,8 +642,8 @@ get_hash_impl() const { CPT(RenderAttrib) ShaderAttrib:: compose_impl(const RenderAttrib *other) const { ShaderAttrib *attr = new ShaderAttrib(*this); - const ShaderAttrib *over; - DCAST_INTO_R(over, other, 0); + const ShaderAttrib *over = (const ShaderAttrib *)other; + // Update the shader portion. if (over->_has_shader) { if ((attr->_has_shader == false) || diff --git a/panda/src/pgraph/shaderAttrib.h b/panda/src/pgraph/shaderAttrib.h index d146e80bab..fd6b26dffc 100644 --- a/panda/src/pgraph/shaderAttrib.h +++ b/panda/src/pgraph/shaderAttrib.h @@ -156,7 +156,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "ShaderAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 10, make_default); + _attrib_slot = register_slot(_type_handle, 10, new ShaderAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/stateMunger.cxx b/panda/src/pgraph/stateMunger.cxx index e6ef2321ff..4ab909127b 100644 --- a/panda/src/pgraph/stateMunger.cxx +++ b/panda/src/pgraph/stateMunger.cxx @@ -32,18 +32,15 @@ StateMunger:: //////////////////////////////////////////////////////////////////// CPT(RenderState) StateMunger:: munge_state(const RenderState *state) { - WCPT(RenderState) pt_state = state; - - StateMap::iterator mi = _state_map.find(pt_state); - if (mi != _state_map.end()) { - if (!(*mi).first.was_deleted() && - !(*mi).second.was_deleted()) { - return (*mi).second.p(); + int mi = _state_map.find(state); + if (mi != -1) { + if (!_state_map.get_data(mi).was_deleted()) { + return _state_map.get_data(mi).p(); } } CPT(RenderState) result = munge_state_impl(state); - _state_map[pt_state] = result; + _state_map.store(state, result.p()); return result; } diff --git a/panda/src/pgraph/stateMunger.h b/panda/src/pgraph/stateMunger.h index 3385890deb..3a317ffa14 100644 --- a/panda/src/pgraph/stateMunger.h +++ b/panda/src/pgraph/stateMunger.h @@ -18,7 +18,7 @@ #include "pandabase.h" #include "geomMunger.h" #include "renderState.h" -#include "weakPointerTo.h" +#include "weakKeyHashMap.h" //////////////////////////////////////////////////////////////////// // Class : StateMunger @@ -36,7 +36,7 @@ public: protected: virtual CPT(RenderState) munge_state_impl(const RenderState *state); - typedef pmap< WCPT(RenderState), WCPT(RenderState) > StateMap; + typedef WeakKeyHashMap StateMap; StateMap _state_map; public: diff --git a/panda/src/pgraph/stencilAttrib.cxx b/panda/src/pgraph/stencilAttrib.cxx index 07657fbf96..481626047e 100644 --- a/panda/src/pgraph/stencilAttrib.cxx +++ b/panda/src/pgraph/stencilAttrib.cxx @@ -311,8 +311,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int StencilAttrib:: compare_to_impl(const RenderAttrib *other) const { - const StencilAttrib *sa; - DCAST_INTO_R(sa, other, 0); + const StencilAttrib *sa = (const StencilAttrib *)other; int a; int b; diff --git a/panda/src/pgraph/stencilAttrib.h b/panda/src/pgraph/stencilAttrib.h index 5e456b29d6..ea19401ccd 100644 --- a/panda/src/pgraph/stencilAttrib.h +++ b/panda/src/pgraph/stencilAttrib.h @@ -175,7 +175,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "StencilAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new StencilAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/texGenAttrib.cxx b/panda/src/pgraph/texGenAttrib.cxx index ca22d7942c..5cd538f600 100644 --- a/panda/src/pgraph/texGenAttrib.cxx +++ b/panda/src/pgraph/texGenAttrib.cxx @@ -297,8 +297,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int TexGenAttrib:: compare_to_impl(const RenderAttrib *other) const { - const TexGenAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TexGenAttrib *ta = (const TexGenAttrib *)other; Stages::const_iterator ai, bi; ai = _stages.begin(); @@ -383,8 +382,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) TexGenAttrib:: compose_impl(const RenderAttrib *other) const { - const TexGenAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TexGenAttrib *ta = (const TexGenAttrib *)other; // The composition is the union of the two attribs. In the case // when a stage is in both attribs, we compose the stages. @@ -441,8 +439,7 @@ compose_impl(const RenderAttrib *other) const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) TexGenAttrib:: invert_compose_impl(const RenderAttrib *other) const { - const TexGenAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TexGenAttrib *ta = (const TexGenAttrib *)other; // The inverse composition works a lot like the composition, except // we invert the ai stages. diff --git a/panda/src/pgraph/texGenAttrib.h b/panda/src/pgraph/texGenAttrib.h index 71840a83aa..be92aff106 100644 --- a/panda/src/pgraph/texGenAttrib.h +++ b/panda/src/pgraph/texGenAttrib.h @@ -139,7 +139,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "TexGenAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new TexGenAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/texMatrixAttrib.cxx b/panda/src/pgraph/texMatrixAttrib.cxx index 7afe6f9014..26dad659e3 100644 --- a/panda/src/pgraph/texMatrixAttrib.cxx +++ b/panda/src/pgraph/texMatrixAttrib.cxx @@ -247,9 +247,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int TexMatrixAttrib:: compare_to_impl(const RenderAttrib *other) const { - const TexMatrixAttrib *ta; - DCAST_INTO_R(ta, other, 0); - + const TexMatrixAttrib *ta = (const TexMatrixAttrib *)other; + Stages::const_iterator ai, bi; ai = _stages.begin(); bi = ta->_stages.begin(); @@ -326,8 +325,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) TexMatrixAttrib:: compose_impl(const RenderAttrib *other) const { - const TexMatrixAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TexMatrixAttrib *ta = (const TexMatrixAttrib *)other; // The composition is the union of the two attribs. In the case // when a stage is in both attribs, we compose the stages. @@ -396,8 +394,7 @@ compose_impl(const RenderAttrib *other) const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) TexMatrixAttrib:: invert_compose_impl(const RenderAttrib *other) const { - const TexMatrixAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TexMatrixAttrib *ta = (const TexMatrixAttrib *)other; // The inverse composition works a lot like the composition, except // we invert the ai stages. diff --git a/panda/src/pgraph/texMatrixAttrib.h b/panda/src/pgraph/texMatrixAttrib.h index a6a29e155a..a1e6d90c94 100644 --- a/panda/src/pgraph/texMatrixAttrib.h +++ b/panda/src/pgraph/texMatrixAttrib.h @@ -123,7 +123,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "TexMatrixAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new TexMatrixAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/textureAttrib.cxx b/panda/src/pgraph/textureAttrib.cxx index bb7a4808e5..6de455327e 100644 --- a/panda/src/pgraph/textureAttrib.cxx +++ b/panda/src/pgraph/textureAttrib.cxx @@ -507,8 +507,7 @@ cull_callback(CullTraverser *trav, const CullTraverserData &data) const { //////////////////////////////////////////////////////////////////// int TextureAttrib:: compare_to_impl(const RenderAttrib *other) const { - const TextureAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TextureAttrib *ta = (const TextureAttrib *)other; if (_off_all_stages != ta->_off_all_stages) { return (int)_off_all_stages - (int)ta->_off_all_stages; @@ -664,8 +663,7 @@ get_hash_impl() const { //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) TextureAttrib:: compose_impl(const RenderAttrib *other) const { - const TextureAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TextureAttrib *ta = (const TextureAttrib *)other; if (ta->_off_all_stages) { // If the other type turns off all stages, it doesn't matter what diff --git a/panda/src/pgraph/textureAttrib.h b/panda/src/pgraph/textureAttrib.h index 0c27a018eb..a5f5ed9bf6 100644 --- a/panda/src/pgraph/textureAttrib.h +++ b/panda/src/pgraph/textureAttrib.h @@ -179,7 +179,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "TextureAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 30, make_default); + _attrib_slot = register_slot(_type_handle, 30, new TextureAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/transparencyAttrib.cxx b/panda/src/pgraph/transparencyAttrib.cxx index 2b20559bc8..b2cb9cd75f 100644 --- a/panda/src/pgraph/transparencyAttrib.cxx +++ b/panda/src/pgraph/transparencyAttrib.cxx @@ -101,8 +101,8 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// int TransparencyAttrib:: compare_to_impl(const RenderAttrib *other) const { - const TransparencyAttrib *ta; - DCAST_INTO_R(ta, other, 0); + const TransparencyAttrib *ta = (const TransparencyAttrib *)other; + return (int)_mode - (int)ta->_mode; } diff --git a/panda/src/pgraph/transparencyAttrib.h b/panda/src/pgraph/transparencyAttrib.h index b653641207..1831db44f3 100644 --- a/panda/src/pgraph/transparencyAttrib.h +++ b/panda/src/pgraph/transparencyAttrib.h @@ -92,7 +92,7 @@ public: RenderAttrib::init_type(); register_type(_type_handle, "TransparencyAttrib", RenderAttrib::get_class_type()); - _attrib_slot = register_slot(_type_handle, 100, make_default); + _attrib_slot = register_slot(_type_handle, 100, new TransparencyAttrib); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/putil/p3putil_composite2.cxx b/panda/src/putil/p3putil_composite2.cxx index 1f3b46718d..a4ce5c9cfc 100644 --- a/panda/src/putil/p3putil_composite2.cxx +++ b/panda/src/putil/p3putil_composite2.cxx @@ -23,6 +23,7 @@ #include "vector_typedWritable.cxx" #include "vector_ushort.cxx" #include "vector_writable.cxx" +#include "weakKeyHashMap.cxx" #include "writableConfigurable.cxx" #include "writableParam.cxx" diff --git a/panda/src/putil/weakKeyHashMap.I b/panda/src/putil/weakKeyHashMap.I new file mode 100644 index 0000000000..05f9f4266d --- /dev/null +++ b/panda/src/putil/weakKeyHashMap.I @@ -0,0 +1,714 @@ +// Filename: weakKeyHashMap.I +// Created by: rdb (13Jul15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +INLINE WeakKeyHashMap:: +WeakKeyHashMap() : + _table(NULL), + _deleted_chain(NULL), + _table_size(0), + _num_entries(0) +{ +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::Destructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +INLINE WeakKeyHashMap:: +~WeakKeyHashMap() { + clear(); +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::swap +// Access: Public +// Description: Quickly exchanges the contents of this map and the +// other map. +//////////////////////////////////////////////////////////////////// +template +INLINE void WeakKeyHashMap:: +swap(WeakKeyHashMap &other) { + TableEntry *t0 = _table; + _table = other._table; + other._table = t0; + + DeletedBufferChain *t1 = _deleted_chain; + _deleted_chain = other._deleted_chain; + other._deleted_chain = t1; + + size_t t2 = _table_size; + _table_size = other._table_size; + other._table_size = t2; + + size_t t3 = _num_entries; + _num_entries = other._num_entries; + other._num_entries = t3; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::find +// Access: Public +// Description: Searches for the indicated key in the table. Returns +// its index number if it is found, or -1 if it is not +// present in the table. +//////////////////////////////////////////////////////////////////// +template +int WeakKeyHashMap:: +find(const Key *key) const { + if (_table_size == 0) { + // Special case: the table is empty. + return -1; + } + + size_t index = get_hash(key); + if (!has_element(index)) { + return -1; + } + if (is_element(index, key)) { + return index; + } + + // There was some other key at the hashed slot. That's a hash + // conflict. Maybe our entry was recorded at a later slot position; + // scan the subsequent positions until we find the entry or an + // unused slot, indicating the end of the scan. + size_t i = index; + i = (i + 1) & (_table_size - 1); + while (i != index && has_element(i)) { + if (is_element(i, key)) { + return i; + } + i = (i + 1) & (_table_size - 1); + } + + // The key is not in the table. + return -1; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::store +// Access: Public +// Description: Records the indicated key/data pair in the map. If +// the key was already present, silently replaces it. +// Returns the index at which it was stored. +//////////////////////////////////////////////////////////////////// +template +int WeakKeyHashMap:: +store(const Key *key, const Value &data) { + if (_table_size == 0) { + // Special case: the first key in an empty table. + nassertr(_num_entries == 0, -1); + new_table(); + size_t index = get_hash(key); + store_new_element(index, key, data); + ++_num_entries; +#ifdef _DEBUG + nassertr(validate(), index); +#endif + return index; + } + + size_t index = get_hash(key); + if (!has_element(index)) { + // This element is not already in the map; add it. + if (consider_expand_table()) { + return store(key, data); + } + store_new_element(index, key, data); + ++_num_entries; +#ifdef _DEBUG + nassertr(validate(), index); +#endif + return index; + } + if (is_element(index, key)) { + // This element is already in the map; replace the data at that + // key. + _table[index]._data = data; +#ifdef _DEBUG + nassertr(validate(), index); +#endif + return index; + } + + // There was some other key at the hashed slot. That's a hash + // conflict. Record this entry at a later position. + size_t i = index; + i = (i + 1) & (_table_size - 1); + while (i != index) { + if (!has_element(i)) { + if (consider_expand_table()) { + return store(key, data); + } + store_new_element(i, key, data); + ++_num_entries; +#ifdef _DEBUG + nassertr(validate(), i); +#endif + return i; + } + if (is_element(i, key)) { + _table[i]._data = data; +#ifdef _DEBUG + nassertr(validate(), i); +#endif + return i; + } + i = (i + 1) & (_table_size - 1); + } + + // Shouldn't get here unless _num_entries == _table_size, which + // shouldn't be possible due to consider_expand_table(). + nassertr(false, -1); + return -1; // To satisfy compiler +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::remove +// Access: Public +// Description: Removes the indicated key and its associated data +// from the table. Returns true if the key was removed, +// false if it was not present. +//////////////////////////////////////////////////////////////////// +template +INLINE bool WeakKeyHashMap:: +remove(const Key *key) { + int index = find(key); + if (index == -1) { + return false; + } + remove_element(index); + return true; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::clear +// Access: Public +// Description: Completely empties the table. +//////////////////////////////////////////////////////////////////// +template +void WeakKeyHashMap:: +clear() { + if (_table_size != 0) { + for (size_t i = 0; i < _table_size; ++i) { + if (get_exists_array()[i] != 0) { + clear_element(i); + } + } + + _deleted_chain->deallocate(_table, TypeHandle::none()); + _table = NULL; + _deleted_chain = NULL; + _table_size = 0; + _num_entries = 0; + } +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::operator [] +// Access: Public +// Description: Returns a modifiable reference to the data associated +// with the indicated key, or creates a new data entry +// and returns its reference. +//////////////////////////////////////////////////////////////////// +template +INLINE Value &WeakKeyHashMap:: +operator [] (const Key *key) { + int index = find(key); + if (index == -1) { + index = store(key, Value()); + } + return modify_data(index); +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::get_size +// Access: Public +// Description: Returns the total number of slots in the table. +//////////////////////////////////////////////////////////////////// +template +INLINE int WeakKeyHashMap:: +get_size() const { + return _table_size; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::has_element +// Access: Public +// Description: Returns true if there is an element stored in the nth +// slot, false otherwise. +// +// n should be in the range 0 <= n < get_size(). +//////////////////////////////////////////////////////////////////// +template +INLINE bool WeakKeyHashMap:: +has_element(int n) const { + nassertr(n >= 0 && n < (int)_table_size, false); + return (get_exists_array()[n] != 0 && !_table[n]._key.was_deleted()); +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::get_key +// Access: Public +// Description: Returns the key in the nth slot of the table. +// +// It is an error to call this if there is nothing +// stored in the nth slot (use has_element() to check +// this first). n should be in the range 0 <= n < +// get_size(). +//////////////////////////////////////////////////////////////////// +template +INLINE const Key *WeakKeyHashMap:: +get_key(int n) const { + nassertr(has_element(n), _table[n]._key); + return _table[n]._key; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::get_data +// Access: Public +// Description: Returns the data in the nth slot of the table. +// +// It is an error to call this if there is nothing +// stored in the nth slot (use has_element() to check +// this first). n should be in the range 0 <= n < +// get_size(). +//////////////////////////////////////////////////////////////////// +template +INLINE const Value &WeakKeyHashMap:: +get_data(int n) const { + nassertr(has_element(n), _table[n]._data); + return _table[n]._data; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::modify_data +// Access: Public +// Description: Returns a modifiable reference to the data in the nth +// slot of the table. +// +// It is an error to call this if there is nothing +// stored in the nth slot (use has_element() to check +// this first). n should be in the range 0 <= n < +// get_size(). +//////////////////////////////////////////////////////////////////// +template +INLINE Value &WeakKeyHashMap:: +modify_data(int n) { + nassertr(has_element(n), _table[n]._data); + return _table[n]._data; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::set_data +// Access: Public +// Description: Changes the data for the nth slot of the table. +// +// It is an error to call this if there is nothing +// stored in the nth slot (use has_element() to check +// this first). n should be in the range 0 <= n < +// get_size(). +//////////////////////////////////////////////////////////////////// +template +INLINE void WeakKeyHashMap:: +set_data(int n, const Value &data) { + nassertv(has_element(n)); + _table[n]._data = data; +} + +#ifdef USE_MOVE_SEMANTICS +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::set_data +// Access: Public +// Description: Changes the data for the nth slot of the table. +// +// It is an error to call this if there is nothing +// stored in the nth slot (use has_element() to check +// this first). n should be in the range 0 <= n < +// get_size(). +//////////////////////////////////////////////////////////////////// +template +INLINE void WeakKeyHashMap:: +set_data(int n, Value &&data) { + nassertv(has_element(n)); + _table[n]._data = std::move(data); +} +#endif // USE_MOVE_SEMANTICS + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::remove_element +// Access: Public +// Description: Removes the nth slot from the table. +// +// It is an error to call this if there is nothing +// stored in the nth slot (use has_element() to check +// this first). n should be in the range 0 <= n < +// get_size(). +//////////////////////////////////////////////////////////////////// +template +void WeakKeyHashMap:: +remove_element(int n) { + nassertv(get_exists_array()[n] != 0); + + clear_element(n); + nassertv(_num_entries > 0); + --_num_entries; + + // Now we have put a hole in the table. If there was a hash + // conflict in the slot following this one, we have to move it down + // to close the hole. + size_t i = n; + i = (i + 1) & (_table_size - 1); + while (get_exists_array()[i] != 0) { + if (_table[i]._key.was_deleted()) { + // It was deleted. Forget about it. + clear_element(i); + --_num_entries; + } else { + size_t wants_index = get_hash(_table[i]._key); + if (wants_index != i) { + // This one was a hash conflict; try to put it where it belongs. + // We can't just put it in n, since maybe it belongs somewhere + // after n. + while (wants_index != i && has_element(wants_index)) { + // Hash conflict; move it up. + wants_index = (wants_index + 1) & (_table_size - 1); + } + if (wants_index != i) { + store_new_element(wants_index, _table[i]._key, _table[i]._data); + clear_element(i); + } + } + } + + // Continue until we encounter the next unused slot. Until we do, + // we can't be sure we've found all of the potential hash + // conflicts. + i = (i + 1) & (_table_size - 1); + } + +#ifdef _DEBUG + nassertv(validate()); +#endif +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::get_num_entries +// Access: Public +// Description: Returns the number of active entries in the table. +// This is not necessarily related to the number of +// slots in the table as reported by get_size(). Use +// get_size() to iterate through all of the slots, not +// get_num_entries(). +// +// This is merely an upper bound on the number of +// entries; it may also count false positives for +// pointers that were recently deleted. +//////////////////////////////////////////////////////////////////// +template +INLINE int WeakKeyHashMap:: +get_num_entries() const { + return _num_entries; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::is_empty +// Access: Public +// Description: Returns true if the table is empty; +// i.e. get_num_entries() == 0. This may return a +// false negatives if a pointer was recently deleted; +// if this returns true, though, you can be sure it's +// empty. +//////////////////////////////////////////////////////////////////// +template +INLINE bool WeakKeyHashMap:: +is_empty() const { + return (_num_entries == 0); +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::output +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +void WeakKeyHashMap:: +output(ostream &out) const { + out << "WeakKeyHashMap (" << _num_entries << " entries): ["; + for (size_t i = 0; i < _table_size; ++i) { + if (get_exists_array()[i] == 0) { + out << " *"; + + } else { + out << " " << _table[i]._key; + size_t index = get_hash(_table[i]._key.get_orig()); + if (index != i) { + // This was misplaced as the result of a hash conflict. + // Report how far off it is. + out << "(" << ((_table_size + i - index) & (_table_size - 1)) << ")"; + } + } + } + out << " ]"; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::write +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +void WeakKeyHashMap:: +write(ostream &out) const { + output(out); + out << "\n"; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::validate +// Access: Public +// Description: Returns true if the internal table appears to be +// consistent, false if there are some internal errors. +//////////////////////////////////////////////////////////////////// +template +bool WeakKeyHashMap:: +validate() const { + size_t count = 0; + + for (size_t i = 0; i < _table_size; ++i) { + if (get_exists_array()[i] != 0) { + ++count; + if (_table[i]._key.was_deleted()) { + continue; + } + size_t ideal_index = get_hash(_table[i]._key.get_orig()); + size_t wants_index = ideal_index; + while (wants_index != i && get_exists_array()[i] != 0) { + wants_index = (wants_index + 1) & (_table_size - 1); + } + if (wants_index != i) { + util_cat.error() + << "WeakKeyHashMap is invalid: key " << _table[i]._key + << " should be in slot " << wants_index << " instead of " + << i << " (ideal is " << ideal_index << ")\n"; + write(util_cat.error(false)); + return false; + } + } + } + + if (count != _num_entries) { + util_cat.error() + << "WeakKeyHashMap is invalid: reports " << _num_entries + << " entries, actually has " << count << "\n"; + write(util_cat.error(false)); + return false; + } + + return true; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::get_hash +// Access: Private +// Description: Computes an appropriate index number to store the +// given pointer. +//////////////////////////////////////////////////////////////////// +template +INLINE size_t WeakKeyHashMap:: +get_hash(const Key *key) const { + /* + // We want a hash constant 0 < k < 1. This one is suggested by + // Knuth: + static const double hash_constant = (sqrt(5.0) - 1.0) / 2.0; + double f = ((double)(size_t)key * hash_constant); + f -= floor(f); + return (size_t)floor(f * _table_size); + */ + + return (((size_t)key * (size_t)9973) >> 8) & (_table_size - 1); +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::is_element +// Access: Private +// Description: Returns true if element n matches key. +//////////////////////////////////////////////////////////////////// +template +INLINE bool WeakKeyHashMap:: +is_element(int n, const Key *key) const { + nassertr(has_element(n), false); + return _table[n]._key == key; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::store_new_element +// Access: Private +// Description: Constructs a new TableEntry at position n, storing +// the indicated key and value. +//////////////////////////////////////////////////////////////////// +template +INLINE void WeakKeyHashMap:: +store_new_element(int n, const Key *key, const Value &data) { + if (get_exists_array()[n] != 0) { + // There was already an element in this spot. This can happen + // if it was a pointer that had already been deleted. + nassertv(_table[n]._key.was_deleted()); + _table[n].~TableEntry(); + --_num_entries; + } + new(&_table[n]) TableEntry(key, data); + get_exists_array()[n] = true; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::clear_element +// Access: Private +// Description: Destructs the TableEntry at position n. +//////////////////////////////////////////////////////////////////// +template +INLINE void WeakKeyHashMap:: +clear_element(int n) { + _table[n].~TableEntry(); + get_exists_array()[n] = false; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::get_exists_array +// Access: Private +// Description: Returns the beginning of the array of _table_size +// unsigned chars that are the boolean flags for whether +// each element exists (has been constructed) within the +// table. +//////////////////////////////////////////////////////////////////// +template +INLINE unsigned char *WeakKeyHashMap:: +get_exists_array() const { + return (unsigned char *)(_table + _table_size); +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::new_table +// Access: Private +// Description: Allocates a brand new table. +//////////////////////////////////////////////////////////////////// +template +void WeakKeyHashMap:: +new_table() { + nassertv(_table_size == 0 && _num_entries == 0); + + // Pick a good initial table size. For now, we make it really + // small. Maybe that's the right answer. + _table_size = 4; + + // We allocate enough bytes for _table_size elements of TableEntry, + // plus _table_size more bytes at the end (for the exists array). + size_t alloc_size = _table_size * sizeof(TableEntry) + _table_size; + + _deleted_chain = memory_hook->get_deleted_chain(alloc_size); + _table = (TableEntry *)_deleted_chain->allocate(alloc_size, TypeHandle::none()); + memset(get_exists_array(), 0, _table_size); +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::consider_expand_table +// Access: Private +// Description: Expands the table if it will need it (assuming one +// more element is about to be added). Returns true if +// the table was modified, false otherwise. +//////////////////////////////////////////////////////////////////// +template +INLINE bool WeakKeyHashMap:: +consider_expand_table() { + if (_num_entries >= (_table_size >> 1)) { + // Actually, first, we should see if there are any deleted pointers. + // Clean those up and see how much space we save. + for (size_t i = 0; i < _table_size; ++i) { + if (get_exists_array()[i] != 0 && _table[i]._key.was_deleted()) { + remove_element(i); + } + } + if (_num_entries >= (_table_size >> 1)) { + // Still not enough space. + expand_table(); + } + return true; + } + return false; +} + +//////////////////////////////////////////////////////////////////// +// Function: WeakKeyHashMap::expand_table +// Access: Private +// Description: Doubles the size of the existing table. +//////////////////////////////////////////////////////////////////// +template +void WeakKeyHashMap:: +expand_table() { + nassertv(_table_size != 0); + + WeakKeyHashMap old_map; + swap(old_map); + + // Double the table size. + size_t old_table_size = old_map._table_size; + _table_size = (old_table_size << 1); + nassertv(_table == NULL); + + // We allocate enough bytes for _table_size elements of TableEntry, + // plus _table_size more bytes at the end (for the exists array). + size_t alloc_size = _table_size * sizeof(TableEntry) + _table_size; + _deleted_chain = memory_hook->get_deleted_chain(alloc_size); + _table = (TableEntry *)_deleted_chain->allocate(alloc_size, TypeHandle::none()); + unsigned char *exists_array = get_exists_array(); + memset(exists_array, 0, _table_size); + nassertv(_num_entries == 0); + + // Now copy the entries from the old table into the new table. + int num_added = 0; + for (size_t i = 0; i < old_table_size; ++i) { + if (old_map.has_element(i)) { + size_t new_index = get_hash(old_map._table[i]._key.get_orig()); + + while (exists_array[new_index] != 0) { + // Hash conflict; look for a better spot. This has to succeed. + new_index = (new_index + 1) & (_table_size - 1); + } + +#ifdef USE_MOVE_SEMANTICS + // Use C++11 rvalue references to invoke the move constructor, + // which may be more efficient. + new(&_table[new_index]) TableEntry(move(old_map._table[i])); +#else + new(&_table[new_index]) TableEntry(old_map._table[i]); +#endif + exists_array[new_index] = true; + ++_num_entries; + } + } + + nassertv(validate()); + nassertv(old_map.validate()); + + nassertv(_num_entries == old_map._num_entries); +} diff --git a/panda/src/putil/weakKeyHashMap.cxx b/panda/src/putil/weakKeyHashMap.cxx new file mode 100644 index 0000000000..620603cc82 --- /dev/null +++ b/panda/src/putil/weakKeyHashMap.cxx @@ -0,0 +1,15 @@ +// Filename: weakKeyHashMap.cxx +// Created by: rdb (13Jul15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "weakKeyHashMap.h" diff --git a/panda/src/putil/weakKeyHashMap.h b/panda/src/putil/weakKeyHashMap.h new file mode 100644 index 0000000000..b84213567c --- /dev/null +++ b/panda/src/putil/weakKeyHashMap.h @@ -0,0 +1,115 @@ +// Filename: weakKeyHashMap.h +// Created by: rdb (13Jul15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef WEAKKEYHASHMAP_H +#define WEAKKEYHASHMAP_H + +#include "pandabase.h" +#include "pvector.h" +#include "config_util.h" +#include "weakPointerTo.h" + +//////////////////////////////////////////////////////////////////// +// Class : WeakKeyHashMap +// Description : This is a variation on WeakKeyHashMap that stores +// weak pointers as keys, and automatically frees up +// entries from the map when the associated key has +// been deleted. +// +// This is more efficient than using a naive map of +// WeakPointerTo keys since that would incur the cost +// of constructing a weak reference every time a find +// operation is used. +//////////////////////////////////////////////////////////////////// +template +class WeakKeyHashMap { +public: +#ifndef CPPPARSER + INLINE WeakKeyHashMap(); + INLINE ~WeakKeyHashMap(); + + INLINE void swap(WeakKeyHashMap &other); + + int find(const Key *key) const; + int store(const Key *key, const Value &data); + INLINE bool remove(const Key *key); + void clear(); + + INLINE Value &operator [] (const Key *key); + + INLINE int get_size() const; + INLINE bool has_element(int n) const; + INLINE const Key *get_key(int n) const; + INLINE const Value &get_data(int n) const; + INLINE Value &modify_data(int n); + INLINE void set_data(int n, const Value &data); +#ifdef USE_MOVE_SEMANTICS + INLINE void set_data(int n, Value &&data); +#endif + void remove_element(int n); + + INLINE int get_num_entries() const; + INLINE bool is_empty() const; + + void output(ostream &out) const; + void write(ostream &out) const; + bool validate() const; + +private: + INLINE size_t get_hash(const Key *key) const; + + INLINE bool is_element(int n, const Key *key) const; + INLINE void store_new_element(int n, const Key *key, const Value &data); + INLINE void clear_element(int n); + INLINE unsigned char *get_exists_array() const; + + void new_table(); + INLINE bool consider_expand_table(); + void expand_table(); + + class TableEntry { + public: + INLINE TableEntry(const Key *key, const Value &data) : + _key(key), + _data(data) {} + INLINE TableEntry(const TableEntry ©) : + _key(copy._key), + _data(copy._data) {} +#ifdef USE_MOVE_SEMANTICS + INLINE TableEntry(TableEntry &&from) NOEXCEPT : + _key(move(from._key)), + _data(move(from._data)) {} +#endif + WCPT(Key) _key; + Value _data; + }; + + TableEntry *_table; + DeletedBufferChain *_deleted_chain; + size_t _table_size; + size_t _num_entries; +#endif // CPPPARSER +}; + +template +inline ostream &operator << (ostream &out, const WeakKeyHashMap &shm) { + shm.output(out); + return out; +} + +#ifndef CPPPARSER +#include "weakKeyHashMap.I" +#endif // CPPPARSER + +#endif From e6d29d6f515b9e9180afc9fd7186b91c9805c964 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 20:01:37 +0200 Subject: [PATCH 078/203] Document bug in enable_angular_motor --- panda/src/bullet/bulletHingeConstraint.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/panda/src/bullet/bulletHingeConstraint.cxx b/panda/src/bullet/bulletHingeConstraint.cxx index c9a369eca7..8976c23126 100644 --- a/panda/src/bullet/bulletHingeConstraint.cxx +++ b/panda/src/bullet/bulletHingeConstraint.cxx @@ -211,10 +211,12 @@ get_hinge_angle() { // Function: BulletHingeConstraint::enable_angular_motor // Access: Published // Description: Applies an impulse to the constraint so that the -// angle changes at target_velocity (probably -// degrees/second) where max_impulse is the maximum -// impulse that is used for achieving the specified -// velocity. +// angle changes at target_velocity where max_impulse +// is the maximum impulse that is used for achieving +// the specified velocity. +// +// Note that the target_velocity is in radians/second, +// not degrees. //////////////////////////////////////////////////////////////////// void BulletHingeConstraint:: enable_angular_motor(bool enable, PN_stdfloat target_velocity, PN_stdfloat max_impulse) { From 1f0b4332e325c103e0ff2868f996d57efd069e4c Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 27 Jul 2015 20:23:47 +0200 Subject: [PATCH 079/203] Add softspace flag to StreamWriter - fixes print spaces in runtime env --- dtool/src/interrogate/interrogateBuilder.cxx | 5 +++-- dtool/src/prc/streamWriter.I | 17 +++++++++++++---- dtool/src/prc/streamWriter.h | 6 ++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index e6babb17f7..5336c809f8 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -1434,8 +1434,9 @@ scan_element(CPPInstance *element, CPPStructType *struct_type, return 0; } - if (element->_file._source != CPPFile::S_local || - in_ignorefile(element->_file._filename_as_referenced)) { + if (struct_type == NULL && + (element->_file._source != CPPFile::S_local || + in_ignorefile(element->_file._filename_as_referenced))) { // The element is defined in some other package or in an // ignorable file. return 0; diff --git a/dtool/src/prc/streamWriter.I b/dtool/src/prc/streamWriter.I index f92a24416e..ce4500a475 100644 --- a/dtool/src/prc/streamWriter.I +++ b/dtool/src/prc/streamWriter.I @@ -16,10 +16,13 @@ //////////////////////////////////////////////////////////////////// // Function: StreamWriter::Constructor // Access: Public -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE StreamWriter:: -StreamWriter(ostream &out) : +StreamWriter(ostream &out) : +#ifdef HAVE_PYTHON + softspace(0), +#endif _out(&out), _owns_stream(false) { @@ -28,10 +31,13 @@ StreamWriter(ostream &out) : //////////////////////////////////////////////////////////////////// // Function: StreamWriter::Constructor // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE StreamWriter:: -StreamWriter(ostream *out, bool owns_stream) : +StreamWriter(ostream *out, bool owns_stream) : +#ifdef HAVE_PYTHON + softspace(0), +#endif _out(out), _owns_stream(owns_stream) { @@ -45,6 +51,9 @@ StreamWriter(ostream *out, bool owns_stream) : //////////////////////////////////////////////////////////////////// INLINE StreamWriter:: StreamWriter(const StreamWriter ©) : +#ifdef HAVE_PYTHON + softspace(0), +#endif _out(copy._out), _owns_stream(false) { diff --git a/dtool/src/prc/streamWriter.h b/dtool/src/prc/streamWriter.h index cd6f20e6e1..b63feaf6b1 100644 --- a/dtool/src/prc/streamWriter.h +++ b/dtool/src/prc/streamWriter.h @@ -81,6 +81,12 @@ PUBLISHED: private: ostream *_out; bool _owns_stream; + +#ifdef HAVE_PYTHON +PUBLISHED: + // Python 2 needs this for printing to work correctly. + int softspace; +#endif }; #include "streamWriter.I" From 353ae928d250bafac18ecc135f779e4d0132d2a5 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Mon, 27 Jul 2015 13:51:21 -0500 Subject: [PATCH 080/203] Handle packaging user filetypes more extensibly -- Provide includeExtensions(...) method to augment particular kinds of files, allowing them to be packaged by dir() -- Track the count of files, by extension, silently ignored by dir(), and log this -- Allow "-v" option to verbosely log ignored files in dir() --- direct/src/p3d/Packager.py | 75 +++++++++++++++++++++++++++++++++++++- direct/src/p3d/ppackage.py | 11 +++++- 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 9614e96d59..d2166ec4f8 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -375,6 +375,9 @@ class Packager: # This records the current list of modules we have added so # far. self.freezer = FreezeTool.Freezer(platform = self.packager.platform) + + # Map of extensions to files to number (ignored by dir) + self.ignoredDirFiles = {} def close(self): """ Writes out the contents of the current package. Returns True @@ -385,6 +388,13 @@ class Packager: message = 'Cannot generate packages without an installDir; use -i' raise PackagerError, message + if self.ignoredDirFiles: + exts = list(self.ignoredDirFiles.keys()) + exts.sort() + total = sum([x for x in self.ignoredDirFiles.values()]) + self.notify.warning("excluded %s files not marked for inclusion: %s" \ + % (total, ", ".join(["'" + ext + "'" for ext in exts]))) + if not self.host: self.host = self.packager.host @@ -2185,6 +2195,9 @@ class Packager: # ignoring any request to specify a particular download host, # e.g. for testing and development. self.ignoreSetHost = False + + # Set this to true to verbosely log files ignored by dir(). + self.verbosePrint = False # This will be appended to the basename of any .p3d package, # before the .p3d extension. @@ -2390,6 +2403,14 @@ class Packager: # should be added exactly byte-for-byte as they are. self.unprocessedExtensions = [] + # Files for which warnings should be suppressed when they are + # not handled by dir() + self.suppressWarningForExtensions = ['', 'pyc', 'pyo', + 'p3d', 'pdef', + 'c', 'C', 'cxx', 'cpp', 'h', 'H', + 'hpp', 'pp', 'I', 'pem', 'p12', 'crt', + 'o', 'obj', 'a', 'lib', 'bc', 'll'] + # System files that should never be packaged. For # case-insensitive filesystems (like Windows and OSX), put the # lowercase filename here. Case-sensitive filesystems should @@ -2617,12 +2638,20 @@ class Packager: if dirname.makeTrueCase(): searchPath.appendDirectory(dirname) + def _ensureExtensions(self): + self.knownExtensions = \ + self.imageExtensions + \ + self.modelExtensions + \ + self.textExtensions + \ + self.binaryExtensions + \ + self.uncompressibleExtensions + \ + self.unprocessedExtensions def setup(self): """ Call this method to initialize the class after filling in some of the values in the constructor. """ - self.knownExtensions = self.imageExtensions + self.modelExtensions + self.textExtensions + self.binaryExtensions + self.uncompressibleExtensions + self.unprocessedExtensions + self._ensureExtensions() self.currentPackage = None @@ -3604,6 +3633,43 @@ class Packager: filename = Filename(filename) self.currentPackage.excludeFile(filename) + + def do_includeExtensions(self, executableExtensions = None, extractExtensions = None, + imageExtensions = None, textExtensions = None, + uncompressibleExtensions = None, unprocessedExtensions = None, + suppressWarningForExtensions = None): + """ Ensure that dir() will include files with the given extensions. + The extensions should not have '.' prefixes. + + All except 'suppressWarningForExtensions' allow the given kinds of files + to be packaged with their respective semantics (read the source). + + 'suppressWarningForExtensions' lists extensions *expected* to be ignored, + so no warnings will be emitted for them. + """ + if executableExtensions: + self.executableExtensions += executableExtensions + + if extractExtensions: + self.extractExtensions += extractExtensions + + if imageExtensions: + self.imageExtensions += imageExtensions + + if textExtensions: + self.textExtensions += textExtensions + + if uncompressibleExtensions: + self.uncompressibleExtensions += uncompressibleExtensions + + if unprocessedExtensions: + self.unprocessedExtensions += unprocessedExtensions + + if suppressWarningForExtensions: + self.suppressWarningForExtensions += suppressWarningForExtensions + + self._ensureExtensions() + def do_dir(self, dirname, newDir = None, unprocessed = None): """ Adds the indicated directory hierarchy to the current @@ -3676,7 +3742,12 @@ class Packager: filename.setBinary() self.currentPackage.addFile(filename, newName = newName, explicit = False, unprocessed = unprocessed) - + elif not ext in self.suppressWarningForExtensions: + newCount = self.currentPackage.ignoredDirFiles.get(ext, 0) + 1 + self.currentPackage.ignoredDirFiles[ext] = newCount + + if self.verbosePrint: + self.notify.warning("ignoring file %s" % filename) def readContentsFile(self): """ Reads the contents.xml file at the beginning of diff --git a/direct/src/p3d/ppackage.py b/direct/src/p3d/ppackage.py index 36be497a9f..dc00bdc567 100755 --- a/direct/src/p3d/ppackage.py +++ b/direct/src/p3d/ppackage.py @@ -123,6 +123,10 @@ Options: as such. This only applies to .p3d packages, not to other types of packages! + -v + Emit a warning for any file not recognized by the dir() command + (indicating there may be a need for addExtensions(...)). + -h Display this help """ @@ -151,11 +155,12 @@ allowPythonDev = False universalBinaries = False systemRoot = None ignoreSetHost = False +verbosePrint = False p3dSuffix = '' platforms = [] try: - opts, args = getopt.getopt(sys.argv[1:], 'i:ps:S:DuP:R:Ha:h') + opts, args = getopt.getopt(sys.argv[1:], 'i:ps:S:DuP:R:Ha:hv') except getopt.error, msg: usage(1, msg) @@ -188,6 +193,9 @@ for opt, arg in opts: elif opt == '-a': p3dSuffix = arg + elif opt == '-v': + verbosePrint = True + elif opt == '-h': usage(0) else: @@ -230,6 +238,7 @@ for platform in platforms: packager.allowPythonDev = allowPythonDev packager.systemRoot = systemRoot packager.ignoreSetHost = ignoreSetHost + packager.verbosePrint = verbosePrint packager.p3dSuffix = p3dSuffix try: From 265bf42f81225febdc60f9797e51125c080331a0 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jul 2015 13:41:26 +0200 Subject: [PATCH 081/203] Fix crash when copying a WeakPointerTo that was already deleted --- panda/src/express/referenceCount.I | 6 ++++++ panda/src/express/weakPointerTo.I | 6 +++--- panda/src/express/weakPointerToBase.I | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/panda/src/express/referenceCount.I b/panda/src/express/referenceCount.I index c71886f46d..9f098b0384 100644 --- a/panda/src/express/referenceCount.I +++ b/panda/src/express/referenceCount.I @@ -319,6 +319,9 @@ get_weak_list() const { INLINE void ReferenceCount:: weak_ref(WeakPointerToVoid *ptv) { TAU_PROFILE("void ReferenceCount::weak_ref()", " ", TAU_USER); +#ifdef _DEBUG + nassertv(test_ref_count_integrity()); +#endif get_weak_list()->add_reference(ptv); } @@ -332,6 +335,9 @@ weak_ref(WeakPointerToVoid *ptv) { INLINE void ReferenceCount:: weak_unref(WeakPointerToVoid *ptv) { TAU_PROFILE("void ReferenceCount::weak_unref()", " ", TAU_USER); +#ifdef _DEBUG + nassertv(test_ref_count_integrity()); +#endif nassertv(has_weak_list()); ((WeakReferenceList *)_weak_list)->clear_reference(ptv); } diff --git a/panda/src/express/weakPointerTo.I b/panda/src/express/weakPointerTo.I index d42111bbca..797d1cf000 100644 --- a/panda/src/express/weakPointerTo.I +++ b/panda/src/express/weakPointerTo.I @@ -43,7 +43,7 @@ WeakPointerTo(const PointerTo ©) : template INLINE WeakPointerTo:: WeakPointerTo(const WeakPointerTo ©) : - WeakPointerToBase(*(const PointerToBase *)©) + WeakPointerToBase(*(const WeakPointerToBase *)©) { } @@ -194,7 +194,7 @@ WeakConstPointerTo(const ConstPointerTo ©) : template INLINE WeakConstPointerTo:: WeakConstPointerTo(const WeakPointerTo ©) : - WeakPointerToBase(*(const PointerToBase *)©) + WeakPointerToBase(*(const WeakPointerToBase *)©) { } @@ -206,7 +206,7 @@ WeakConstPointerTo(const WeakPointerTo ©) : template INLINE WeakConstPointerTo:: WeakConstPointerTo(const WeakConstPointerTo ©) : - WeakPointerToBase(*(const PointerToBase *)©) + WeakPointerToBase(*(const WeakPointerToBase *)©) { } diff --git a/panda/src/express/weakPointerToBase.I b/panda/src/express/weakPointerToBase.I index 61d454ea89..ead49a1424 100644 --- a/panda/src/express/weakPointerToBase.I +++ b/panda/src/express/weakPointerToBase.I @@ -43,7 +43,13 @@ WeakPointerToBase(const PointerToBase ©) { template INLINE WeakPointerToBase:: WeakPointerToBase(const WeakPointerToBase ©) { - reassign(copy); + _void_ptr = copy._void_ptr; + _ptr_was_deleted = copy._ptr_was_deleted; + + if (is_valid_pointer()) { + To *ptr = (To *)_void_ptr; + ptr->weak_ref(this); + } } //////////////////////////////////////////////////////////////////// From 0cecab312448d9c306864ac2560da97ec07479d0 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jul 2015 15:40:04 +0200 Subject: [PATCH 082/203] Fix issues with the rtdist build in 1.10 --- direct/src/p3d/Packager.py | 2 +- direct/src/plugin/p3dPythonRun.cxx | 18 +++++++++++++----- direct/src/showbase/VFSImporter.py | 2 +- direct/src/showutil/FreezeTool.py | 10 ---------- makepanda/makepanda.py | 3 +++ .../glstuff/glGraphicsStateGuardian_src.cxx | 2 ++ 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 8685de09ea..f478f4178d 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -3341,7 +3341,7 @@ class Packager: self.do_module('VFSImporter', filename = filename) self.do_freeze('_vfsimporter', compileToExe = False) - self.do_file('panda3d/core.pyd'); + self.do_file('panda3d/_core.pyd'); # Now that we're done freezing, explicitly add 'direct' to # counteract the previous explicit excludeModule(). diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 667f34e7dc..e3be05bfc8 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -236,29 +236,37 @@ run_python() { } Py_DECREF(app_runner_class); + // Import the JavaScript module. + PyObject *javascript_module = PyImport_ImportModule("direct.p3d.JavaScript"); + if (javascript_module == NULL) { + nout << "Failed to import direct.p3d.JavaScript\n"; + PyErr_Print(); + return false; + } + // Get the UndefinedObject class. - _undefined_object_class = PyObject_GetAttrString(app_runner_module, "UndefinedObject"); + _undefined_object_class = PyObject_GetAttrString(javascript_module, "UndefinedObject"); if (_undefined_object_class == NULL) { PyErr_Print(); return false; } // And the "Undefined" instance. - _undefined = PyObject_GetAttrString(app_runner_module, "Undefined"); + _undefined = PyObject_GetAttrString(javascript_module, "Undefined"); if (_undefined == NULL) { PyErr_Print(); return false; } // Get the ConcreteStruct class. - _concrete_struct_class = PyObject_GetAttrString(app_runner_module, "ConcreteStruct"); + _concrete_struct_class = PyObject_GetAttrString(javascript_module, "ConcreteStruct"); if (_concrete_struct_class == NULL) { PyErr_Print(); return false; } // Get the BrowserObject class. - _browser_object_class = PyObject_GetAttrString(app_runner_module, "BrowserObject"); + _browser_object_class = PyObject_GetAttrString(javascript_module, "BrowserObject"); if (_browser_object_class == NULL) { PyErr_Print(); return false; @@ -272,7 +280,7 @@ run_python() { } Py_DECREF(app_runner_module); - + Py_DECREF(javascript_module); // Construct a Python wrapper around our methods we need to expose to Python. static PyMethodDef p3dpython_methods[] = { diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index 6f8c76266f..1fc8c6796d 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -1,7 +1,7 @@ __all__ = ['register', 'sharedPackages', 'reloadSharedPackage', 'reloadSharedPackages'] -from panda3d.core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream +from panda3d._core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream import sys import marshal import imp diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index df845b0c26..781caf9588 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -17,7 +17,6 @@ except ImportError: p3extend_frozen = None from panda3d.core import * -from pandac.extension_native_helpers import dll_suffix, dll_ext # Check to see if we are running python_d, which implies we have a # debug build, and we have to build the module with debug options. @@ -1394,15 +1393,6 @@ class PandaModuleFinder(modulefinder.ModuleFinder): # It's a frozen module. return (None, name, ('', '', imp.PY_FROZEN)) - # Look for a dtool extension. This loop is roughly lifted - # from extension_native_helpers.Dtool_PreloadDLL(). - filename = name + dll_suffix + dll_ext - for dir in sys.path + [sys.prefix]: - lib = os.path.join(dir, filename) - if os.path.exists(lib): - file = open(lib, 'rb') - return (file, lib, (dll_ext, 'rb', imp.C_EXTENSION)) - message = "DLL loader cannot find %s." % (name) raise ImportError, message diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 35bfea1e7f..30de3f1552 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -5026,11 +5026,13 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj') TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS) TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb') + TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll') TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER']) TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj') TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb') + TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll') TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER']) if GetTarget() == 'windows': @@ -5042,6 +5044,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj') TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS) TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb') + TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll') TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER']) if (PkgSkip("OPENSSL")==0 and RTDIST): diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 89227ee1bf..bfc5914b03 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -8799,6 +8799,7 @@ get_usage(Geom::UsageHint usage_hint) { return GL_STATIC_DRAW; } +#ifndef NDEBUG //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_compressed_format_string // Access: Public, Static @@ -8917,6 +8918,7 @@ get_compressed_format_string(GLenum format) { return NULL; } } +#endif //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_light_color From e4c3301bd03d1508e272941424c7212f12fe7654 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jul 2015 16:18:33 +0200 Subject: [PATCH 083/203] Shader context input state tracking system, for more efficiently updating shader inputs --- panda/src/glstuff/glCgShaderContext_src.I | 10 - panda/src/glstuff/glCgShaderContext_src.cxx | 195 ++++++++++---- panda/src/glstuff/glCgShaderContext_src.h | 25 +- panda/src/glstuff/glGraphicsBuffer_src.cxx | 2 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 170 +++++++----- .../src/glstuff/glGraphicsStateGuardian_src.h | 4 +- panda/src/glstuff/glShaderContext_src.I | 10 - panda/src/glstuff/glShaderContext_src.cxx | 247 +++++++++++++----- panda/src/glstuff/glShaderContext_src.h | 16 +- panda/src/gobj/shader.cxx | 69 ++++- panda/src/gobj/shader.h | 3 + panda/src/gobj/shaderContext.h | 5 +- panda/src/pgraph/colorBlendAttrib.h | 5 +- 13 files changed, 519 insertions(+), 242 deletions(-) diff --git a/panda/src/glstuff/glCgShaderContext_src.I b/panda/src/glstuff/glCgShaderContext_src.I index 243ed4c758..376347a96e 100644 --- a/panda/src/glstuff/glCgShaderContext_src.I +++ b/panda/src/glstuff/glCgShaderContext_src.I @@ -52,15 +52,5 @@ uses_custom_vertex_arrays() { return true; } -//////////////////////////////////////////////////////////////////// -// Function: GLCgShaderContext::uses_custom_texture_bindings -// Access: Public -// Description: Always true, for now. -//////////////////////////////////////////////////////////////////// -INLINE bool CLP(CgShaderContext):: -uses_custom_texture_bindings() { - return true; -} - #endif // OPENGLES_1 diff --git a/panda/src/glstuff/glCgShaderContext_src.cxx b/panda/src/glstuff/glCgShaderContext_src.cxx index a2301e74a7..1a4589e854 100644 --- a/panda/src/glstuff/glCgShaderContext_src.cxx +++ b/panda/src/glstuff/glCgShaderContext_src.cxx @@ -46,6 +46,7 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte _color_attrib_index = CA_color; _transform_table_param = 0; _slider_table_param = 0; + _frame_number = -1; nassertv(s->get_language() == Shader::SL_Cg); @@ -361,13 +362,8 @@ release_resources() { // input parameters. //////////////////////////////////////////////////////////////////// void CLP(CgShaderContext):: -bind(bool reissue_parameters) { +bind() { if (_cg_program != 0) { - if (reissue_parameters) { - // Pass in k-parameters and transform-parameters - issue_parameters(Shader::SSD_general); - } - // Bind the shaders. cgGLEnableProgramProfiles(_cg_program); cgGLBindProgram(_cg_program); @@ -397,6 +393,88 @@ unbind() { } } +//////////////////////////////////////////////////////////////////// +// Function: GLCgShaderContext::set_state_and_transform +// Access: Public +// Description: This function gets called whenever the RenderState +// or TransformState has changed, but the Shader +// itself has not changed. It loads new values into the +// shader's parameters. +//////////////////////////////////////////////////////////////////// +void CLP(CgShaderContext):: +set_state_and_transform(const RenderState *target_rs, + const TransformState *modelview_transform, + const TransformState *projection_transform) { + + if (!valid()) { + return; + } + + // Find out which state properties have changed. + int altered = 0; + + if (_modelview_transform != modelview_transform) { + _modelview_transform = modelview_transform; + altered |= Shader::SSD_transform; + } + if (_projection_transform != projection_transform) { + _projection_transform = projection_transform; + altered |= Shader::SSD_projection; + } + + if (_state_rs != target_rs) { + if (_state_rs == NULL) { + // We haven't set any state yet. + altered |= Shader::SSD_general; + } else { + if (_state_rs->get_attrib(ColorAttrib::get_class_slot()) != + target_rs->get_attrib(ColorAttrib::get_class_slot())) { + altered |= Shader::SSD_color; + } + if (_state_rs->get_attrib(ColorScaleAttrib::get_class_slot()) != + target_rs->get_attrib(ColorScaleAttrib::get_class_slot())) { + altered |= Shader::SSD_colorscale; + } + if (_state_rs->get_attrib(MaterialAttrib::get_class_slot()) != + target_rs->get_attrib(MaterialAttrib::get_class_slot())) { + altered |= Shader::SSD_material; + } + if (_state_rs->get_attrib(ShaderAttrib::get_class_slot()) != + target_rs->get_attrib(ShaderAttrib::get_class_slot())) { + altered |= Shader::SSD_shaderinputs; + } + if (_state_rs->get_attrib(FogAttrib::get_class_slot()) != + target_rs->get_attrib(FogAttrib::get_class_slot())) { + altered |= Shader::SSD_fog; + } + if (_state_rs->get_attrib(LightAttrib::get_class_slot()) != + target_rs->get_attrib(LightAttrib::get_class_slot())) { + altered |= Shader::SSD_light; + } + if (_state_rs->get_attrib(ClipPlaneAttrib::get_class_slot()) != + target_rs->get_attrib(ClipPlaneAttrib::get_class_slot())) { + altered |= Shader::SSD_clip_planes; + } + if (_state_rs->get_attrib(TexMatrixAttrib::get_class_slot()) != + target_rs->get_attrib(TexMatrixAttrib::get_class_slot())) { + altered |= Shader::SSD_tex_matrix; + } + } + _state_rs = target_rs; + } + + // Is this the first time this shader is used this frame? + int frame_number = ClockObject::get_global_clock()->get_frame_count(); + if (frame_number != _frame_number) { + altered |= Shader::SSD_frame; + _frame_number = frame_number; + } + + if (altered != 0) { + issue_parameters(altered); + } +} + //////////////////////////////////////////////////////////////////// // Function: GLCgShaderContext::issue_parameters // Access: Public @@ -414,49 +492,48 @@ unbind() { //////////////////////////////////////////////////////////////////// void CLP(CgShaderContext):: issue_parameters(int altered) { - //PStatGPUTimer timer(_glgsg, _glgsg->_draw_set_state_shader_parameters_pcollector); + PStatGPUTimer timer(_glgsg, _glgsg->_draw_set_state_shader_parameters_pcollector); - if (!valid()) { - return; + if (GLCAT.is_spam()) { + GLCAT.spam() + << "Setting uniforms for " << _shader->get_filename() + << " (altered 0x" << hex << altered << dec << ")\n"; } - // Iterate through _ptr parameters - for (int i=0; i<(int)_shader->_ptr_spec.size(); i++) { - if (altered & (_shader->_ptr_spec[i]._dep[0] | _shader->_ptr_spec[i]._dep[1])) { - const Shader::ShaderPtrSpec& _ptr = _shader->_ptr_spec[i]; - Shader::ShaderPtrData* ptr_data = - const_cast< Shader::ShaderPtrData*>(_glgsg->fetch_ptr_parameter(_ptr)); + // We have no way to track modifications to PTAs, so we assume that + // they are modified every frame and when we switch ShaderAttribs. + if (altered & (Shader::SSD_shaderinputs | Shader::SSD_frame)) { + // Iterate through _ptr parameters + for (int i = 0; i < (int)_shader->_ptr_spec.size(); ++i) { + Shader::ShaderPtrSpec &spec = _shader->_ptr_spec[i]; + const Shader::ShaderPtrData *ptr_data =_glgsg->fetch_ptr_parameter(spec); if (ptr_data == NULL){ //the input is not contained in ShaderPtrData release_resources(); return; } - //check if the data must be shipped to the GPU - /*if (!ptr_data->_updated) - continue; - ptr_data->_updated = false;*/ //Check if the size of the shader input and ptr_data match - int input_size = _ptr._dim[0] * _ptr._dim[1] * _ptr._dim[2]; + int input_size = spec._dim[0] * spec._dim[1] * spec._dim[2]; // dimension is negative only if the parameter had the (deprecated)k_ prefix. - if ((input_size > ptr_data->_size) && (_ptr._dim[0] > 0)) { - GLCAT.error() << _ptr._id._name << ": incorrect number of elements, expected " + if ((input_size > ptr_data->_size) && (spec._dim[0] > 0)) { + GLCAT.error() << spec._id._name << ": incorrect number of elements, expected " << input_size <<" got " << ptr_data->_size << "\n"; release_resources(); return; } - CGparameter p = _cg_parameter_map[_ptr._id._seqno]; + CGparameter p = _cg_parameter_map[spec._id._seqno]; switch (ptr_data->_type) { case Shader::SPT_float: - switch(_ptr._info._class) { + switch (spec._info._class) { case Shader::SAC_scalar: cgSetParameter1fv(p, (float*)ptr_data->_ptr); continue; case Shader::SAC_vector: - switch (_ptr._info._type) { + switch (spec._info._type) { case Shader::SAT_vec1: cgSetParameter1fv(p, (float*)ptr_data->_ptr); continue; @@ -479,22 +556,22 @@ issue_parameters(int altered) { continue; case Shader::SAC_array: - switch (_ptr._info._subclass) { + switch (spec._info._subclass) { case Shader::SAC_scalar: - cgGLSetParameterArray1f(p, 0, _ptr._dim[0], (float*)ptr_data->_ptr); + cgGLSetParameterArray1f(p, 0, spec._dim[0], (float*)ptr_data->_ptr); continue; case Shader::SAC_vector: - switch (_ptr._dim[2]) { - case 1: cgGLSetParameterArray1f(p, 0, _ptr._dim[0], (float*)ptr_data->_ptr); continue; - case 2: cgGLSetParameterArray2f(p, 0, _ptr._dim[0], (float*)ptr_data->_ptr); continue; - case 3: cgGLSetParameterArray3f(p, 0, _ptr._dim[0], (float*)ptr_data->_ptr); continue; - case 4: cgGLSetParameterArray4f(p, 0, _ptr._dim[0], (float*)ptr_data->_ptr); continue; + switch (spec._dim[2]) { + case 1: cgGLSetParameterArray1f(p, 0, spec._dim[0], (float*)ptr_data->_ptr); continue; + case 2: cgGLSetParameterArray2f(p, 0, spec._dim[0], (float*)ptr_data->_ptr); continue; + case 3: cgGLSetParameterArray3f(p, 0, spec._dim[0], (float*)ptr_data->_ptr); continue; + case 4: cgGLSetParameterArray4f(p, 0, spec._dim[0], (float*)ptr_data->_ptr); continue; default: - nassertd(_ptr._dim[2] > 0 && _ptr._dim[2] <= 4) continue; + nassertd(spec._dim[2] > 0 && spec._dim[2] <= 4) continue; } continue; case Shader::SAC_matrix: - cgGLSetMatrixParameterArrayfc(p, 0, _ptr._dim[0], (float*)ptr_data->_ptr); + cgGLSetMatrixParameterArrayfc(p, 0, spec._dim[0], (float*)ptr_data->_ptr); continue; default: nassertd(false) continue; @@ -504,13 +581,13 @@ issue_parameters(int altered) { } case Shader::SPT_double: - switch(_ptr._info._class) { + switch (spec._info._class) { case Shader::SAC_scalar: cgSetParameter1dv(p, (double*)ptr_data->_ptr); continue; case Shader::SAC_vector: - switch (_ptr._info._type) { + switch (spec._info._type) { case Shader::SAT_vec1: cgSetParameter1dv(p, (double*)ptr_data->_ptr); continue; @@ -533,22 +610,22 @@ issue_parameters(int altered) { continue; case Shader::SAC_array: - switch (_ptr._info._subclass) { + switch (spec._info._subclass) { case Shader::SAC_scalar: - cgGLSetParameterArray1d(p, 0, _ptr._dim[0], (double*)ptr_data->_ptr); + cgGLSetParameterArray1d(p, 0, spec._dim[0], (double*)ptr_data->_ptr); continue; case Shader::SAC_vector: - switch (_ptr._dim[2]) { - case 1: cgGLSetParameterArray1d(p, 0, _ptr._dim[0], (double*)ptr_data->_ptr); continue; - case 2: cgGLSetParameterArray2d(p, 0, _ptr._dim[0], (double*)ptr_data->_ptr); continue; - case 3: cgGLSetParameterArray3d(p, 0, _ptr._dim[0], (double*)ptr_data->_ptr); continue; - case 4: cgGLSetParameterArray4d(p, 0, _ptr._dim[0], (double*)ptr_data->_ptr); continue; + switch (spec._dim[2]) { + case 1: cgGLSetParameterArray1d(p, 0, spec._dim[0], (double*)ptr_data->_ptr); continue; + case 2: cgGLSetParameterArray2d(p, 0, spec._dim[0], (double*)ptr_data->_ptr); continue; + case 3: cgGLSetParameterArray3d(p, 0, spec._dim[0], (double*)ptr_data->_ptr); continue; + case 4: cgGLSetParameterArray4d(p, 0, spec._dim[0], (double*)ptr_data->_ptr); continue; default: - nassertd(_ptr._dim[2] > 0 && _ptr._dim[2] <= 4) continue; + nassertd(spec._dim[2] > 0 && spec._dim[2] <= 4) continue; } continue; case Shader::SAC_matrix: - cgGLSetMatrixParameterArraydc(p, 0, _ptr._dim[0], (double*)ptr_data->_ptr); + cgGLSetMatrixParameterArraydc(p, 0, spec._dim[0], (double*)ptr_data->_ptr); continue; default: nassertd(false) continue; @@ -559,12 +636,12 @@ issue_parameters(int altered) { continue; case Shader::SPT_int: - switch(_ptr._info._class) { + switch (spec._info._class) { case Shader::SAC_scalar: cgSetParameter1iv(p, (int*)ptr_data->_ptr); continue; case Shader::SAC_vector: - switch(_ptr._info._type) { + switch (spec._info._type) { case Shader::SAT_vec1: cgSetParameter1iv(p, (int*)ptr_data->_ptr); continue; case Shader::SAT_vec2: cgSetParameter2iv(p, (int*)ptr_data->_ptr); continue; case Shader::SAT_vec3: cgSetParameter3iv(p, (int*)ptr_data->_ptr); continue; @@ -576,21 +653,27 @@ issue_parameters(int altered) { nassertd(false) continue; } default: - GLCAT.error() << _ptr._id._name << ":" << "unrecognized parameter type\n"; + GLCAT.error() << spec._id._name << ":" << "unrecognized parameter type\n"; release_resources(); return; } } } - for (int i=0; i<(int)_shader->_mat_spec.size(); i++) { - if (altered & (_shader->_mat_spec[i]._dep[0] | _shader->_mat_spec[i]._dep[1])) { - const LMatrix4 *val = _glgsg->fetch_specified_value(_shader->_mat_spec[i], altered); + if (altered & _shader->_mat_deps) { + for (int i = 0; i < (int)_shader->_mat_spec.size(); ++i) { + Shader::ShaderMatSpec &spec = _shader->_mat_spec[i]; + + if ((altered & (spec._dep[0] | spec._dep[1])) == 0) { + continue; + } + + const LMatrix4 *val = _glgsg->fetch_specified_value(spec, altered); if (!val) continue; const PN_stdfloat *data = val->get_data(); - CGparameter p = _cg_parameter_map[_shader->_mat_spec[i]._id._seqno]; - switch (_shader->_mat_spec[i]._piece) { + CGparameter p = _cg_parameter_map[spec._id._seqno]; + switch (spec._piece) { case Shader::SMP_whole: GLfc(cgGLSetMatrixParameter)(p, data); continue; case Shader::SMP_transpose: GLfr(cgGLSetMatrixParameter)(p, data); continue; case Shader::SMP_col0: GLf(cgGLSetParameter4)(p, data[0], data[4], data[ 8], data[12]); continue; @@ -981,9 +1064,9 @@ disable_shader_texture_bindings() { //////////////////////////////////////////////////////////////////// void CLP(CgShaderContext):: update_shader_texture_bindings(ShaderContext *prev) { - if (prev) { - prev->disable_shader_texture_bindings(); - } + //if (prev) { + // prev->disable_shader_texture_bindings(); + //} if (!valid()) { return; diff --git a/panda/src/glstuff/glCgShaderContext_src.h b/panda/src/glstuff/glCgShaderContext_src.h index da1f0bea78..fb64d37bac 100644 --- a/panda/src/glstuff/glCgShaderContext_src.h +++ b/panda/src/glstuff/glCgShaderContext_src.h @@ -38,19 +38,23 @@ public: ALLOC_DELETED_CHAIN(CLP(CgShaderContext)); INLINE bool valid(void); - void bind(bool reissue_parameters = true); - void unbind(); - void issue_parameters(int altered); + void bind() OVERRIDE; + void unbind() OVERRIDE; + + void set_state_and_transform(const RenderState *state, + const TransformState *modelview_transform, + const TransformState *projection_transform); + + void issue_parameters(int altered) OVERRIDE; void update_transform_table(const TransformTable *table); void update_slider_table(const SliderTable *table); - void disable_shader_vertex_arrays(); - bool update_shader_vertex_arrays(ShaderContext *prev, bool force); - void disable_shader_texture_bindings(); - void update_shader_texture_bindings(ShaderContext *prev); + void disable_shader_vertex_arrays() OVERRIDE; + bool update_shader_vertex_arrays(ShaderContext *prev, bool force) OVERRIDE; + void disable_shader_texture_bindings() OVERRIDE; + void update_shader_texture_bindings(ShaderContext *prev) OVERRIDE; INLINE bool uses_standard_vertex_arrays(void); INLINE bool uses_custom_vertex_arrays(void); - INLINE bool uses_custom_texture_bindings(void); // Special values for location to indicate conventional attrib slots. enum ConventionalAttrib { @@ -74,6 +78,11 @@ private: pvector _cg_parameter_map; + CPT(RenderState) _state_rs; + CPT(TransformState) _modelview_transform; + CPT(TransformState) _projection_transform; + GLint _frame_number; + CLP(GraphicsStateGuardian) *_glgsg; bool _has_divisor; diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index e440ecb988..78ecf91bb1 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -307,7 +307,7 @@ rebuild_bitplanes() { RenderTexturePlane plane = rt._plane; Texture *tex = rt._texture; - if (rtm_mode == RTM_bind_layered) { + if (rtm_mode == RTM_bind_layered && glgsg->_supports_geometry_shaders) { if (tex->get_z_size() != _rb_size_z) { GLCAT.warning() << "All textures attached to layered FBO should have the same layer count!\n"; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index bfc5914b03..5fc640cce7 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1527,11 +1527,15 @@ reset() { _glVertexAttribLPointer = NULL; #endif -#ifndef OPENGLES_1 // We need to have a default shader to apply in case // something didn't happen to have a shader applied, or // if it failed to compile. This default shader just outputs // a red color, indicating that something went wrong. +#ifndef SUPPORT_FIXED_FUNCTION + if (_default_shader == NULL) { + _default_shader = Shader::make(Shader::SL_GLSL, default_vshader, default_fshader); + } +#elif !defined(OPENGLES) if (_default_shader == NULL && core_profile) { _default_shader = Shader::make(Shader::SL_GLSL, default_vshader, default_fshader); } @@ -2926,6 +2930,11 @@ clear_before_callback() { #ifndef OPENGLES if (_supports_sampler_objects) { _glBindSampler(0, 0); + + if (GLCAT.is_spam()) { + GLCAT.spam() + << "glBindSampler(0, 0)\n"; + } } #endif } @@ -5548,6 +5557,11 @@ framebuffer_copy_to_texture(Texture *tex, int view, int z, if (new_image && gtc->_immutable) { gtc->reset_data(); glBindTexture(target, gtc->_index); + + if (GLCAT.is_spam()) { + GLCAT.spam() + << "glBindTexture(0x" << hex << target << dec << ", " << gtc->_index << ")\n"; + } } #ifndef OPENGLES @@ -5844,12 +5858,6 @@ do_issue_transform() { #endif _transform_stale = false; -#ifndef OPENGLES_1 - if (_current_shader_context) { - _current_shader_context->issue_parameters(Shader::SSD_transform); - } -#endif - report_my_gl_errors(); } @@ -5885,9 +5893,9 @@ do_issue_shade_model() { // Description: //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: -do_issue_shader(bool state_has_changed) { +do_issue_shader() { ShaderContext *context = 0; - Shader *shader = (Shader *)(_target_shader->get_shader()); + Shader *shader = (Shader *)_target_shader->get_shader(); #ifndef SUPPORT_FIXED_FUNCTION // If we don't have a shader, apply the default shader. @@ -5919,18 +5927,13 @@ do_issue_shader(bool state_has_changed) { if (context != _current_shader_context) { // Use a completely different shader than before. // Unbind old shader, bind the new one. - if (_current_shader_context != 0) { + if (_current_shader_context != NULL && + _current_shader->get_language() != shader->get_language()) { _current_shader_context->unbind(); } context->bind(); _current_shader = shader; _current_shader_context = context; - context->issue_parameters(Shader::SSD_shaderinputs); - } else { - if (state_has_changed) { - // Use the same shader as before, but with new input arguments. - context->issue_parameters(Shader::SSD_shaderinputs); - } } } @@ -6410,6 +6413,11 @@ do_issue_blending() { _glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_ZERO, GL_ONE); } + + if (GLCAT.is_spam()) { + GLCAT.spam() << "glBlendEquation(GL_FUNC_ADD)\n"; + GLCAT.spam() << "glBlendFunc(GL_ZERO, GL_ONE)\n"; + } return; } else { set_color_write_mask(color_channels); @@ -6433,16 +6441,23 @@ do_issue_blending() { enable_blend(true); _glBlendEquation(get_blend_equation_type(color_blend_mode)); glBlendFunc(get_blend_func(color_blend->get_operand_a()), - get_blend_func(color_blend->get_operand_b())); + get_blend_func(color_blend->get_operand_b())); + LColor c; if (_color_blend_involves_color_scale) { // Apply the current color scale to the blend mode. - _glBlendColor(_current_color_scale[0], _current_color_scale[1], - _current_color_scale[2], _current_color_scale[3]); - + c = _current_color_scale; } else { - LColor c = color_blend->get_color(); - _glBlendColor(c[0], c[1], c[2], c[3]); + c = color_blend->get_color(); + } + + _glBlendColor(c[0], c[1], c[2], c[3]); + + if (GLCAT.is_spam()) { + GLCAT.spam() << "glBlendEquation(" << color_blend_mode << ")\n"; + GLCAT.spam() << "glBlendFunc(" << color_blend->get_operand_a() + << color_blend->get_operand_b() << ")\n"; + GLCAT.spam() << "glBlendColor(" << c << ")\n"; } return; } @@ -6460,6 +6475,11 @@ do_issue_blending() { enable_blend(true); _glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + if (GLCAT.is_spam()) { + GLCAT.spam() << "glBlendEquation(GL_FUNC_ADD)\n"; + GLCAT.spam() << "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n"; + } return; case TransparencyAttrib::M_multisample: @@ -6489,6 +6509,11 @@ do_issue_blending() { enable_blend(true); _glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + if (GLCAT.is_spam()) { + GLCAT.spam() << "glBlendEquation(GL_FUNC_ADD)\n"; + GLCAT.spam() << "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n"; + } return; } @@ -9224,10 +9249,27 @@ set_state_and_transform(const RenderState *target, } _target_rs = target; +#ifndef OPENGLES_1 _target_shader = (const ShaderAttrib *) _target_rs->get_attrib_def(ShaderAttrib::get_class_slot()); -#ifndef OPENGLES_1 _instance_count = _target_shader->get_instance_count(); + + if (_target_shader != _state_shader) { + //PStatGPUTimer timer(this, _draw_set_state_shader_pcollector); + do_issue_shader(); + _state_shader = _target_shader; + _state_mask.clear_bit(TextureAttrib::get_class_slot()); + } +#ifndef SUPPORT_FIXED_FUNCTION + else { // In the case of OpenGL ES 2.x, we need to glUseShader before we draw anything. + do_issue_shader(); + _state_mask.clear_bit(TextureAttrib::get_class_slot()); + } +#endif + + if (_current_shader_context != NULL) { + _current_shader_context->set_state_and_transform(target, transform, _projection_mat); + } #endif #ifdef SUPPORT_FIXED_FUNCTION @@ -9256,11 +9298,6 @@ set_state_and_transform(const RenderState *target, //PStatGPUTimer timer(this, _draw_set_state_clip_plane_pcollector); do_issue_clip_plane(); _state_mask.set_bit(clip_plane_slot); -#ifndef OPENGLES_1 - if (_current_shader_context) { - _current_shader_context->issue_parameters(Shader::SSD_clip_planes); - } -#endif } int color_slot = ColorAttrib::get_class_slot(); @@ -9274,12 +9311,6 @@ set_state_and_transform(const RenderState *target, do_issue_color_scale(); _state_mask.set_bit(color_slot); _state_mask.set_bit(color_scale_slot); -#ifndef OPENGLES_1 - if (_current_shader_context) { - _current_shader_context->issue_parameters(Shader::SSD_color); - _current_shader_context->issue_parameters(Shader::SSD_colorscale); - } -#endif } int cull_face_slot = CullFaceAttrib::get_class_slot(); @@ -9360,20 +9391,6 @@ set_state_and_transform(const RenderState *target, _state_mask.set_bit(color_blend_slot); } - if (_target_shader != _state_shader) { - //PStatGPUTimer timer(this, _draw_set_state_shader_pcollector); -#ifndef OPENGLES_1 - do_issue_shader(true); -#endif - _state_shader = _target_shader; - _state_mask.clear_bit(TextureAttrib::get_class_slot()); - } -#ifndef SUPPORT_FIXED_FUNCTION - else { // In the case of OpenGL ES 2.x, we need to glUseShader before we draw anything. - do_issue_shader(false); - } -#endif - int texture_slot = TextureAttrib::get_class_slot(); if (_target_rs->get_attrib(texture_slot) != _state_rs->get_attrib(texture_slot) || !_state_mask.get_bit(texture_slot)) { @@ -9441,11 +9458,6 @@ set_state_and_transform(const RenderState *target, do_issue_material(); #endif _state_mask.set_bit(material_slot); -#ifndef OPENGLES_1 - if (_current_shader_context) { - _current_shader_context->issue_parameters(Shader::SSD_material); - } -#endif } int light_slot = LightAttrib::get_class_slot(); @@ -9456,11 +9468,6 @@ set_state_and_transform(const RenderState *target, do_issue_light(); #endif _state_mask.set_bit(light_slot); -#ifndef OPENGLES_1 - if (_current_shader_context) { - _current_shader_context->issue_parameters(Shader::SSD_light); - } -#endif } int stencil_slot = StencilAttrib::get_class_slot(); @@ -9479,11 +9486,6 @@ set_state_and_transform(const RenderState *target, do_issue_fog(); #endif _state_mask.set_bit(fog_slot); -#ifndef OPENGLES_1 - if (_current_shader_context) { - _current_shader_context->issue_parameters(Shader::SSD_fog); - } -#endif } int scissor_slot = ScissorAttrib::get_class_slot(); @@ -9528,7 +9530,7 @@ do_issue_texture() { #ifdef OPENGLES_1 update_standard_texture_bindings(); #else - if (_current_shader_context == 0 || !_current_shader_context->uses_custom_texture_bindings()) { + if (_current_shader_context == 0) { // No shader, or a non-Cg shader. if (_texture_binding_shader_context != 0) { _texture_binding_shader_context->disable_shader_texture_bindings(); @@ -9909,9 +9911,9 @@ update_show_usage_texture_bindings(int show_stage_index) { UsageTextureKey key(texture->get_x_size(), texture->get_y_size()); UsageTextures::iterator ui = _usage_textures.find(key); + GLuint index; if (ui == _usage_textures.end()) { // Need to create a new texture for this size. - GLuint index; glGenTextures(1, &index); glBindTexture(GL_TEXTURE_2D, index); //TODO: this could be a lot simpler with glTexStorage2D @@ -9921,10 +9923,15 @@ update_show_usage_texture_bindings(int show_stage_index) { } else { // Just bind the previously-created texture. - GLuint index = (*ui).second; + index = (*ui).second; glBindTexture(GL_TEXTURE_2D, index); } + if (GLCAT.is_spam()) { + GLCAT.spam() + << "glBindTexture(GL_TEXTURE_2D, " << index << ")\n"; + } + //TODO: glBindSampler(0) ? } @@ -10468,9 +10475,14 @@ specify_texture(CLP(TextureContext) *gtc, const SamplerState &sampler) { #endif #ifndef OPENGLES - glTexParameterf(target, GL_TEXTURE_MIN_LOD, sampler.get_min_lod()); - glTexParameterf(target, GL_TEXTURE_MAX_LOD, sampler.get_max_lod()); - glTexParameterf(target, GL_TEXTURE_LOD_BIAS, sampler.get_lod_bias()); + if (is_at_least_gl_version(1, 2)) { + glTexParameterf(target, GL_TEXTURE_MIN_LOD, sampler.get_min_lod()); + glTexParameterf(target, GL_TEXTURE_MAX_LOD, sampler.get_max_lod()); + + if (is_at_least_gl_version(1, 4)) { + glTexParameterf(target, GL_TEXTURE_LOD_BIAS, sampler.get_lod_bias()); + } + } #endif report_my_gl_errors(); @@ -10505,7 +10517,12 @@ apply_texture(CLP(TextureContext) *gtc) { gtc->reset_data(); gtc->_target = target; } + glBindTexture(target, gtc->_index); + if (GLCAT.is_spam()) { + GLCAT.spam() + << "glBindTexture(0x" << hex << target << dec << ", " << gtc->_index << ")\n"; + } report_my_gl_errors(); return true; @@ -10537,8 +10554,8 @@ apply_sampler(GLuint unit, const SamplerState &sampler, CLP(TextureContext) *gtc _glBindSampler(unit, gsc->_index); if (GLCAT.is_spam()) { - GLCAT.spam() - << "bind " << unit << " " << sampler << "\n"; + GLCAT.spam() << "glBindSampler(" << unit << ", " + << gsc->_index << "): " << sampler << "\n"; } } else @@ -10791,6 +10808,11 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { GLCAT.warning() << "Attempt to modify texture with immutable storage, recreating texture.\n"; gtc->reset_data(); glBindTexture(target, gtc->_index); + + if (GLCAT.is_spam()) { + GLCAT.spam() + << "glBindTexture(0x" << hex << target << dec << ", " << gtc->_index << ")\n"; + } } #ifndef OPENGLES @@ -11045,6 +11067,8 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { gtc->update_data_size_bytes(get_texture_memory_size(tex)); } + nassertr(gtc->_has_storage, false); + if (tex->get_post_load_store_cache()) { tex->set_post_load_store_cache(false); // OK, get the RAM image, and save it in a BamCache record. @@ -11752,6 +11776,10 @@ do_extract_texture_data(CLP(TextureContext) *gtc) { #endif glBindTexture(target, gtc->_index); + if (GLCAT.is_spam()) { + GLCAT.spam() + << "glBindTexture(0x" << hex << target << dec << ", " << gtc->_index << ")\n"; + } Texture *tex = gtc->get_texture(); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index f38dd5326c..52845621a6 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -399,7 +399,7 @@ protected: void do_issue_depth_offset(); void do_issue_shade_model(); #ifndef OPENGLES_1 - void do_issue_shader(bool state_has_changed = false); + void do_issue_shader(); #endif #ifdef SUPPORT_FIXED_FUNCTION void do_issue_material(); @@ -462,8 +462,10 @@ protected: INLINE void enable_stencil_test(bool val); INLINE void enable_blend(bool val); INLINE void enable_depth_test(bool val); +#ifdef SUPPORT_FIXED_FUNCTION INLINE void enable_fog(bool val); INLINE void enable_alpha_test(bool val); +#endif INLINE void enable_polygon_offset(bool val); INLINE void set_color_write_mask(int mask); diff --git a/panda/src/glstuff/glShaderContext_src.I b/panda/src/glstuff/glShaderContext_src.I index c3424b8cca..d95671510f 100644 --- a/panda/src/glstuff/glShaderContext_src.I +++ b/panda/src/glstuff/glShaderContext_src.I @@ -55,13 +55,3 @@ INLINE bool CLP(ShaderContext):: uses_custom_vertex_arrays() { return true; } - -//////////////////////////////////////////////////////////////////// -// Function: GLShaderContext::uses_custom_texture_bindings -// Access: Public -// Description: Always true, for now. -//////////////////////////////////////////////////////////////////// -INLINE bool CLP(ShaderContext):: -uses_custom_texture_bindings() { - return true; -} diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 4602f60e7a..49eb12221a 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -18,17 +18,15 @@ #include "pStatGPUTimer.h" -TypeHandle CLP(ShaderContext)::_type_handle; +#include "colorAttrib.h" +#include "colorScaleAttrib.h" +#include "materialAttrib.h" +#include "shaderAttrib.h" +#include "fogAttrib.h" +#include "lightAttrib.h" +#include "clipPlaneAttrib.h" -#ifndef GL_GEOMETRY_SHADER_EXT -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#endif -#ifndef GL_GEOMETRY_VERTICES_OUT_EXT -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#endif -#ifndef GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#endif +TypeHandle CLP(ShaderContext)::_type_handle; //////////////////////////////////////////////////////////////////// // Function: GLShaderContext::ParseAndSetShaderUniformVars @@ -228,6 +226,7 @@ parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, GLenum param_t objShader->cp_optimize_mat_spec(bind); objShader->_mat_spec.push_back(bind); + objShader->_mat_deps |= bind._dep[0] | bind._dep[1]; if (param_size > 1) { // We support arrays of rows and arrays of columns, so we can @@ -338,8 +337,14 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext reflect_attribute(i, name_buffer, name_buflen); } - _glgsg->_glUseProgram(0); _glgsg->report_my_gl_errors(); + + // Restore the active shader. + if (_glgsg->_current_shader_context == NULL) { + _glgsg->_glUseProgram(0); + } else { + _glgsg->_current_shader_context->bind(); + } } //////////////////////////////////////////////////////////////////// @@ -715,8 +720,6 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._arg[0] = NULL; bind._arg[1] = NULL; - bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; if (matrix_name == "ModelViewProjectionMatrix") { if (inverse) { @@ -802,7 +805,9 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { GLCAT.error() << "Unrecognized uniform matrix name '" << matrix_name << "'!\n"; return; } + _shader->cp_optimize_mat_spec(bind); _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0] | bind._dep[1]; return; } if (size > 7 && noprefix.substr(0, 7) == "Texture") { @@ -846,6 +851,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._piece = Shader::SMP_row0; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } else if (noprefix == "Material.diffuse") { @@ -855,6 +861,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._piece = Shader::SMP_row1; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } else if (noprefix == "Material.emission") { @@ -864,6 +871,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._piece = Shader::SMP_row2; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } else if (noprefix == "Material.specular") { @@ -873,6 +881,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._piece = Shader::SMP_row3x3; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } else if (noprefix == "Material.shininess") { @@ -882,6 +891,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._piece = Shader::SMP_cell15; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } } @@ -906,6 +916,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { return; } _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } if (noprefix == "Color") { @@ -929,6 +940,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { return; } _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } if (noprefix == "ClipPlane") { @@ -951,6 +963,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._arg[1] = NULL; bind._dep[1] = Shader::SSD_NONE; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; } return; } @@ -975,6 +988,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { return; } _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } if (noprefix == "TransformTable") { @@ -1016,8 +1030,9 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._part[0] = Shader::SMO_world_to_view; bind._part[1] = Shader::SMO_view_to_apiview; bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; - bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; + bind._dep[1] = Shader::SSD_general; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0] | bind._dep[1]; return; } else if (noprefix == "InverseViewMatrix" || noprefix == "ViewMatrixInverse") { @@ -1025,9 +1040,10 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._func = Shader::SMF_compose; bind._part[0] = Shader::SMO_apiview_to_view; bind._part[1] = Shader::SMO_view_to_world; - bind._dep[0] = Shader::SSD_general | Shader::SSD_transform; + bind._dep[0] = Shader::SSD_general; bind._dep[1] = Shader::SSD_general | Shader::SSD_transform; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0] | bind._dep[1]; return; } else if (noprefix == "FrameTime") { @@ -1035,9 +1051,10 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._func = Shader::SMF_first; bind._part[0] = Shader::SMO_frame_time; bind._part[1] = Shader::SMO_identity; - bind._dep[0] = Shader::SSD_general; + bind._dep[0] = Shader::SSD_general | Shader::SSD_frame; bind._dep[1] = Shader::SSD_NONE; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0] | bind._dep[1]; return; } else if (noprefix == "DeltaFrameTime") { @@ -1045,9 +1062,10 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._func = Shader::SMF_first; bind._part[0] = Shader::SMO_frame_delta; bind._part[1] = Shader::SMO_identity; - bind._dep[0] = Shader::SSD_general; + bind._dep[0] = Shader::SSD_general | Shader::SSD_frame; bind._dep[1] = Shader::SSD_NONE; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0] | bind._dep[1]; return; } else if (noprefix == "FrameNumber") { @@ -1124,11 +1142,12 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._func = Shader::SMF_first; bind._part[0] = Shader::SMO_mat_constant_x; bind._arg[0] = InternalName::make(param_name); - bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs; + bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs | Shader::SSD_frame; bind._part[1] = Shader::SMO_identity; bind._arg[1] = NULL; bind._dep[1] = Shader::SSD_NONE; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } case GL_FLOAT_MAT4: { @@ -1138,11 +1157,12 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._func = Shader::SMF_first; bind._part[0] = Shader::SMO_mat_constant_x; bind._arg[0] = InternalName::make(param_name); - bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs; + bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs | Shader::SSD_frame; bind._part[1] = Shader::SMO_identity; bind._arg[1] = NULL; bind._dep[1] = Shader::SSD_NONE; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } case GL_FLOAT: @@ -1172,11 +1192,12 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { bind._func = Shader::SMF_first; bind._part[0] = Shader::SMO_vec_constant_x_attrib; bind._arg[0] = iname; - bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs; + bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs | Shader::SSD_frame; bind._part[1] = Shader::SMO_identity; bind._arg[1] = NULL; bind._dep[1] = Shader::SSD_NONE; _shader->_mat_spec.push_back(bind); + _shader->_mat_deps |= bind._dep[0]; return; } // else fall through } @@ -1228,7 +1249,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._arg = InternalName::make(param_name); bind._dim[0] = 1; - bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs; + bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs | Shader::SSD_frame; bind._dep[1] = Shader::SSD_NONE; _shader->_ptr_spec.push_back(bind); return; @@ -1335,7 +1356,7 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { } bind._arg = InternalName::make(param_name); bind._dim[0] = param_size; - bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs; + bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs | Shader::SSD_frame; bind._dep[1] = Shader::SSD_NONE; _shader->_ptr_spec.push_back(bind); return; @@ -1507,23 +1528,22 @@ release_resources() { // input parameters. //////////////////////////////////////////////////////////////////// void CLP(ShaderContext):: -bind(bool reissue_parameters) { - // GLSL shaders need to be bound before passing parameters. - if (!_shader->get_error_flag()) { - _glgsg->_glUseProgram(_glsl_program); - } - - if (reissue_parameters) { - // Pass in k-parameters and transform-parameters - issue_parameters(Shader::SSD_general); - } - +bind() { if (!_validated) { _glgsg->_glValidateProgram(_glsl_program); glsl_report_program_errors(_glsl_program, false); _validated = true; } + if (!_shader->get_error_flag()) { + _glgsg->_glUseProgram(_glsl_program); + } + + if (GLCAT.is_spam()) { + GLCAT.spam() << "glUseProgram(" << _glsl_program << "): " + << _shader->get_filename() << "\n"; + } + _glgsg->report_my_gl_errors(); } @@ -1534,10 +1554,92 @@ bind(bool reissue_parameters) { //////////////////////////////////////////////////////////////////// void CLP(ShaderContext):: unbind() { + if (GLCAT.is_spam()) { + GLCAT.spam() << "glUseProgram(0)\n"; + } + _glgsg->_glUseProgram(0); _glgsg->report_my_gl_errors(); } +//////////////////////////////////////////////////////////////////// +// Function: GLShaderContext::set_state_and_transform +// Access: Public +// Description: This function gets called whenever the RenderState +// or TransformState has changed, but the Shader +// itself has not changed. It loads new values into the +// shader's parameters. +//////////////////////////////////////////////////////////////////// +void CLP(ShaderContext):: +set_state_and_transform(const RenderState *target_rs, + const TransformState *modelview_transform, + const TransformState *projection_transform) { + + // Find out which state properties have changed. + int altered = 0; + + if (_modelview_transform != modelview_transform) { + _modelview_transform = modelview_transform; + altered |= Shader::SSD_transform; + } + if (_projection_transform != projection_transform) { + _projection_transform = projection_transform; + altered |= Shader::SSD_projection; + } + + if (_state_rs != target_rs) { + if (_state_rs == NULL) { + // We haven't set any state yet. + altered |= Shader::SSD_general; + } else { + if (_state_rs->get_attrib(ColorAttrib::get_class_slot()) != + target_rs->get_attrib(ColorAttrib::get_class_slot())) { + altered |= Shader::SSD_color; + } + if (_state_rs->get_attrib(ColorScaleAttrib::get_class_slot()) != + target_rs->get_attrib(ColorScaleAttrib::get_class_slot())) { + altered |= Shader::SSD_colorscale; + } + if (_state_rs->get_attrib(MaterialAttrib::get_class_slot()) != + target_rs->get_attrib(MaterialAttrib::get_class_slot())) { + altered |= Shader::SSD_material; + } + if (_state_rs->get_attrib(ShaderAttrib::get_class_slot()) != + target_rs->get_attrib(ShaderAttrib::get_class_slot())) { + altered |= Shader::SSD_shaderinputs; + } + if (_state_rs->get_attrib(FogAttrib::get_class_slot()) != + target_rs->get_attrib(FogAttrib::get_class_slot())) { + altered |= Shader::SSD_fog; + } + if (_state_rs->get_attrib(LightAttrib::get_class_slot()) != + target_rs->get_attrib(LightAttrib::get_class_slot())) { + altered |= Shader::SSD_light; + } + if (_state_rs->get_attrib(ClipPlaneAttrib::get_class_slot()) != + target_rs->get_attrib(ClipPlaneAttrib::get_class_slot())) { + altered |= Shader::SSD_clip_planes; + } + if (_state_rs->get_attrib(TexMatrixAttrib::get_class_slot()) != + target_rs->get_attrib(TexMatrixAttrib::get_class_slot())) { + altered |= Shader::SSD_tex_matrix; + } + } + _state_rs = target_rs; + } + + // Is this the first time this shader is used this frame? + int frame_number = ClockObject::get_global_clock()->get_frame_count(); + if (frame_number != _frame_number) { + altered |= Shader::SSD_frame; + _frame_number = frame_number; + } + + if (altered != 0) { + issue_parameters(altered); + } +} + //////////////////////////////////////////////////////////////////// // Function: GLShaderContext::issue_parameters // Access: Public @@ -1545,35 +1647,30 @@ unbind() { // or TransformState has changed, but the Shader // itself has not changed. It loads new values into the // shader's parameters. -// -// If "altered" is false, that means you promise that -// the parameters for this shader context have already -// been issued once, and that since the last time the -// parameters were issued, no part of the render -// state has changed except the external and internal -// transforms. //////////////////////////////////////////////////////////////////// void CLP(ShaderContext):: issue_parameters(int altered) { - //PStatGPUTimer timer(_glgsg, _glgsg->_draw_set_state_shader_parameters_pcollector); + PStatGPUTimer timer(_glgsg, _glgsg->_draw_set_state_shader_parameters_pcollector); - if (!valid()) { - return; + if (GLCAT.is_spam()) { + GLCAT.spam() + << "Setting uniforms for " << _shader->get_filename() + << " (altered 0x" << hex << altered << dec << ")\n"; } - if (_frame_number_loc != -1) { - int current_frame = ClockObject::get_global_clock()->get_frame_count(); - if (current_frame != _frame_number) { - _glgsg->_glUniform1i(_frame_number_loc, current_frame); - _frame_number = current_frame; + // We have no way to track modifications to PTAs, so we assume that + // they are modified every frame and when we switch ShaderAttribs. + if (altered & (Shader::SSD_shaderinputs | Shader::SSD_frame)) { + + // If we have an osg_FrameNumber input, set it now. + if ((altered | Shader::SSD_frame) != 0 && _frame_number_loc >= 0) { + _glgsg->_glUniform1i(_frame_number_loc, _frame_number); } - } - // Iterate through _ptr parameters - for (int i = 0; i < (int)_shader->_ptr_spec.size(); ++i) { - Shader::ShaderPtrSpec &spec = _shader->_ptr_spec[i]; + // Iterate through _ptr parameters + for (int i = 0; i < (int)_shader->_ptr_spec.size(); ++i) { + Shader::ShaderPtrSpec &spec = _shader->_ptr_spec[i]; - if (altered & (spec._dep[0] | spec._dep[1])) { const Shader::ShaderPtrData* ptr_data = _glgsg->fetch_ptr_parameter(spec); if (ptr_data == NULL) { //the input is not contained in ShaderPtrData release_resources(); @@ -1657,10 +1754,14 @@ issue_parameters(int altered) { } } - for (int i = 0; i < (int)_shader->_mat_spec.size(); ++i) { - Shader::ShaderMatSpec &spec = _shader->_mat_spec[i]; + if (altered & _shader->_mat_deps) { + for (int i = 0; i < (int)_shader->_mat_spec.size(); ++i) { + Shader::ShaderMatSpec &spec = _shader->_mat_spec[i]; + + if ((altered & (spec._dep[0] | spec._dep[1])) == 0) { + continue; + } - if (altered & (spec._dep[0] | spec._dep[1])) { const LMatrix4 *val = _glgsg->fetch_specified_value(spec, altered); if (!val) continue; #ifndef STDFLOAT_DOUBLE @@ -1814,12 +1915,12 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { return true; } -#ifdef SUPPORT_IMMEDIATE_MODE - if (_glgsg->_use_sender) { - GLCAT.error() << "immediate mode shaders not implemented yet\n"; - } else -#endif // SUPPORT_IMMEDIATE_MODE - { + if (valid()) { + // Get the active ColorAttrib. We'll need it to determine how to + // apply vertex colors. + const ColorAttrib *color_attrib; + _state_rs->get_attrib_def(color_attrib); + const GeomVertexArrayDataHandle *array_reader; Geom::NumericType numeric_type; int start, stride, num_values; @@ -1845,7 +1946,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { // Don't apply vertex colors if they are disabled with a ColorAttrib. int num_elements, element_stride, divisor; bool normalized; - if ((p != _color_attrib_index || _glgsg->_vertex_colors_enabled) && + if ((p != _color_attrib_index || color_attrib->get_type() == ColorAttrib::T_vertex) && _glgsg->_data_reader->get_array_info(name, array_reader, num_values, numeric_type, normalized, start, stride, divisor, @@ -1891,9 +1992,9 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { if (p == _color_attrib_index) { // Vertex colors are disabled or not present. Apply flat color. #if defined(STDFLOAT_DOUBLE) && !defined(OPENGLES) - _glgsg->_glVertexAttrib4dv(p, _glgsg->_scene_graph_color.get_data()); + _glgsg->_glVertexAttrib4dv(p, color_attrib->get_color().get_data()); #else - _glgsg->_glVertexAttrib4fv(p, _glgsg->_scene_graph_color.get_data()); + _glgsg->_glVertexAttrib4fv(p, color_attrib->get_color().get_data()); #endif } } @@ -1926,6 +2027,8 @@ disable_shader_texture_bindings() { return; } + DO_PSTATS_STUFF(_glgsg->_texture_state_pcollector.add_level(1)); + for (int i = 0; i < _shader->_tex_spec.size(); ++i) { #ifndef OPENGLES // Check if bindless was used, if so, there's nothing to unbind. @@ -1960,9 +2063,7 @@ disable_shader_texture_bindings() { break; case Texture::TT_3d_texture: -#ifndef OPENGLES_1 glBindTexture(GL_TEXTURE_3D, 0); -#endif break; case Texture::TT_2d_texture_array: @@ -2026,9 +2127,9 @@ disable_shader_texture_bindings() { //////////////////////////////////////////////////////////////////// void CLP(ShaderContext):: update_shader_texture_bindings(ShaderContext *prev) { - if (prev) { - prev->disable_shader_texture_bindings(); - } + //if (prev) { + // prev->disable_shader_texture_bindings(); + //} if (!valid()) { return; @@ -2134,8 +2235,10 @@ update_shader_texture_bindings(ShaderContext *prev) { // We get the TextureAttrib directly from the _target_rs, not the // filtered TextureAttrib in _target_texture. - const TextureAttrib *texattrib = DCAST(TextureAttrib, _glgsg->_target_rs->get_attrib_def(TextureAttrib::get_class_slot())); - nassertv(texattrib != (TextureAttrib *)NULL); + const TextureAttrib *texattrib; + _glgsg->_target_rs->get_attrib_def(texattrib); + //const TextureAttrib *texattrib; + //_state_rs->get_attrib_def(TextureAttrib::get_class_slot()); for (int i = 0; i < (int)_shader->_tex_spec.size(); ++i) { Shader::ShaderTexSpec &spec = _shader->_tex_spec[i]; diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index cc04500c9d..f6231b8481 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -45,19 +45,23 @@ public: bool get_sampler_texture_type(int &out, GLenum param_type); INLINE bool valid(void); - void bind(bool reissue_parameters = true); + void bind(); void unbind(); + + void set_state_and_transform(const RenderState *state, + const TransformState *modelview_transform, + const TransformState *projection_transform); + void issue_parameters(int altered); void update_transform_table(const TransformTable *table); void update_slider_table(const SliderTable *table); void disable_shader_vertex_arrays(); bool update_shader_vertex_arrays(ShaderContext *prev, bool force); - void disable_shader_texture_bindings(); - void update_shader_texture_bindings(ShaderContext *prev); + void disable_shader_texture_bindings() OVERRIDE; + void update_shader_texture_bindings(ShaderContext *prev) OVERRIDE; INLINE bool uses_standard_vertex_arrays(void); INLINE bool uses_custom_vertex_arrays(void); - INLINE bool uses_custom_texture_bindings(void); private: bool _validated; @@ -65,6 +69,10 @@ private: typedef pvector GLSLShaders; GLSLShaders _glsl_shaders; + CPT(RenderState) _state_rs; + CPT(TransformState) _modelview_transform; + CPT(TransformState) _projection_transform; + //struct ParamContext { // CPT(InternalName) _name; // GLint _location; diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index b20ac8e1b2..57b5882ea7 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -416,7 +416,17 @@ cp_dependency(ShaderMatInput inp) { if ((inp == SMO_model_to_view) || (inp == SMO_view_to_model) || (inp == SMO_model_to_apiview) || - (inp == SMO_apiview_to_model)) { + (inp == SMO_apiview_to_model) || + (inp == SMO_view_to_world) || + (inp == SMO_world_to_view) || + (inp == SMO_view_x_to_view) || + (inp == SMO_view_to_view_x) || + (inp == SMO_apiview_x_to_view) || + (inp == SMO_view_to_apiview_x) || + (inp == SMO_clip_x_to_view) || + (inp == SMO_view_to_clip_x) || + (inp == SMO_apiclip_x_to_view) || + (inp == SMO_view_to_apiclip_x)) { dep |= SSD_transform; } if ((inp == SMO_texpad_x) || @@ -438,6 +448,25 @@ cp_dependency(ShaderMatInput inp) { (inp == SMO_apiclip_x_to_view) || (inp == SMO_view_to_apiclip_x)) { dep |= SSD_shaderinputs; + + if ((inp == SMO_alight_x) || + (inp == SMO_dlight_x) || + (inp == SMO_plight_x) || + (inp == SMO_slight_x) || + (inp == SMO_satten_x) || + (inp == SMO_vec_constant_x_attrib) || + (inp == SMO_view_x_to_view) || + (inp == SMO_view_to_view_x) || + (inp == SMO_apiview_x_to_view) || + (inp == SMO_view_to_apiview_x) || + (inp == SMO_clip_x_to_view) || + (inp == SMO_view_to_clip_x) || + (inp == SMO_apiclip_x_to_view) || + (inp == SMO_view_to_apiclip_x)) { + // We can't track changes to these yet, so we have to assume that + // they are modified every frame. + dep |= SSD_frame; + } } if ((inp == SMO_light_ambient) || (inp == SMO_light_source_i_attrib)) { @@ -455,6 +484,21 @@ cp_dependency(ShaderMatInput inp) { if (inp == SMO_texmat_i || inp == SMO_inv_texmat_i) { dep |= SSD_tex_matrix; } + if ((inp == SMO_window_size) || + (inp == SMO_pixel_size) || + (inp == SMO_frame_number) || + (inp == SMO_frame_time) || + (inp == SMO_frame_delta)) { + dep |= SSD_frame; + } + if ((inp == SMO_clip_to_view) || + (inp == SMO_view_to_clip) || + (inp == SMO_apiclip_to_view) || + (inp == SMO_view_to_apiclip) || + (inp == SMO_apiview_to_apiclip) || + (inp == SMO_apiclip_to_apiview)) { + dep |= SSD_projection; + } return dep; } @@ -857,6 +901,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { } cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -931,6 +976,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -944,6 +990,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -967,6 +1014,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -988,6 +1036,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1029,6 +1078,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { } cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1051,6 +1101,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1072,6 +1123,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1093,6 +1145,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1139,6 +1192,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1195,6 +1249,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { bind._arg[1] = NULL; cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1215,6 +1270,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { bind._arg[1] = NULL; cp_optimize_mat_spec(bind); _mat_spec.push_back(bind); + _mat_deps |= bind._dep[0] | bind._dep[1]; return true; } @@ -1261,8 +1317,12 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { bind._id = p._id; bind._arg = kinputname; bind._info = p; - bind._dep[0] = SSD_general | SSD_shaderinputs; - bind._dep[1] = SSD_general | SSD_NONE; + + // We specify SSD_frame because a PTA may be modified by the app + // from frame to frame, and we have no way to know. So, we must + // respecify a PTA at least once every frame. + bind._dep[0] = SSD_general | SSD_shaderinputs | SSD_frame; + bind._dep[1] = SSD_NONE; memcpy(bind._dim,arg_dim,sizeof(int)*3); @@ -2050,7 +2110,8 @@ Shader(ShaderLanguage lang) : _parse(0), _loaded(false), _language(lang), - _last_modified(0) + _last_modified(0), + _mat_deps(0) { #ifdef HAVE_CG _cg_vprogram = 0; diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 33fe43b799..0c2fb79401 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -273,6 +273,8 @@ public: SSD_light = 0x080, SSD_clip_planes = 0x100, SSD_tex_matrix = 0x200, + SSD_frame = 0x400, + SSD_projection = 0x800, }; enum ShaderBug { @@ -529,6 +531,7 @@ public: epvector _mat_spec; pvector _tex_spec; pvector _var_spec; + int _mat_deps; bool _error_flag; ShaderFile _text; diff --git a/panda/src/gobj/shaderContext.h b/panda/src/gobj/shaderContext.h index 5785b155c9..8531966a10 100644 --- a/panda/src/gobj/shaderContext.h +++ b/panda/src/gobj/shaderContext.h @@ -36,8 +36,10 @@ class EXPCL_PANDA_GOBJ ShaderContext: public SavedContext { public: INLINE ShaderContext(Shader *se); + INLINE virtual void set_state_and_transform(const RenderState *, const TransformState *, const TransformState*) {}; + INLINE virtual bool valid() { return false; } - INLINE virtual void bind(bool reissue_parameters = true) {}; + INLINE virtual void bind() {}; INLINE virtual void unbind() {}; INLINE virtual void issue_parameters(int altered) {}; INLINE virtual void disable_shader_vertex_arrays() {}; @@ -47,7 +49,6 @@ public: INLINE virtual bool uses_standard_vertex_arrays(void) { return true; }; INLINE virtual bool uses_custom_vertex_arrays(void) { return false; }; - INLINE virtual bool uses_custom_texture_bindings(void) { return false; }; PUBLISHED: INLINE Shader *get_shader() const; diff --git a/panda/src/pgraph/colorBlendAttrib.h b/panda/src/pgraph/colorBlendAttrib.h index dc2975985f..0de99e04e5 100644 --- a/panda/src/pgraph/colorBlendAttrib.h +++ b/panda/src/pgraph/colorBlendAttrib.h @@ -141,10 +141,9 @@ private: static int _attrib_slot; }; -ostream &operator << (ostream &out, ColorBlendAttrib::Mode mode); -ostream &operator << (ostream &out, ColorBlendAttrib::Operand operand); +EXPCL_PANDA_PGRAPH ostream &operator << (ostream &out, ColorBlendAttrib::Mode mode); +EXPCL_PANDA_PGRAPH ostream &operator << (ostream &out, ColorBlendAttrib::Operand operand); #include "colorBlendAttrib.I" #endif - From 1ee8c5f6d2ede96c267c91623659cbcc26a2b160 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jul 2015 19:48:24 +0200 Subject: [PATCH 084/203] Oops, typo fix --- panda/src/display/graphicsStateGuardian.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index de9b8d0036..02ee982feb 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -817,7 +817,7 @@ PT(GeomMunger) GraphicsStateGuardian:: get_geom_munger(const RenderState *state, Thread *current_thread) { RenderState::Mungers &mungers = state->_mungers; - if (mungers.is_empty()) { + if (!mungers.is_empty()) { // Before we even look up the map, see if the _last_mi value points // to this GSG. This is likely because we tend to visit the same // state multiple times during a frame. Also, this might well be From b9d45ccc04df24f28da03dfd89e78153833931ed Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jul 2015 21:29:13 +0200 Subject: [PATCH 085/203] Fixes for the fact that render states were no longer sticking around in the cache between frames --- panda/src/pgraph/cullResult.cxx | 79 +++++++++++++++++++---------- panda/src/pgraph/cullResult.h | 11 ++-- panda/src/pgraph/cullableObject.cxx | 4 +- 3 files changed, 61 insertions(+), 33 deletions(-) diff --git a/panda/src/pgraph/cullResult.cxx b/panda/src/pgraph/cullResult.cxx index cd27cc29f5..b346218868 100644 --- a/panda/src/pgraph/cullResult.cxx +++ b/panda/src/pgraph/cullResult.cxx @@ -123,12 +123,9 @@ add_object(CullableObject *object, const CullTraverser *traverser) { Thread *current_thread = traverser->get_current_thread(); CullBinManager *bin_manager = CullBinManager::get_global_ptr(); - const RenderState *state = object->_state; - nassertv(state != (const RenderState *)NULL); - // This is probably a good time to check for an auto rescale setting. const RescaleNormalAttrib *rescale; - state->get_attrib_def(rescale); + object->_state->get_attrib_def(rescale); if (rescale->get_mode() == RescaleNormalAttrib::M_auto) { RescaleNormalAttrib::Mode mode; @@ -140,24 +137,23 @@ add_object(CullableObject *object, const CullTraverser *traverser) { mode = RescaleNormalAttrib::M_normalize; } - state = state->set_attrib(RescaleNormalAttrib::make(mode)); - object->_state = state; + object->_state = object->_state->compose(get_rescale_normal_state(mode)); } // Check to see if there's a special transparency setting. const TransparencyAttrib *trans; - if (state->get_attrib(trans)) { + if (object->_state->get_attrib(trans)) { switch (trans->get_mode()) { case TransparencyAttrib::M_alpha: // M_alpha implies an alpha-write test, so we don't waste time // writing 0-valued pixels. - object->_state = state->compose(get_alpha_state()); + object->_state = object->_state->compose(get_alpha_state()); check_flash_transparency(object->_state, flash_alpha_color); break; case TransparencyAttrib::M_binary: // M_binary is implemented by explicitly setting the alpha test. - object->_state = state->compose(get_binary_state()); + object->_state = object->_state->compose(get_binary_state()); check_flash_transparency(object->_state, flash_binary_color); break; @@ -166,7 +162,7 @@ add_object(CullableObject *object, const CullTraverser *traverser) { // The multisample modes are implemented using M_binary if the // GSG in use doesn't support multisample. if (!_gsg->get_supports_multisample()) { - object->_state = state->compose(get_binary_state()); + object->_state = object->_state->compose(get_binary_state()); } check_flash_transparency(object->_state, flash_multisample_color); break; @@ -174,7 +170,6 @@ add_object(CullableObject *object, const CullTraverser *traverser) { case TransparencyAttrib::M_dual: #ifndef NDEBUG check_flash_transparency(object->_state, flash_dual_color); - state = object->_state; #endif if (!m_dual) { // If m_dual is configured off, it becomes M_alpha. @@ -188,10 +183,8 @@ add_object(CullableObject *object, const CullTraverser *traverser) { // explicit bin already applied; otherwise, M_dual falls back // to M_alpha. { - const CullBinAttrib *bin_attrib = (const CullBinAttrib *) - state->get_attrib(CullBinAttrib::get_class_slot()); - - if (bin_attrib == (CullBinAttrib *)NULL || + const CullBinAttrib *bin_attrib; + if (!object->_state->get_attrib(bin_attrib) || bin_attrib->get_bin_name().empty()) { // We make a copy of the object to draw the transparent part; // this gets placed in the transparent bin. @@ -201,7 +194,7 @@ add_object(CullableObject *object, const CullTraverser *traverser) { { CullableObject *transparent_part = new CullableObject(*object); CPT(RenderState) transparent_state = get_dual_transparent_state(); - transparent_part->_state = state->compose(transparent_state); + transparent_part->_state = object->_state->compose(transparent_state); if (transparent_part->munge_geom (_gsg, _gsg->get_geom_munger(transparent_part->_state, current_thread), traverser, force)) { @@ -217,7 +210,7 @@ add_object(CullableObject *object, const CullTraverser *traverser) { // Now we can draw the opaque part. This will end up in // the opaque bin. - object->_state = state->compose(get_dual_opaque_state()); + object->_state = object->_state->compose(get_dual_opaque_state()); #ifndef NDEBUG if (!m_dual_opaque) { delete object; @@ -255,7 +248,7 @@ add_object(CullableObject *object, const CullTraverser *traverser) { delete wireframe_part; } - object->_state = object->_state->set_attrib(RenderModeAttrib::make(RenderModeAttrib::M_filled)); + object->_state = object->_state->compose(get_wireframe_filled_state()); } } @@ -404,13 +397,29 @@ make_new_bin(int bin_index) { return bin_ptr; } +//////////////////////////////////////////////////////////////////// +// Function: CullResult::get_rescale_normal_state +// Access: Private +// Description: Returns a RenderState containing the given rescale +// normal attribute. +//////////////////////////////////////////////////////////////////// +const RenderState *CullResult:: +get_rescale_normal_state(RescaleNormalAttrib::Mode mode) { + static CPT(RenderState) states[RescaleNormalAttrib::M_auto + 1]; + if (states[mode].is_null()) { + states[mode] = RenderState::make(RescaleNormalAttrib::make(mode), + RenderState::get_max_priority()); + } + return states[mode].p(); +} + //////////////////////////////////////////////////////////////////// // Function: CullResult::get_alpha_state // Access: Private // Description: Returns a RenderState that changes the alpha test to // > 0, for implementing M_alpha. //////////////////////////////////////////////////////////////////// -CPT(RenderState) CullResult:: +const RenderState *CullResult:: get_alpha_state() { static CPT(RenderState) state = NULL; if (state == (const RenderState *)NULL) { @@ -418,7 +427,7 @@ get_alpha_state() { // user to override this if he desires. state = RenderState::make(AlphaTestAttrib::make(AlphaTestAttrib::M_greater, 0.0f)); } - return state; + return state.p(); } //////////////////////////////////////////////////////////////////// @@ -427,7 +436,7 @@ get_alpha_state() { // Description: Returns a RenderState that applies the effects of // M_binary. //////////////////////////////////////////////////////////////////// -CPT(RenderState) CullResult:: +const RenderState *CullResult:: get_binary_state() { static CPT(RenderState) state = NULL; if (state == (const RenderState *)NULL) { @@ -435,7 +444,7 @@ get_binary_state() { TransparencyAttrib::make(TransparencyAttrib::M_none), RenderState::get_max_priority()); } - return state; + return state.p(); } #ifndef NDEBUG @@ -465,7 +474,7 @@ apply_flash_color(CPT(RenderState) &state, const LColor &flash_color) { // Description: Returns a RenderState that renders only the // transparent parts of an object, in support of M_dual. //////////////////////////////////////////////////////////////////// -CPT(RenderState) CullResult:: +const RenderState *CullResult:: get_dual_transparent_state() { static CPT(RenderState) state = NULL; if (state == (const RenderState *)NULL) { @@ -495,12 +504,12 @@ get_dual_transparent_state() { flash_state = flash_state->add_attrib(AlphaTestAttrib::make(AlphaTestAttrib::M_less, 1.0f), RenderState::get_max_priority()); } - return flash_state; + return flash_state.p(); } } #endif // NDEBUG - return state; + return state.p(); } //////////////////////////////////////////////////////////////////// @@ -509,7 +518,7 @@ get_dual_transparent_state() { // Description: Returns a RenderState that renders only the // opaque parts of an object, in support of M_dual. //////////////////////////////////////////////////////////////////// -CPT(RenderState) CullResult:: +const RenderState *CullResult:: get_dual_opaque_state() { static CPT(RenderState) state = NULL; if (state == (const RenderState *)NULL) { @@ -530,12 +539,26 @@ get_dual_opaque_state() { RenderState::get_max_priority()); } - return flash_state; + return flash_state.p(); } } #endif // NDEBUG - return state; + return state.p(); +} + +//////////////////////////////////////////////////////////////////// +// Function: CullResult::get_wireframe_filled_state +// Access: Private +// Description: Returns a RenderState that is composed with the +// filled part of an M_filled_wireframe model. +//////////////////////////////////////////////////////////////////// +const RenderState *CullResult:: +get_wireframe_filled_state() { + static CPT(RenderState) state = RenderState::make( + RenderModeAttrib::make(RenderModeAttrib::M_filled), + RenderState::get_max_priority()); + return state.p(); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/cullResult.h b/panda/src/pgraph/cullResult.h index e24264e469..585b27e606 100644 --- a/panda/src/pgraph/cullResult.h +++ b/panda/src/pgraph/cullResult.h @@ -26,6 +26,7 @@ #include "pvector.h" #include "pset.h" #include "pmap.h" +#include "rescaleNormalAttrib.h" class CullTraverser; class GraphicsStateGuardianBase; @@ -74,10 +75,12 @@ private: void apply_flash_color(CPT(RenderState) &state, const LColor &flash_color); #endif - static CPT(RenderState) get_alpha_state(); - static CPT(RenderState) get_binary_state(); - static CPT(RenderState) get_dual_transparent_state(); - static CPT(RenderState) get_dual_opaque_state(); + static const RenderState *get_rescale_normal_state(RescaleNormalAttrib::Mode mode); + static const RenderState *get_alpha_state(); + static const RenderState *get_binary_state(); + static const RenderState *get_dual_transparent_state(); + static const RenderState *get_dual_opaque_state(); + static const RenderState *get_wireframe_filled_state(); static CPT(RenderState) get_wireframe_overlay_state(const RenderModeAttrib *rmode); GraphicsStateGuardianBase *_gsg; diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index 5ad7a9b5f2..2eae19dac5 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -136,7 +136,9 @@ munge_geom(GraphicsStateGuardianBase *gsg, if (_state->get_attrib(sattr) && sattr->auto_shader()) { GeomVertexDataPipelineReader data_reader(_munged_data, current_thread); if (data_reader.get_format()->get_animation().get_animation_type() == Geom::AT_hardware) { - _state = _state->set_attrib(sattr->set_flag(ShaderAttrib::F_hardware_skinning, true)); + static CPT(RenderState) state = RenderState::make( + DCAST(ShaderAttrib, ShaderAttrib::make())->set_flag(ShaderAttrib::F_hardware_skinning, true)); + _state = _state->compose(state); } } From acc2a310d0cfc82fc9d35cf0eaefbff923b829db Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Jul 2015 21:43:19 +0200 Subject: [PATCH 086/203] Change debug category for shader generator to pgraphnodes --- panda/src/pgraphnodes/shaderGenerator.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 488fe84c95..bb08db38a6 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -538,7 +538,7 @@ create_shader_attrib(const string &txt) { if (_shadows && _dlights[i]->_shadow_caster) { PT(Texture) tex = update_shadow_buffer(_dlights_np[i]); if (tex == NULL) { - pgraph_cat.error() << "Failed to create shadow buffer for DirectionalLight '" << _dlights[i]->get_name() << "'!\n"; + pgraphnodes_cat.error() << "Failed to create shadow buffer for DirectionalLight '" << _dlights[i]->get_name() << "'!\n"; } shattr = DCAST(ShaderAttrib, shattr)->set_shader_input(InternalName::make("dlighttex", i), tex); } else { @@ -553,7 +553,7 @@ create_shader_attrib(const string &txt) { if (_shadows && _slights[i]->_shadow_caster) { PT(Texture) tex = update_shadow_buffer(_slights_np[i]); if (tex == NULL) { - pgraph_cat.error() << "Failed to create shadow buffer for Spotlight '" << _slights[i]->get_name() << "'!\n"; + pgraphnodes_cat.error() << "Failed to create shadow buffer for Spotlight '" << _slights[i]->get_name() << "'!\n"; } shattr = DCAST(ShaderAttrib, shattr)->set_shader_input(InternalName::make("slighttex", i), tex); } else { @@ -635,9 +635,10 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { analyze_renderstate(rs); reset_register_allocator(); - if (pgraph_cat.is_debug()) { - pgraph_cat.debug() - << "Generating shader for render state " << *rs << "\n"; + if (pgraphnodes_cat.is_debug()) { + pgraphnodes_cat.debug() + << "Generating shader for render state " << rs << ":\n"; + rs->write(pgraphnodes_cat.debug(false), 2); } // These variables will hold the results of register allocation. @@ -999,7 +1000,7 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { text << "\t texcoord" << i << ".w = 1.0f;\n"; break; default: - pgraph_cat.error() << "Unsupported TexGenAttrib mode\n"; + pgraphnodes_cat.error() << "Unsupported TexGenAttrib mode\n"; text << "\t float4 texcoord" << i << " = float4(0, 0, 0, 0);\n"; } } else { @@ -1572,10 +1573,10 @@ combine_mode_as_string(CPT(TextureStage) stage, TextureStage::CombineMode c_mode text << combine_source_as_string(stage, 1, alpha, alpha, texindex); break; case TextureStage::CM_dot3_rgb: - pgraph_cat.error() << "TextureStage::CombineMode DOT3_RGB not yet supported in per-pixel mode.\n"; + pgraphnodes_cat.error() << "TextureStage::CombineMode DOT3_RGB not yet supported in per-pixel mode.\n"; break; case TextureStage::CM_dot3_rgba: - pgraph_cat.error() << "TextureStage::CombineMode DOT3_RGBA not yet supported in per-pixel mode.\n"; + pgraphnodes_cat.error() << "TextureStage::CombineMode DOT3_RGBA not yet supported in per-pixel mode.\n"; break; case TextureStage::CM_replace: default: // Not sure if this is correct as default value. @@ -1695,7 +1696,7 @@ texture_type_as_string(Texture::TextureType ttype) { return "2DARRAY"; break; default: - pgraph_cat.error() << "Unsupported texture type!\n"; + pgraphnodes_cat.error() << "Unsupported texture type!\n"; return "2D"; } } From 64144955a0b0def5a702156f48b82c9fef74228e Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 29 Jul 2015 10:45:55 +0200 Subject: [PATCH 087/203] Fix for typedefs to external types in interrogate --- .../interrogate/interfaceMakerPythonNative.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index a6daee775b..0210ca72fb 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1235,11 +1235,13 @@ void InterfaceMakerPythonNative:: write_sub_module(ostream &out, Object *obj) { //Object * obj = _objects[_embeded_index] ; string class_name = make_safe_name(obj->_itype.get_scoped_name()); + string class_ptr; out << " // Module init upcall for " << obj->_itype.get_scoped_name() << "\n"; if (!obj->_itype.is_typedef()) { out << " // " << *(obj->_itype._cpptype) << "\n"; out << " Dtool_PyModuleClassInit_" << class_name << "(module);\n"; + class_ptr = "&Dtool_" + class_name; } else { // Unwrap typedefs. @@ -1258,22 +1260,29 @@ write_sub_module(ostream &out, Object *obj) { if (!isExportThisRun(wrapped_itype._cpptype)) { _external_imports.insert(TypeManager::resolve_type(wrapped_itype._cpptype)); + + class_ptr = "Dtool_Ptr_" + class_name; + out << " assert(" << class_ptr << " != NULL);\n"; + } else { + class_ptr = "&Dtool_" + class_name; } } std::string export_class_name = classNameFromCppName(obj->_itype.get_name(), false); std::string export_class_name2 = classNameFromCppName(obj->_itype.get_name(), true); + class_ptr = "(PyObject *)" + class_ptr; + // Note: PyModule_AddObject steals a reference, so we have to call Py_INCREF // for every but the first time we add it to the module. if (obj->_itype.is_typedef()) { - out << " Py_INCREF((PyObject *)&Dtool_" << class_name << ");\n"; + out << " Py_INCREF(" << class_ptr << ");\n"; } - out << " PyModule_AddObject(module, \"" << export_class_name << "\", (PyObject *)&Dtool_" << class_name << ");\n"; + out << " PyModule_AddObject(module, \"" << export_class_name << "\", " << class_ptr << ");\n"; if (export_class_name != export_class_name2) { - out << " Py_INCREF((PyObject *)&Dtool_" << class_name << ");\n"; - out << " PyModule_AddObject(module, \"" << export_class_name2 << "\", (PyObject *)&Dtool_" << class_name << ");\n"; + out << " Py_INCREF(Dtool_Ptr_" << class_name << ");\n"; + out << " PyModule_AddObject(module, \"" << export_class_name2 << "\", " << class_ptr << ");\n"; } } From f22cc719959114d24e7c1e2ed43dbc51746bb966 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 29 Jul 2015 14:07:06 +0200 Subject: [PATCH 088/203] Fix double-precision build blibli --- panda/src/glesgsg/glesgsg.h | 6 +--- .../src/glstuff/glGraphicsStateGuardian_src.I | 19 +++++++++++++ .../glstuff/glGraphicsStateGuardian_src.cxx | 28 ++++++++++++------- .../src/glstuff/glGraphicsStateGuardian_src.h | 1 + panda/src/glstuff/glShaderContext_src.cxx | 2 +- panda/src/pnmtext/pnmTextGlyph.cxx | 17 +++++++---- pandatool/src/assimp/assimpLoader.cxx | 2 +- 7 files changed, 52 insertions(+), 23 deletions(-) diff --git a/panda/src/glesgsg/glesgsg.h b/panda/src/glesgsg/glesgsg.h index 6f13f9223c..50dfaeab19 100644 --- a/panda/src/glesgsg/glesgsg.h +++ b/panda/src/glesgsg/glesgsg.h @@ -23,13 +23,9 @@ #define GLP(name) gl##name -#ifndef STDFLOAT_DOUBLE +// OpenGL ES does not support double-precision. #define GLPf(name) gl ## name ## f #define GLPfv(name) gl ## name ## fv -#else // STDFLOAT_DOUBLE -#define GLPf(name) gl ## name ## d -#define GLPfv(name) gl ## name ## dv -#endif // STDFLOAT_DOUBLE #define CLP(name) GLES##name #define GLPREFIX_QUOTED "gl" diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.I b/panda/src/glstuff/glGraphicsStateGuardian_src.I index 5b5a7a81e9..636a80864c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.I +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.I @@ -644,6 +644,25 @@ clear_color_write_mask() { } } +#ifdef SUPPORT_FIXED_FUNCTION +//////////////////////////////////////////////////////////////////// +// Function: GLGraphicsStateGuardian::call_glLoadMatrix +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE void CLP(GraphicsStateGuardian):: +call_glLoadMatrix(const LMatrix4 &mat) { +#if defined(OPENGLES) && defined(STDFLOAT_DOUBLE) + LMatrix4f matf = LCAST(float, mat); + glLoadMatrixf(matf.get_data()); +#elif defined(STDFLOAT_DOUBLE) + glLoadMatrixd(mat.get_data()); +#else + glLoadMatrixf(mat.get_data()); +#endif +} +#endif + #ifdef SUPPORT_FIXED_FUNCTION //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::call_glFogfv diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 5fc640cce7..e61a53487a 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -112,6 +112,14 @@ null_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, } #endif +#if defined(OPENGLES) && !defined(OPENGLES_1) +static void APIENTRY +null_glVertexAttrib4dv(GLuint index, const GLdouble *v) { + GLfloat vf[4] = {(GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]}; + glVertexAttrib4fv(index, vf); +} +#endif + static void APIENTRY null_glActiveTexture(GLenum gl_texture_stage) { // If we don't support multitexture, we'd better not try to request @@ -1521,7 +1529,7 @@ reset() { _glUniformMatrix4fv = glUniformMatrix4fv; _glValidateProgram = glValidateProgram; _glVertexAttrib4fv = glVertexAttrib4fv; - _glVertexAttrib4dv = NULL; + _glVertexAttrib4dv = null_glVertexAttrib4dv; _glVertexAttribPointer = glVertexAttribPointer; _glVertexAttribIPointer = NULL; _glVertexAttribLPointer = NULL; @@ -3003,7 +3011,7 @@ prepare_lens() { } glMatrixMode(GL_PROJECTION); - GLPf(LoadMatrix)(_projection_mat->get_mat().get_data()); + call_glLoadMatrix(_projection_mat->get_mat()); report_my_gl_errors(); do_point_size(); @@ -4373,7 +4381,7 @@ end_draw_primitives() { #ifdef SUPPORT_FIXED_FUNCTION if (_transform_stale) { glMatrixMode(GL_MODELVIEW); - GLPf(LoadMatrix)(_internal_transform->get_mat().get_data()); + call_glLoadMatrix(_internal_transform->get_mat()); } if (_data_reader->is_vertex_transformed()) { @@ -5854,7 +5862,7 @@ do_issue_transform() { DO_PSTATS_STUFF(_transform_state_pcollector.add_level(1)); glMatrixMode(GL_MODELVIEW); - GLPf(LoadMatrix)(transform->get_mat().get_data()); + call_glLoadMatrix(transform->get_mat()); #endif _transform_stale = false; @@ -9083,7 +9091,7 @@ begin_bind_lights() { glMatrixMode(GL_MODELVIEW); glPushMatrix(); - GLPf(LoadMatrix)(render_transform->get_mat().get_data()); + call_glLoadMatrix(render_transform->get_mat()); } #endif // SUPPORT_FIXED_FUNCTION @@ -9153,7 +9161,7 @@ begin_bind_clip_planes() { glMatrixMode(GL_MODELVIEW); glPushMatrix(); - GLPf(LoadMatrix)(render_transform->get_mat().get_data()); + call_glLoadMatrix(render_transform->get_mat()); } #endif // SUPPORT_FIXED_FUNCTION @@ -10062,7 +10070,7 @@ do_issue_tex_matrix() { _target_rs->get_attrib_def(target_tex_matrix); if (target_tex_matrix->has_stage(stage)) { - GLPf(LoadMatrix)(target_tex_matrix->get_mat(stage).get_data()); + call_glLoadMatrix(target_tex_matrix->get_mat(stage)); } else { glLoadIdentity(); @@ -10072,7 +10080,7 @@ do_issue_tex_matrix() { // an identity matrix does work. But this buggy-driver // workaround might have other performance implications, so I // leave it out. - // GLPf(LoadMatrix)(LMatrix4::ident_mat().get_data()); + // call_glLoadMatrix(LMatrix4::ident_mat()); } } report_my_gl_errors(); @@ -10247,7 +10255,7 @@ do_issue_tex_gen() { // load the coordinate-system transform. glMatrixMode(GL_MODELVIEW); glPushMatrix(); - GLPf(LoadMatrix)(_cs_transform->get_mat().get_data()); + call_glLoadMatrix(_cs_transform->get_mat()); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); @@ -10276,7 +10284,7 @@ do_issue_tex_gen() { glMatrixMode(GL_MODELVIEW); glPushMatrix(); CPT(TransformState) root_transform = _cs_transform->compose(_scene_setup->get_world_transform()); - GLPf(LoadMatrix)(root_transform->get_mat().get_data()); + call_glLoadMatrix(root_transform->get_mat()); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 52845621a6..98668dc760 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -472,6 +472,7 @@ protected: INLINE void clear_color_write_mask(); #ifdef SUPPORT_FIXED_FUNCTION + INLINE void call_glLoadMatrix(const LMatrix4 &mat); INLINE void call_glFogfv(GLenum pname, const LColor &color); INLINE void call_glMaterialfv(GLenum face, GLenum pname, const LColor &color); INLINE void call_glLightfv(GLenum light, GLenum pname, const LVecBase4 &value); diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 49eb12221a..615ad3db4f 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1991,7 +1991,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { } if (p == _color_attrib_index) { // Vertex colors are disabled or not present. Apply flat color. -#if defined(STDFLOAT_DOUBLE) && !defined(OPENGLES) +#ifdef STDFLOAT_DOUBLE _glgsg->_glVertexAttrib4dv(p, color_attrib->get_color().get_data()); #else _glgsg->_glVertexAttrib4fv(p, color_attrib->get_color().get_data()); diff --git a/panda/src/pnmtext/pnmTextGlyph.cxx b/panda/src/pnmtext/pnmTextGlyph.cxx index 91cbcddfc6..8c4c278dc6 100644 --- a/panda/src/pnmtext/pnmTextGlyph.cxx +++ b/panda/src/pnmtext/pnmTextGlyph.cxx @@ -55,6 +55,8 @@ place(PNMImage &dest_image, int xp, int yp, const LColor &fg) { return; } + LColorf fgf = LCAST(float, fg); + int left = xp + _left; int top = yp - _top; int right = left + _image.get_x_size(); @@ -70,11 +72,11 @@ place(PNMImage &dest_image, int xp, int yp, const LColor &fg) { for (int x = cleft; x < cright; x++) { double gval = get_value(x - left, y - top); if (gval == 1.0) { - dest_image.set_xel_a(x, y, fg); + dest_image.set_xel_a(x, y, fgf); } else if (gval > 0.0) { LColorf bg = dest_image.get_xel_a(x, y); - dest_image.set_xel_a(x, y, fg * gval + bg * (1.0 - gval)); + dest_image.set_xel_a(x, y, fgf * gval + bg * (1.0 - gval)); } } } @@ -95,6 +97,9 @@ place(PNMImage &dest_image, int xp, int yp, const LColor &fg, return; } + LColorf fgf = LCAST(float, fg); + LColorf interiorf = LCAST(float, interior); + int left = xp + _left; int top = yp - _top; int right = left + _image.get_x_size(); @@ -110,22 +115,22 @@ place(PNMImage &dest_image, int xp, int yp, const LColor &fg, for (int x = cleft; x < cright; x++) { double gval = get_value(x - left, y - top); if (gval == 1.0) { - dest_image.set_xel_a(x, y, fg); + dest_image.set_xel_a(x, y, fgf); } else if (gval > 0.0) { bool is_interior = get_interior_flag(x - left, y - top); LColorf bg; if (is_interior) { - bg = interior; + bg = interiorf; } else { bg = dest_image.get_xel_a(x, y); } - dest_image.set_xel_a(x, y, fg * gval + bg * (1.0 - gval)); + dest_image.set_xel_a(x, y, fgf * gval + bg * (1.0 - gval)); } else { // gval == 0.0 bool is_interior = get_interior_flag(x - left, y - top); if (is_interior) { - dest_image.set_xel_a(x, y, interior); + dest_image.set_xel_a(x, y, interiorf); } } } diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index 7b87b574cb..a198a29121 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -230,7 +230,7 @@ load_texture_stage(const aiMaterial &mat, const aiTextureType &ttype, CPT(Textur aiString path; aiTextureMapping mapping; unsigned int uvindex; - PN_stdfloat blend; + float blend; aiTextureOp op; aiTextureMapMode mapmode; From 1834d9e879af860c551c9ee69acabc4ceafbbbb4 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 30 Jul 2015 18:50:53 +0200 Subject: [PATCH 089/203] Fix incorrect assumption that Mesa GL 3.0 driver doesn't implement non-core functionality --- .../glstuff/glGraphicsStateGuardian_src.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index e61a53487a..5cd4a547f8 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -522,17 +522,15 @@ reset() { query_glsl_version(); #ifndef OPENGLES - bool core_profile; - if (_gl_version_major < 3 || has_extension("GL_ARB_compatibility")) { - core_profile = false; - } else { - core_profile = true; - } + bool core_profile = is_at_least_gl_version(3, 2) && + !has_extension("GL_ARB_compatibility"); - if (core_profile) { - GLCAT.debug() << "Using core profile\n"; - } else { - GLCAT.debug() << "Using compatibility profile\n"; + if (GLCAT.is_debug()) { + if (core_profile) { + GLCAT.debug() << "Using core profile\n"; + } else { + GLCAT.debug() << "Using compatibility profile\n"; + } } #elif defined(OPENGLES_1) static const bool core_profile = false; From 0ee972a822a1c5e64f5af4808ecb8896d49039d5 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Thu, 30 Jul 2015 21:54:13 +0200 Subject: [PATCH 090/203] pallocator should use panda allocators even when DO_MEMORY_USAGE is not defined - fixes 32-bit Linux crash in runtime builds --- dtool/src/dtoolbase/pallocator.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolbase/pallocator.T b/dtool/src/dtoolbase/pallocator.T index bb09b2633d..f9c6302c4b 100644 --- a/dtool/src/dtoolbase/pallocator.T +++ b/dtool/src/dtoolbase/pallocator.T @@ -56,7 +56,7 @@ allocate(TYPENAME pallocator_array::size_type n, TYPENAME allocator: *((size_t *)ptr) = alloc_size; return (TYPENAME pallocator_array::pointer)(((char *)ptr) + header_reserved_bytes); #else - return (TYPENAME pallocator_array::pointer)malloc(n * sizeof(Type)); + return (TYPENAME pallocator_array::pointer)PANDA_MALLOC_ARRAY(n * sizeof(Type)); #endif // DO_MEMORY_USAGE } @@ -72,6 +72,6 @@ deallocate(TYPENAME pallocator_array::pointer p, TYPENAME pallocator_array _type_handle.dec_memory_usage(TypeHandle::MC_array, (int)alloc_size); PANDA_FREE_ARRAY(ptr); #else - free(p); + PANDA_FREE_ARRAY(p); #endif // DO_MEMORY_USAGE } From 508873a7d399f3f2e019a4b9ac19568f76a7159b Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 31 Jul 2015 13:17:08 +0200 Subject: [PATCH 091/203] improve readability of glgsg spam output --- .../glstuff/glGraphicsStateGuardian_src.cxx | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 5cd4a547f8..a8d9d55c06 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -2770,22 +2770,22 @@ clear(DrawableRegion *clearable) { glClear(mask); if (GLCAT.is_spam()) { - GLCAT.spam() << "glClear("; + string clear_flags; if (mask & GL_COLOR_BUFFER_BIT) { - GLCAT.spam(false) << "GL_COLOR_BUFFER_BIT|"; + clear_flags += " | GL_COLOR_BUFFER_BIT"; } if (mask & GL_DEPTH_BUFFER_BIT) { - GLCAT.spam(false) << "GL_DEPTH_BUFFER_BIT|"; + clear_flags += " | GL_DEPTH_BUFFER_BIT"; } if (mask & GL_STENCIL_BUFFER_BIT) { - GLCAT.spam(false) << "GL_STENCIL_BUFFER_BIT|"; + clear_flags += " | GL_STENCIL_BUFFER_BIT"; } #ifndef OPENGLES if (mask & GL_ACCUM_BUFFER_BIT) { - GLCAT.spam(false) << "GL_ACCUM_BUFFER_BIT|"; + clear_flags += " | GL_ACCUM_BUFFER_BIT"; } #endif - GLCAT.spam(false) << ")" << endl; + GLCAT.spam() << "glClear(" << (clear_flags.c_str() + 3) << ")\n"; } report_my_gl_errors(); @@ -2865,21 +2865,21 @@ prepare_display_region(DisplayRegionPipelineReader *dr) { if (GLCAT.is_spam()) { GLCAT.spam() - << "glViewportArrayv(0, " << count << ", [\n"; + << "glViewportArrayv(0, " << count << ","; for (int i = 0; i < count; ++i) { GLfloat *vr = viewports + i * 4; - GLCAT.spam(false) << vr[0] << ", " << vr[1] << ", " << vr[2] << ", " << vr[3] << ",\n"; + GLCAT.spam(false) << " [" << vr[0] << " " << vr[1] << " " << vr[2] << " " << vr[3] << "]"; } - GLCAT.spam(false) << "])\n"; + GLCAT.spam(false) << ")\n"; if (_scissor_enabled) { GLCAT.spam() - << "glScissorArrayv(0, " << count << ", [\n"; + << "glScissorArrayv(0, " << count << ","; for (int i = 0; i < count; ++i) { const LVecBase4i &sr = _scissor_array[i]; - GLCAT.spam(false) << sr << ",\n"; + GLCAT.spam(false) << " [" << sr << "]"; } + GLCAT.spam(false) << ")\n"; } - GLCAT.spam(false) << "])\n"; } } else @@ -3296,6 +3296,11 @@ end_frame(Thread *current_thread) { } } #endif + + // Add in a newline to the spam output for improved legibility. + if (GLCAT.is_spam()) { + GLCAT.spam(false) << endl; + } } //////////////////////////////////////////////////////////////////// From 53696052b94244b60756b8afabd1a31e7744a41f Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 31 Jul 2015 13:18:01 +0200 Subject: [PATCH 092/203] Fix regression in 1.10 with point/line thickness --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index a8d9d55c06..521bf044b7 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -5990,9 +5990,13 @@ do_issue_render_mode() { // The thickness affects both the line width and the point size. if (thickness != _point_size) { - glLineWidth(_point_size); + if (GLCAT.is_spam()) { + GLCAT.spam() << "setting thickness to " << thickness << "\n"; + } + + glLineWidth(thickness); #ifndef OPENGLES_2 - glPointSize(_point_size); + glPointSize(thickness); #endif _point_size = thickness; } From 62cefcab8ba551c1ea96912a74711407ecb7327a Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 31 Jul 2015 13:20:38 +0200 Subject: [PATCH 093/203] Update glext to make more recent GL functionality available --- panda/src/glgsg/glgsg.h | 1 + .../glstuff/glGraphicsStateGuardian_src.cxx | 51 +- .../src/glstuff/glGraphicsStateGuardian_src.h | 17 +- panda/src/glstuff/panda_glext.h | 20422 ++++++++-------- 4 files changed, 10244 insertions(+), 10247 deletions(-) diff --git a/panda/src/glgsg/glgsg.h b/panda/src/glgsg/glgsg.h index 6c8544b08e..b0cb22eb1a 100644 --- a/panda/src/glgsg/glgsg.h +++ b/panda/src/glgsg/glgsg.h @@ -84,6 +84,7 @@ #include #endif +#undef __glext_h_ #undef GL_GLEXT_VERSION #include "panda_glext.h" diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 521bf044b7..0a40264eb0 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -546,19 +546,19 @@ reset() { _use_object_labels = false; #ifndef OPENGLES_1 if (gl_debug) { - PFNGLDEBUGMESSAGECALLBACKPROC _glDebugMessageCallback; + PFNGLDEBUGMESSAGECALLBACKPROC_P _glDebugMessageCallback; PFNGLDEBUGMESSAGECONTROLPROC _glDebugMessageControl; if (is_at_least_gl_version(4, 3) || has_extension("GL_KHR_debug")) { #ifdef OPENGLES - _glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC) + _glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC_P) get_extension_func("glDebugMessageCallbackKHR"); _glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC) get_extension_func("glDebugMessageControlKHR"); _glObjectLabel = (PFNGLOBJECTLABELPROC) get_extension_func("glObjectLabelKHR"); #else - _glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC) + _glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC_P) get_extension_func("glDebugMessageCallback"); _glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC) get_extension_func("glDebugMessageControl"); @@ -571,7 +571,7 @@ reset() { #ifndef OPENGLES } else if (has_extension("GL_ARB_debug_output")) { - _glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC) + _glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC_P) get_extension_func("glDebugMessageCallbackARB"); _glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC) get_extension_func("glDebugMessageControlARB"); @@ -591,7 +591,7 @@ reset() { 0, NULL, GLCAT.is_debug()); // Enable the callback. - _glDebugMessageCallback((GLDEBUGPROC) &debug_callback, (void*)this); + _glDebugMessageCallback((GLDEBUGPROC_P) &debug_callback, (void*)this); if (gl_debug_synchronous) { glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); } @@ -1214,6 +1214,13 @@ reset() { get_extension_func("glBufferSubData"); _glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) get_extension_func("glDeleteBuffers"); + +#ifndef OPENGLES + _glMapBuffer = (PFNGLMAPBUFFERPROC) + get_extension_func("glMapBuffer"); + _glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) + get_extension_func("glUnmapBuffer"); +#endif } #ifndef OPENGLES_1 else if (has_extension("GL_ARB_vertex_buffer_object")) { @@ -1229,6 +1236,10 @@ reset() { get_extension_func("glBufferSubDataARB"); _glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) get_extension_func("glDeleteBuffersARB"); + _glMapBuffer = (PFNGLMAPBUFFERPROC) + get_extension_func("glMapBufferARB"); + _glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) + get_extension_func("glUnmapBufferARB"); } #endif // OPENGLES_1 @@ -1243,6 +1254,31 @@ reset() { } #endif +#ifndef OPENGLES + // Check for various advanced buffer management features. + if (is_at_least_gl_version(3, 0) || has_extension("GL_ARB_map_buffer_range")) { + _glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) + get_extension_func("glMapBufferRange"); + } else { + _glMapBufferRange = NULL; + } + + if (is_at_least_gl_version(4, 4) || has_extension("GL_ARB_buffer_storage")) { + _glBufferStorage = (PFNGLBUFFERSTORAGEPROC) + get_extension_func("glBufferStorage"); + + if (_glBufferStorage != NULL) { + _supports_buffer_storage = true; + } else { + GLCAT.warning() + << "Buffer storage advertised as supported by OpenGL runtime, but " + "could not get pointers to extension function.\n"; + } + } else { + _supports_buffer_storage = false; + } +#endif + _supports_vao = false; if (is_at_least_gl_version(3, 0) || has_extension("GL_ARB_vertex_array_object")) { @@ -1557,11 +1593,12 @@ reset() { get_extension_func("glGetActiveUniformBlockiv"); _glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) get_extension_func("glGetActiveUniformBlockName"); + + _glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) + get_extension_func("glBindBufferBase"); } else { _supports_uniform_buffers = false; } -#else - _supports_uniform_buffers = false; #endif // Check whether we support geometry instancing and instanced vertex attribs. diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 98668dc760..d83b585941 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -58,8 +58,8 @@ typedef double GLdouble; // declare these typedefs. #if !defined( __EDG__ ) || defined( __INTEL_COMPILER ) // Protect the following from the Tau instrumentor and expose it for the intel compiler. typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef void (APIENTRY *GLDEBUGPROC_P)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC_P) (GLDEBUGPROC_P callback, const void *userParam); typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); @@ -640,7 +640,6 @@ protected: GLint _max_image_units; bool _supports_multi_bind; bool _supports_get_program_binary; - bool _supports_uniform_buffers; #ifdef OPENGLES bool _supports_depth24; @@ -734,6 +733,18 @@ public: PFNGLBUFFERSUBDATAPROC _glBufferSubData; PFNGLDELETEBUFFERSPROC _glDeleteBuffers; +#ifndef OPENGLES + PFNGLMAPBUFFERPROC _glMapBuffer; + PFNGLUNMAPBUFFERPROC _glUnmapBuffer; + PFNGLMAPBUFFERRANGEPROC _glMapBufferRange; + + bool _supports_uniform_buffers; + PFNGLBINDBUFFERBASEPROC _glBindBufferBase; + + bool _supports_buffer_storage; + PFNGLBUFFERSTORAGEPROC _glBufferStorage; +#endif + PFNGLBLENDEQUATIONPROC _glBlendEquation; PFNGLBLENDCOLORPROC _glBlendColor; diff --git a/panda/src/glstuff/panda_glext.h b/panda/src/glstuff/panda_glext.h index 1fb1c55a0e..61b983ed7a 100644 --- a/panda/src/glstuff/panda_glext.h +++ b/panda/src/glstuff/panda_glext.h @@ -1,11 +1,12 @@ -#ifndef GL_GLEXT_VERSION +#ifndef __glext_h_ +#define __glext_h_ 1 #ifdef __cplusplus extern "C" { #endif /* -** Copyright (c) 2007-2012 The Khronos Group Inc. +** Copyright (c) 2013-2015 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -26,15 +27,19 @@ extern "C" { ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ - -/* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated $Date$ */ -/* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 81 -/* Function declaration macros - to move into glplatform.h */ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 31717 $ on $Date: 2015-07-20 05:42:11 -0400 (Mon, 20 Jul 2015) $ +*/ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 +#endif #include #endif @@ -48,9 +53,20 @@ extern "C" { #define GLAPI extern #endif -/*************************************************************/ +#define GL_GLEXT_VERSION 20150720 + +/* Generated C header for: + * API: gl + * Profile: compatibility + * Versions considered: .* + * Versions emitted: 1\.[2-9]|[234]\.[0-9] + * Default extensions included: gl + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ #ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 @@ -87,98 +103,25 @@ extern "C" { #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#endif - -#ifndef GL_VERSION_1_2_DEPRECATED #define GL_RESCALE_NORMAL 0x803A #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #define GL_SINGLE_COLOR 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA #define GL_ALIASED_POINT_SIZE_RANGE 0x846D +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif - -#ifndef GL_ARB_imaging -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#endif - -#ifndef GL_ARB_imaging_DEPRECATED -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#endif +#endif /* GL_VERSION_1_2 */ #ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_TEXTURE2 0x84C2 @@ -238,9 +181,6 @@ extern "C" { #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_CLAMP_TO_BORDER 0x812D -#endif - -#ifndef GL_VERSION_1_3_DEPRECATED #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 #define GL_MAX_TEXTURE_UNITS 0x84E2 #define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 @@ -278,9 +218,104 @@ extern "C" { #define GL_PREVIOUS 0x8578 #define GL_DOT3_RGB 0x86AE #define GL_DOT3_RGBA 0x86AF +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum texture); +GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img); +GLAPI void APIENTRY glClientActiveTexture (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); #endif +#endif /* GL_VERSION_1_3 */ #ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 #define GL_BLEND_DST_RGB 0x80C8 #define GL_BLEND_SRC_RGB 0x80C9 #define GL_BLEND_DST_ALPHA 0x80CA @@ -297,9 +332,6 @@ extern "C" { #define GL_TEXTURE_DEPTH_SIZE 0x884A #define GL_TEXTURE_COMPARE_MODE 0x884C #define GL_TEXTURE_COMPARE_FUNC 0x884D -#endif - -#ifndef GL_VERSION_1_4_DEPRECATED #define GL_POINT_SIZE_MIN 0x8126 #define GL_POINT_SIZE_MAX 0x8127 #define GL_POINT_DISTANCE_ATTENUATION 0x8129 @@ -323,9 +355,118 @@ extern "C" { #define GL_TEXTURE_FILTER_CONTROL 0x8500 #define GL_DEPTH_TEXTURE_MODE 0x884B #define GL_COMPARE_R_TO_TEXTURE 0x884E +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFogCoordf (GLfloat coord); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); +GLAPI void APIENTRY glFogCoordd (GLdouble coord); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2iv (const GLint *v); +GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); +GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3iv (const GLint *v); +GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); +GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); #endif +#endif /* GL_VERSION_1_4 */ #ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#include +typedef ptrdiff_t GLsizeiptr; +typedef ptrdiff_t GLintptr; #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 #define GL_QUERY_COUNTER_BITS 0x8864 @@ -353,9 +494,7 @@ extern "C" { #define GL_DYNAMIC_READ 0x88E9 #define GL_DYNAMIC_COPY 0x88EA #define GL_SAMPLES_PASSED 0x8914 -#endif - -#ifndef GL_VERSION_1_5_DEPRECATED +#define GL_SRC1_ALPHA 0x8589 #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 @@ -377,11 +516,52 @@ extern "C" { #define GL_SRC1_RGB 0x8581 #define GL_SRC2_RGB 0x8582 #define GL_SRC0_ALPHA 0x8588 -#define GL_SRC1_ALPHA 0x8589 #define GL_SRC2_ALPHA 0x858A +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQuery (GLuint id); +GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQuery (GLenum target); +GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); #endif +#endif /* GL_VERSION_1_5 */ #ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +typedef char GLchar; #define GL_BLEND_EQUATION_RGB 0x8009 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 @@ -462,16 +642,202 @@ extern "C" { #define GL_STENCIL_BACK_REF 0x8CA3 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#endif - -#ifndef GL_VERSION_2_0_DEPRECATED #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 #define GL_POINT_SPRITE 0x8861 #define GL_COORD_REPLACE 0x8862 #define GL_MAX_TEXTURE_COORDS 0x8871 +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GLAPI void APIENTRY glCompileShader (GLuint shader); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum type); +GLAPI void APIENTRY glDeleteProgram (GLuint program); +GLAPI void APIENTRY glDeleteShader (GLuint shader); +GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); +GLAPI GLboolean APIENTRY glIsProgram (GLuint program); +GLAPI GLboolean APIENTRY glIsShader (GLuint shader); +GLAPI void APIENTRY glLinkProgram (GLuint program); +GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GLAPI void APIENTRY glUseProgram (GLuint program); +GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glValidateProgram (GLuint program); +GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); #endif +#endif /* GL_VERSION_2_0 */ #ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 #define GL_PIXEL_PACK_BUFFER 0x88EB #define GL_PIXEL_UNPACK_BUFFER 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED @@ -488,9 +854,6 @@ extern "C" { #define GL_SRGB8_ALPHA8 0x8C43 #define GL_COMPRESSED_SRGB 0x8C48 #define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#endif - -#ifndef GL_VERSION_2_1_DEPRECATED #define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F #define GL_SLUMINANCE_ALPHA 0x8C44 #define GL_SLUMINANCE8_ALPHA8 0x8C45 @@ -498,9 +861,25 @@ extern "C" { #define GL_SLUMINANCE8 0x8C47 #define GL_COMPRESSED_SLUMINANCE 0x8C4A #define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #endif +#endif /* GL_VERSION_2_1 */ #ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +typedef unsigned short GLhalf; #define GL_COMPARE_REF_TO_TEXTURE 0x884E #define GL_CLIP_DISTANCE0 0x3000 #define GL_CLIP_DISTANCE1 0x3001 @@ -517,7 +896,7 @@ extern "C" { #define GL_CONTEXT_FLAGS 0x821E #define GL_COMPRESSED_RED 0x8225 #define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 #define GL_RGBA32F 0x8814 #define GL_RGB32F 0x8815 #define GL_RGBA16F 0x881A @@ -601,1078 +980,9 @@ extern "C" { #define GL_BUFFER_ACCESS_FLAGS 0x911F #define GL_BUFFER_MAP_LENGTH 0x9120 #define GL_BUFFER_MAP_OFFSET 0x9121 -/* Reuse tokens from ARB_depth_buffer_float */ -/* reuse GL_DEPTH_COMPONENT32F */ -/* reuse GL_DEPTH32F_STENCIL8 */ -/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ -/* Reuse tokens from ARB_framebuffer_object */ -/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ -/* reuse GL_FRAMEBUFFER_DEFAULT */ -/* reuse GL_FRAMEBUFFER_UNDEFINED */ -/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ -/* reuse GL_INDEX */ -/* reuse GL_MAX_RENDERBUFFER_SIZE */ -/* reuse GL_DEPTH_STENCIL */ -/* reuse GL_UNSIGNED_INT_24_8 */ -/* reuse GL_DEPTH24_STENCIL8 */ -/* reuse GL_TEXTURE_STENCIL_SIZE */ -/* reuse GL_TEXTURE_RED_TYPE */ -/* reuse GL_TEXTURE_GREEN_TYPE */ -/* reuse GL_TEXTURE_BLUE_TYPE */ -/* reuse GL_TEXTURE_ALPHA_TYPE */ -/* reuse GL_TEXTURE_DEPTH_TYPE */ -/* reuse GL_UNSIGNED_NORMALIZED */ -/* reuse GL_FRAMEBUFFER_BINDING */ -/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ -/* reuse GL_RENDERBUFFER_BINDING */ -/* reuse GL_READ_FRAMEBUFFER */ -/* reuse GL_DRAW_FRAMEBUFFER */ -/* reuse GL_READ_FRAMEBUFFER_BINDING */ -/* reuse GL_RENDERBUFFER_SAMPLES */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ -/* reuse GL_FRAMEBUFFER_COMPLETE */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ -/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ -/* reuse GL_MAX_COLOR_ATTACHMENTS */ -/* reuse GL_COLOR_ATTACHMENT0 */ -/* reuse GL_COLOR_ATTACHMENT1 */ -/* reuse GL_COLOR_ATTACHMENT2 */ -/* reuse GL_COLOR_ATTACHMENT3 */ -/* reuse GL_COLOR_ATTACHMENT4 */ -/* reuse GL_COLOR_ATTACHMENT5 */ -/* reuse GL_COLOR_ATTACHMENT6 */ -/* reuse GL_COLOR_ATTACHMENT7 */ -/* reuse GL_COLOR_ATTACHMENT8 */ -/* reuse GL_COLOR_ATTACHMENT9 */ -/* reuse GL_COLOR_ATTACHMENT10 */ -/* reuse GL_COLOR_ATTACHMENT11 */ -/* reuse GL_COLOR_ATTACHMENT12 */ -/* reuse GL_COLOR_ATTACHMENT13 */ -/* reuse GL_COLOR_ATTACHMENT14 */ -/* reuse GL_COLOR_ATTACHMENT15 */ -/* reuse GL_DEPTH_ATTACHMENT */ -/* reuse GL_STENCIL_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER */ -/* reuse GL_RENDERBUFFER */ -/* reuse GL_RENDERBUFFER_WIDTH */ -/* reuse GL_RENDERBUFFER_HEIGHT */ -/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ -/* reuse GL_STENCIL_INDEX1 */ -/* reuse GL_STENCIL_INDEX4 */ -/* reuse GL_STENCIL_INDEX8 */ -/* reuse GL_STENCIL_INDEX16 */ -/* reuse GL_RENDERBUFFER_RED_SIZE */ -/* reuse GL_RENDERBUFFER_GREEN_SIZE */ -/* reuse GL_RENDERBUFFER_BLUE_SIZE */ -/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ -/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ -/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ -/* reuse GL_MAX_SAMPLES */ -/* Reuse tokens from ARB_framebuffer_sRGB */ -/* reuse GL_FRAMEBUFFER_SRGB */ -/* Reuse tokens from ARB_half_float_vertex */ -/* reuse GL_HALF_FLOAT */ -/* Reuse tokens from ARB_map_buffer_range */ -/* reuse GL_MAP_READ_BIT */ -/* reuse GL_MAP_WRITE_BIT */ -/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ -/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ -/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ -/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ -/* Reuse tokens from ARB_texture_compression_rgtc */ -/* reuse GL_COMPRESSED_RED_RGTC1 */ -/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ -/* reuse GL_COMPRESSED_RG_RGTC2 */ -/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ -/* Reuse tokens from ARB_texture_rg */ -/* reuse GL_RG */ -/* reuse GL_RG_INTEGER */ -/* reuse GL_R8 */ -/* reuse GL_R16 */ -/* reuse GL_RG8 */ -/* reuse GL_RG16 */ -/* reuse GL_R16F */ -/* reuse GL_R32F */ -/* reuse GL_RG16F */ -/* reuse GL_RG32F */ -/* reuse GL_R8I */ -/* reuse GL_R8UI */ -/* reuse GL_R16I */ -/* reuse GL_R16UI */ -/* reuse GL_R32I */ -/* reuse GL_R32UI */ -/* reuse GL_RG8I */ -/* reuse GL_RG8UI */ -/* reuse GL_RG16I */ -/* reuse GL_RG16UI */ -/* reuse GL_RG32I */ -/* reuse GL_RG32UI */ -/* Reuse tokens from ARB_vertex_array_object */ -/* reuse GL_VERTEX_ARRAY_BINDING */ -#endif - -#ifndef GL_VERSION_3_0_DEPRECATED -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_ALPHA_INTEGER 0x8D97 -/* Reuse tokens from ARB_framebuffer_object */ -/* reuse GL_TEXTURE_LUMINANCE_TYPE */ -/* reuse GL_TEXTURE_INTENSITY_TYPE */ -#endif - -#ifndef GL_VERSION_3_1 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -/* Reuse tokens from ARB_copy_buffer */ -/* reuse GL_COPY_READ_BUFFER */ -/* reuse GL_COPY_WRITE_BUFFER */ -/* Reuse tokens from ARB_draw_instanced (none) */ -/* Reuse tokens from ARB_uniform_buffer_object */ -/* reuse GL_UNIFORM_BUFFER */ -/* reuse GL_UNIFORM_BUFFER_BINDING */ -/* reuse GL_UNIFORM_BUFFER_START */ -/* reuse GL_UNIFORM_BUFFER_SIZE */ -/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */ -/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */ -/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */ -/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */ -/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */ -/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */ -/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */ -/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */ -/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */ -/* reuse GL_ACTIVE_UNIFORM_BLOCKS */ -/* reuse GL_UNIFORM_TYPE */ -/* reuse GL_UNIFORM_SIZE */ -/* reuse GL_UNIFORM_NAME_LENGTH */ -/* reuse GL_UNIFORM_BLOCK_INDEX */ -/* reuse GL_UNIFORM_OFFSET */ -/* reuse GL_UNIFORM_ARRAY_STRIDE */ -/* reuse GL_UNIFORM_MATRIX_STRIDE */ -/* reuse GL_UNIFORM_IS_ROW_MAJOR */ -/* reuse GL_UNIFORM_BLOCK_BINDING */ -/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */ -/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */ -/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */ -/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */ -/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */ -/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */ -/* reuse GL_INVALID_INDEX */ -#endif - -#ifndef GL_VERSION_3_2 -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -/* reuse GL_MAX_VARYING_COMPONENTS */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ -/* Reuse tokens from ARB_depth_clamp */ -/* reuse GL_DEPTH_CLAMP */ -/* Reuse tokens from ARB_draw_elements_base_vertex (none) */ -/* Reuse tokens from ARB_fragment_coord_conventions (none) */ -/* Reuse tokens from ARB_provoking_vertex */ -/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ -/* reuse GL_FIRST_VERTEX_CONVENTION */ -/* reuse GL_LAST_VERTEX_CONVENTION */ -/* reuse GL_PROVOKING_VERTEX */ -/* Reuse tokens from ARB_seamless_cube_map */ -/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ -/* Reuse tokens from ARB_sync */ -/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */ -/* reuse GL_OBJECT_TYPE */ -/* reuse GL_SYNC_CONDITION */ -/* reuse GL_SYNC_STATUS */ -/* reuse GL_SYNC_FLAGS */ -/* reuse GL_SYNC_FENCE */ -/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */ -/* reuse GL_UNSIGNALED */ -/* reuse GL_SIGNALED */ -/* reuse GL_ALREADY_SIGNALED */ -/* reuse GL_TIMEOUT_EXPIRED */ -/* reuse GL_CONDITION_SATISFIED */ -/* reuse GL_WAIT_FAILED */ -/* reuse GL_TIMEOUT_IGNORED */ -/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */ -/* reuse GL_TIMEOUT_IGNORED */ -/* Reuse tokens from ARB_texture_multisample */ -/* reuse GL_SAMPLE_POSITION */ -/* reuse GL_SAMPLE_MASK */ -/* reuse GL_SAMPLE_MASK_VALUE */ -/* reuse GL_MAX_SAMPLE_MASK_WORDS */ -/* reuse GL_TEXTURE_2D_MULTISAMPLE */ -/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */ -/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */ -/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_TEXTURE_SAMPLES */ -/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */ -/* reuse GL_SAMPLER_2D_MULTISAMPLE */ -/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */ -/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */ -/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */ -/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */ -/* reuse GL_MAX_INTEGER_SAMPLES */ -/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */ -#endif - -#ifndef GL_VERSION_3_3 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -/* Reuse tokens from ARB_blend_func_extended */ -/* reuse GL_SRC1_COLOR */ -/* reuse GL_ONE_MINUS_SRC1_COLOR */ -/* reuse GL_ONE_MINUS_SRC1_ALPHA */ -/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */ -/* Reuse tokens from ARB_explicit_attrib_location (none) */ -/* Reuse tokens from ARB_occlusion_query2 */ -/* reuse GL_ANY_SAMPLES_PASSED */ -/* Reuse tokens from ARB_sampler_objects */ -/* reuse GL_SAMPLER_BINDING */ -/* Reuse tokens from ARB_shader_bit_encoding (none) */ -/* Reuse tokens from ARB_texture_rgb10_a2ui */ -/* reuse GL_RGB10_A2UI */ -/* Reuse tokens from ARB_texture_swizzle */ -/* reuse GL_TEXTURE_SWIZZLE_R */ -/* reuse GL_TEXTURE_SWIZZLE_G */ -/* reuse GL_TEXTURE_SWIZZLE_B */ -/* reuse GL_TEXTURE_SWIZZLE_A */ -/* reuse GL_TEXTURE_SWIZZLE_RGBA */ -/* Reuse tokens from ARB_timer_query */ -/* reuse GL_TIME_ELAPSED */ -/* reuse GL_TIMESTAMP */ -/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */ -/* reuse GL_INT_2_10_10_10_REV */ -#endif - -#ifndef GL_VERSION_4_0 -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F -/* Reuse tokens from ARB_texture_query_lod (none) */ -/* Reuse tokens from ARB_draw_buffers_blend (none) */ -/* Reuse tokens from ARB_draw_indirect */ -/* reuse GL_DRAW_INDIRECT_BUFFER */ -/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */ -/* Reuse tokens from ARB_gpu_shader5 */ -/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */ -/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */ -/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */ -/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */ -/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */ -/* reuse GL_MAX_VERTEX_STREAMS */ -/* Reuse tokens from ARB_gpu_shader_fp64 */ -/* reuse GL_DOUBLE_VEC2 */ -/* reuse GL_DOUBLE_VEC3 */ -/* reuse GL_DOUBLE_VEC4 */ -/* reuse GL_DOUBLE_MAT2 */ -/* reuse GL_DOUBLE_MAT3 */ -/* reuse GL_DOUBLE_MAT4 */ -/* reuse GL_DOUBLE_MAT2x3 */ -/* reuse GL_DOUBLE_MAT2x4 */ -/* reuse GL_DOUBLE_MAT3x2 */ -/* reuse GL_DOUBLE_MAT3x4 */ -/* reuse GL_DOUBLE_MAT4x2 */ -/* reuse GL_DOUBLE_MAT4x3 */ -/* Reuse tokens from ARB_shader_subroutine */ -/* reuse GL_ACTIVE_SUBROUTINES */ -/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */ -/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */ -/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */ -/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */ -/* reuse GL_MAX_SUBROUTINES */ -/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */ -/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */ -/* reuse GL_COMPATIBLE_SUBROUTINES */ -/* Reuse tokens from ARB_tessellation_shader */ -/* reuse GL_PATCHES */ -/* reuse GL_PATCH_VERTICES */ -/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */ -/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */ -/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */ -/* reuse GL_TESS_GEN_MODE */ -/* reuse GL_TESS_GEN_SPACING */ -/* reuse GL_TESS_GEN_VERTEX_ORDER */ -/* reuse GL_TESS_GEN_POINT_MODE */ -/* reuse GL_ISOLINES */ -/* reuse GL_FRACTIONAL_ODD */ -/* reuse GL_FRACTIONAL_EVEN */ -/* reuse GL_MAX_PATCH_VERTICES */ -/* reuse GL_MAX_TESS_GEN_LEVEL */ -/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */ -/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */ -/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */ -/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */ -/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */ -/* reuse GL_MAX_TESS_PATCH_COMPONENTS */ -/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */ -/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */ -/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */ -/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */ -/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */ -/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */ -/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */ -/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */ -/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */ -/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */ -/* reuse GL_TESS_EVALUATION_SHADER */ -/* reuse GL_TESS_CONTROL_SHADER */ -/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */ -/* Reuse tokens from ARB_transform_feedback2 */ -/* reuse GL_TRANSFORM_FEEDBACK */ -/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */ -/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */ -/* reuse GL_TRANSFORM_FEEDBACK_BINDING */ -/* Reuse tokens from ARB_transform_feedback3 */ -/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */ -/* reuse GL_MAX_VERTEX_STREAMS */ -#endif - -#ifndef GL_VERSION_4_1 -/* Reuse tokens from ARB_ES2_compatibility */ -/* reuse GL_FIXED */ -/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */ -/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */ -/* reuse GL_LOW_FLOAT */ -/* reuse GL_MEDIUM_FLOAT */ -/* reuse GL_HIGH_FLOAT */ -/* reuse GL_LOW_INT */ -/* reuse GL_MEDIUM_INT */ -/* reuse GL_HIGH_INT */ -/* reuse GL_SHADER_COMPILER */ -/* reuse GL_NUM_SHADER_BINARY_FORMATS */ -/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */ -/* reuse GL_MAX_VARYING_VECTORS */ -/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */ -/* reuse GL_RGB565 */ -/* Reuse tokens from ARB_get_program_binary */ -/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */ -/* reuse GL_PROGRAM_BINARY_LENGTH */ -/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */ -/* reuse GL_PROGRAM_BINARY_FORMATS */ -/* Reuse tokens from ARB_separate_shader_objects */ -/* reuse GL_VERTEX_SHADER_BIT */ -/* reuse GL_FRAGMENT_SHADER_BIT */ -/* reuse GL_GEOMETRY_SHADER_BIT */ -/* reuse GL_TESS_CONTROL_SHADER_BIT */ -/* reuse GL_TESS_EVALUATION_SHADER_BIT */ -/* reuse GL_ALL_SHADER_BITS */ -/* reuse GL_PROGRAM_SEPARABLE */ -/* reuse GL_ACTIVE_PROGRAM */ -/* reuse GL_PROGRAM_PIPELINE_BINDING */ -/* Reuse tokens from ARB_shader_precision (none) */ -/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */ -/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */ -/* reuse GL_MAX_VIEWPORTS */ -/* reuse GL_VIEWPORT_SUBPIXEL_BITS */ -/* reuse GL_VIEWPORT_BOUNDS_RANGE */ -/* reuse GL_LAYER_PROVOKING_VERTEX */ -/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */ -/* reuse GL_UNDEFINED_VERTEX */ -#endif - -#ifndef GL_VERSION_4_2 -/* Reuse tokens from ARB_base_instance (none) */ -/* Reuse tokens from ARB_shading_language_420pack (none) */ -/* Reuse tokens from ARB_transform_feedback_instanced (none) */ -/* Reuse tokens from ARB_compressed_texture_pixel_storage */ -/* reuse GL_UNPACK_COMPRESSED_BLOCK_WIDTH */ -/* reuse GL_UNPACK_COMPRESSED_BLOCK_HEIGHT */ -/* reuse GL_UNPACK_COMPRESSED_BLOCK_DEPTH */ -/* reuse GL_UNPACK_COMPRESSED_BLOCK_SIZE */ -/* reuse GL_PACK_COMPRESSED_BLOCK_WIDTH */ -/* reuse GL_PACK_COMPRESSED_BLOCK_HEIGHT */ -/* reuse GL_PACK_COMPRESSED_BLOCK_DEPTH */ -/* reuse GL_PACK_COMPRESSED_BLOCK_SIZE */ -/* Reuse tokens from ARB_conservative_depth (none) */ -/* Reuse tokens from ARB_internalformat_query */ -/* reuse GL_NUM_SAMPLE_COUNTS */ -/* Reuse tokens from ARB_map_buffer_alignment */ -/* reuse GL_MIN_MAP_BUFFER_ALIGNMENT */ -/* Reuse tokens from ARB_shader_atomic_counters */ -/* reuse GL_ATOMIC_COUNTER_BUFFER */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_BINDING */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_START */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_SIZE */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER */ -/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER */ -/* reuse GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS */ -/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS */ -/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS */ -/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS */ -/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS */ -/* reuse GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS */ -/* reuse GL_MAX_VERTEX_ATOMIC_COUNTERS */ -/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS */ -/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS */ -/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTERS */ -/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTERS */ -/* reuse GL_MAX_COMBINED_ATOMIC_COUNTERS */ -/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE */ -/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS */ -/* reuse GL_ACTIVE_ATOMIC_COUNTER_BUFFERS */ -/* reuse GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX */ -/* reuse GL_UNSIGNED_INT_ATOMIC_COUNTER */ -/* Reuse tokens from ARB_shader_image_load_store */ -/* reuse GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT */ -/* reuse GL_ELEMENT_ARRAY_BARRIER_BIT */ -/* reuse GL_UNIFORM_BARRIER_BIT */ -/* reuse GL_TEXTURE_FETCH_BARRIER_BIT */ -/* reuse GL_SHADER_IMAGE_ACCESS_BARRIER_BIT */ -/* reuse GL_COMMAND_BARRIER_BIT */ -/* reuse GL_PIXEL_BUFFER_BARRIER_BIT */ -/* reuse GL_TEXTURE_UPDATE_BARRIER_BIT */ -/* reuse GL_BUFFER_UPDATE_BARRIER_BIT */ -/* reuse GL_FRAMEBUFFER_BARRIER_BIT */ -/* reuse GL_TRANSFORM_FEEDBACK_BARRIER_BIT */ -/* reuse GL_ATOMIC_COUNTER_BARRIER_BIT */ -/* reuse GL_ALL_BARRIER_BITS */ -/* reuse GL_MAX_IMAGE_UNITS */ -/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */ -/* reuse GL_IMAGE_BINDING_NAME */ -/* reuse GL_IMAGE_BINDING_LEVEL */ -/* reuse GL_IMAGE_BINDING_LAYERED */ -/* reuse GL_IMAGE_BINDING_LAYER */ -/* reuse GL_IMAGE_BINDING_ACCESS */ -/* reuse GL_IMAGE_1D */ -/* reuse GL_IMAGE_2D */ -/* reuse GL_IMAGE_3D */ -/* reuse GL_IMAGE_2D_RECT */ -/* reuse GL_IMAGE_CUBE */ -/* reuse GL_IMAGE_BUFFER */ -/* reuse GL_IMAGE_1D_ARRAY */ -/* reuse GL_IMAGE_2D_ARRAY */ -/* reuse GL_IMAGE_CUBE_MAP_ARRAY */ -/* reuse GL_IMAGE_2D_MULTISAMPLE */ -/* reuse GL_IMAGE_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_INT_IMAGE_1D */ -/* reuse GL_INT_IMAGE_2D */ -/* reuse GL_INT_IMAGE_3D */ -/* reuse GL_INT_IMAGE_2D_RECT */ -/* reuse GL_INT_IMAGE_CUBE */ -/* reuse GL_INT_IMAGE_BUFFER */ -/* reuse GL_INT_IMAGE_1D_ARRAY */ -/* reuse GL_INT_IMAGE_2D_ARRAY */ -/* reuse GL_INT_IMAGE_CUBE_MAP_ARRAY */ -/* reuse GL_INT_IMAGE_2D_MULTISAMPLE */ -/* reuse GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_UNSIGNED_INT_IMAGE_1D */ -/* reuse GL_UNSIGNED_INT_IMAGE_2D */ -/* reuse GL_UNSIGNED_INT_IMAGE_3D */ -/* reuse GL_UNSIGNED_INT_IMAGE_2D_RECT */ -/* reuse GL_UNSIGNED_INT_IMAGE_CUBE */ -/* reuse GL_UNSIGNED_INT_IMAGE_BUFFER */ -/* reuse GL_UNSIGNED_INT_IMAGE_1D_ARRAY */ -/* reuse GL_UNSIGNED_INT_IMAGE_2D_ARRAY */ -/* reuse GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY */ -/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE */ -/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY */ -/* reuse GL_MAX_IMAGE_SAMPLES */ -/* reuse GL_IMAGE_BINDING_FORMAT */ -/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */ -/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE */ -/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS */ -/* reuse GL_MAX_VERTEX_IMAGE_UNIFORMS */ -/* reuse GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS */ -/* reuse GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS */ -/* reuse GL_MAX_GEOMETRY_IMAGE_UNIFORMS */ -/* reuse GL_MAX_FRAGMENT_IMAGE_UNIFORMS */ -/* reuse GL_MAX_COMBINED_IMAGE_UNIFORMS */ -/* Reuse tokens from ARB_shading_language_packing (none) */ -/* Reuse tokens from ARB_texture_storage */ -/* reuse GL_TEXTURE_IMMUTABLE_FORMAT */ -#endif - -#ifndef GL_VERSION_4_3 -#define GL_VERSION_4_3 1 -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#endif - -#ifndef GL_ARB_multitexture -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_env_add -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_ARB_point_parameters -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - -#ifndef GL_ARB_shadow -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif - -#ifndef GL_ARB_window_pos -#endif - -#ifndef GL_ARB_vertex_program -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#endif - -#ifndef GL_ARB_fragment_program -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#endif - -#ifndef GL_ARB_shader_objects -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#endif - -#ifndef GL_ARB_point_sprite -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_HALF_FLOAT_ARB 0x140B -#endif - -#ifndef GL_ARB_texture_float -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif - -#ifndef GL_ARB_depth_buffer_float #define GL_DEPTH_COMPONENT32F 0x8CAC #define GL_DEPTH32F_STENCIL8 0x8CAD #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#endif - -#ifndef GL_ARB_draw_instanced -#endif - -#ifndef GL_ARB_framebuffer_object #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 @@ -1697,7 +1007,7 @@ extern "C" { #define GL_TEXTURE_DEPTH_TYPE 0x8C16 #define GL_UNSIGNED_NORMALIZED 0x8C17 #define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 #define GL_RENDERBUFFER_BINDING 0x8CA7 #define GL_READ_FRAMEBUFFER 0x8CA8 #define GL_DRAW_FRAMEBUFFER 0x8CA9 @@ -1731,6 +1041,22 @@ extern "C" { #define GL_COLOR_ATTACHMENT13 0x8CED #define GL_COLOR_ATTACHMENT14 0x8CEE #define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_COLOR_ATTACHMENT16 0x8CF0 +#define GL_COLOR_ATTACHMENT17 0x8CF1 +#define GL_COLOR_ATTACHMENT18 0x8CF2 +#define GL_COLOR_ATTACHMENT19 0x8CF3 +#define GL_COLOR_ATTACHMENT20 0x8CF4 +#define GL_COLOR_ATTACHMENT21 0x8CF5 +#define GL_COLOR_ATTACHMENT22 0x8CF6 +#define GL_COLOR_ATTACHMENT23 0x8CF7 +#define GL_COLOR_ATTACHMENT24 0x8CF8 +#define GL_COLOR_ATTACHMENT25 0x8CF9 +#define GL_COLOR_ATTACHMENT26 0x8CFA +#define GL_COLOR_ATTACHMENT27 0x8CFB +#define GL_COLOR_ATTACHMENT28 0x8CFC +#define GL_COLOR_ATTACHMENT29 0x8CFD +#define GL_COLOR_ATTACHMENT30 0x8CFE +#define GL_COLOR_ATTACHMENT31 0x8CFF #define GL_DEPTH_ATTACHMENT 0x8D00 #define GL_STENCIL_ATTACHMENT 0x8D20 #define GL_FRAMEBUFFER 0x8D40 @@ -1750,74 +1076,21 @@ extern "C" { #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 #define GL_MAX_SAMPLES 0x8D57 -#endif - -#ifndef GL_ARB_framebuffer_object_DEPRECATED #define GL_INDEX 0x8222 #define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 #define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#endif - -#ifndef GL_ARB_framebuffer_sRGB #define GL_FRAMEBUFFER_SRGB 0x8DB9 -#endif - -#ifndef GL_ARB_geometry_shader4 -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -/* reuse GL_MAX_VARYING_COMPONENTS */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ -#endif - -#ifndef GL_ARB_half_float_vertex #define GL_HALF_FLOAT 0x140B -#endif - -#ifndef GL_ARB_instanced_arrays -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE -#endif - -#ifndef GL_ARB_map_buffer_range #define GL_MAP_READ_BIT 0x0001 #define GL_MAP_WRITE_BIT 0x0002 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#endif - -#ifndef GL_ARB_texture_buffer_object -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -#endif - -#ifndef GL_ARB_texture_compression_rgtc #define GL_COMPRESSED_RED_RGTC1 0x8DBB #define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC #define GL_COMPRESSED_RG_RGTC2 0x8DBD #define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#endif - -#ifndef GL_ARB_texture_rg #define GL_RG 0x8227 #define GL_RG_INTEGER 0x8228 #define GL_R8 0x8229 @@ -1840,13 +1113,212 @@ extern "C" { #define GL_RG16UI 0x823A #define GL_RG32I 0x823B #define GL_RG32UI 0x823C -#endif - -#ifndef GL_ARB_vertex_array_object #define GL_VERTEX_ARRAY_BINDING 0x85B5 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); +GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); +GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index); +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmap (GLenum target); +GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glBindVertexArray (GLuint array); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); #endif +#endif /* GL_VERSION_3_0 */ -#ifndef GL_ARB_uniform_buffer_object +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 #define GL_UNIFORM_BUFFER 0x8A11 #define GL_UNIFORM_BUFFER_BINDING 0x8A28 #define GL_UNIFORM_BUFFER_START 0x8A29 @@ -1880,44 +1352,104 @@ extern "C" { #define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 #define GL_INVALID_INDEX 0xFFFFFFFFu +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); +GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); #endif +#endif /* GL_VERSION_3_1 */ -#ifndef GL_ARB_compatibility -/* ARB_compatibility just defines tokens from core 3.0 */ +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +typedef struct __GLsync *GLsync; +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include #endif - -#ifndef GL_ARB_copy_buffer -#define GL_COPY_READ_BUFFER_BINDING 0x8F36 -#define GL_COPY_READ_BUFFER GL_COPY_READ_BUFFER_BINDING -#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 -#define GL_COPY_WRITE_BUFFER GL_COPY_WRITE_BUFFER_BINDING #endif - -#ifndef GL_ARB_shader_texture_lod -#endif - -#ifndef GL_ARB_depth_clamp +typedef uint64_t GLuint64; +typedef int64_t GLint64; +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 #define GL_DEPTH_CLAMP 0x864F -#endif - -#ifndef GL_ARB_draw_elements_base_vertex -#endif - -#ifndef GL_ARB_fragment_coord_conventions -#endif - -#ifndef GL_ARB_provoking_vertex #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C #define GL_FIRST_VERTEX_CONVENTION 0x8E4D #define GL_LAST_VERTEX_CONVENTION 0x8E4E #define GL_PROVOKING_VERTEX 0x8E4F -#endif - -#ifndef GL_ARB_seamless_cube_map #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#endif - -#ifndef GL_ARB_sync #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 #define GL_OBJECT_TYPE 0x9112 #define GL_SYNC_CONDITION 0x9113 @@ -1931,11 +1463,8 @@ extern "C" { #define GL_TIMEOUT_EXPIRED 0x911B #define GL_CONDITION_SATISFIED 0x911C #define GL_WAIT_FAILED 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull -#endif - -#ifndef GL_ARB_texture_multisample +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 #define GL_SAMPLE_POSITION 0x8E50 #define GL_SAMPLE_MASK 0x8E51 #define GL_SAMPLE_MASK_VALUE 0x8E52 @@ -1957,111 +1486,207 @@ extern "C" { #define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E #define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F #define GL_MAX_INTEGER_SAMPLES 0x9110 +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); +typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +GLAPI void APIENTRY glProvokingVertex (GLenum mode); +GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GLAPI GLboolean APIENTRY glIsSync (GLsync sync); +GLAPI void APIENTRY glDeleteSync (GLsync sync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); #endif +#endif /* GL_VERSION_3_2 */ -#ifndef GL_ARB_vertex_array_bgra -/* reuse GL_BGRA */ -#endif - -#ifndef GL_ARB_draw_buffers_blend -#endif - -#ifndef GL_ARB_sample_shading -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 -#endif - -#ifndef GL_ARB_texture_cube_map_array -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F -#endif - -#ifndef GL_ARB_texture_gather -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#endif - -#ifndef GL_ARB_texture_query_lod -#endif - -#ifndef GL_ARB_shading_language_include -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA -#endif - -#ifndef GL_ARB_texture_compression_bptc -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F -#endif - -#ifndef GL_ARB_blend_func_extended +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE #define GL_SRC1_COLOR 0x88F9 -/* reuse GL_SRC1_ALPHA */ #define GL_ONE_MINUS_SRC1_COLOR 0x88FA #define GL_ONE_MINUS_SRC1_ALPHA 0x88FB #define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC -#endif - -#ifndef GL_ARB_explicit_attrib_location -#endif - -#ifndef GL_ARB_occlusion_query2 #define GL_ANY_SAMPLES_PASSED 0x8C2F -#endif - -#ifndef GL_ARB_sampler_objects #define GL_SAMPLER_BINDING 0x8919 -#endif - -#ifndef GL_ARB_shader_bit_encoding -#endif - -#ifndef GL_ARB_texture_rgb10_a2ui #define GL_RGB10_A2UI 0x906F -#endif - -#ifndef GL_ARB_texture_swizzle #define GL_TEXTURE_SWIZZLE_R 0x8E42 #define GL_TEXTURE_SWIZZLE_G 0x8E43 #define GL_TEXTURE_SWIZZLE_B 0x8E44 #define GL_TEXTURE_SWIZZLE_A 0x8E45 #define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#endif - -#ifndef GL_ARB_timer_query #define GL_TIME_ELAPSED 0x88BF #define GL_TIMESTAMP 0x8E28 -#endif - -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */ #define GL_INT_2_10_10_10_REV 0x8D9F +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); +GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); +GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); +GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); +GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); +GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); #endif +#endif /* GL_VERSION_3_3 */ -#ifndef GL_ARB_draw_indirect +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F #define GL_DRAW_INDIRECT_BUFFER 0x8F3F #define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 -#endif - -#ifndef GL_ARB_gpu_shader5 #define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F #define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A #define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B #define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C #define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -/* reuse GL_MAX_VERTEX_STREAMS */ -#endif - -#ifndef GL_ARB_gpu_shader_fp64 -/* reuse GL_DOUBLE */ +#define GL_MAX_VERTEX_STREAMS 0x8E71 #define GL_DOUBLE_VEC2 0x8FFC #define GL_DOUBLE_VEC3 0x8FFD #define GL_DOUBLE_VEC4 0x8FFE @@ -2074,9 +1699,6 @@ extern "C" { #define GL_DOUBLE_MAT3x4 0x8F4C #define GL_DOUBLE_MAT4x2 0x8F4D #define GL_DOUBLE_MAT4x3 0x8F4E -#endif - -#ifndef GL_ARB_shader_subroutine #define GL_ACTIVE_SUBROUTINES 0x8DE5 #define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 #define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 @@ -2086,11 +1708,6 @@ extern "C" { #define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 #define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A #define GL_COMPATIBLE_SUBROUTINES 0x8E4B -/* reuse GL_UNIFORM_SIZE */ -/* reuse GL_UNIFORM_NAME_LENGTH */ -#endif - -#ifndef GL_ARB_tessellation_shader #define GL_PATCHES 0x000E #define GL_PATCH_VERTICES 0x8E72 #define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 @@ -2100,14 +1717,9 @@ extern "C" { #define GL_TESS_GEN_SPACING 0x8E77 #define GL_TESS_GEN_VERTEX_ORDER 0x8E78 #define GL_TESS_GEN_POINT_MODE 0x8E79 -/* reuse GL_TRIANGLES */ -/* reuse GL_QUADS */ #define GL_ISOLINES 0x8E7A -/* reuse GL_EQUAL */ #define GL_FRACTIONAL_ODD 0x8E7B #define GL_FRACTIONAL_EVEN 0x8E7C -/* reuse GL_CCW */ -/* reuse GL_CW */ #define GL_MAX_PATCH_VERTICES 0x8E7D #define GL_MAX_TESS_GEN_LEVEL 0x8E7E #define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F @@ -2128,29 +1740,109 @@ extern "C" { #define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 #define GL_TESS_EVALUATION_SHADER 0x8E87 #define GL_TESS_CONTROL_SHADER 0x8E88 -#endif - -#ifndef GL_ARB_texture_buffer_object_rgb32 -/* reuse GL_RGB32F */ -/* reuse GL_RGB32UI */ -/* reuse GL_RGB32I */ -#endif - -#ifndef GL_ARB_transform_feedback2 #define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED GL_TRANSFORM_FEEDBACK_PAUSED -#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE GL_TRANSFORM_FEEDBACK_ACTIVE +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 #define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 -#endif - -#ifndef GL_ARB_transform_feedback3 #define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -#define GL_MAX_VERTEX_STREAMS 0x8E71 +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); +typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLfloat value); +GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect); +GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); +GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); +GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); +GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); +GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); +GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); +GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedback (void); +GLAPI void APIENTRY glResumeTransformFeedback (void); +GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); +GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); +GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); +GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); +GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); #endif +#endif /* GL_VERSION_4_0 */ -#ifndef GL_ARB_ES2_compatibility +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 #define GL_FIXED 0x140C #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B @@ -2161,21 +1853,16 @@ extern "C" { #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 #define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB #define GL_MAX_VARYING_VECTORS 0x8DFC #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD #define GL_RGB565 0x8D62 -#endif - -#ifndef GL_ARB_get_program_binary #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 #define GL_PROGRAM_BINARY_LENGTH 0x8741 #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE #define GL_PROGRAM_BINARY_FORMATS 0x87FF -#endif - -#ifndef GL_ARB_separate_shader_objects #define GL_VERTEX_SHADER_BIT 0x00000001 #define GL_FRAGMENT_SHADER_BIT 0x00000002 #define GL_GEOMETRY_SHADER_BIT 0x00000004 @@ -2185,97 +1872,198 @@ extern "C" { #define GL_PROGRAM_SEPARABLE 0x8258 #define GL_ACTIVE_PROGRAM 0x8259 #define GL_PROGRAM_PIPELINE_BINDING 0x825A -#endif - -#ifndef GL_ARB_shader_precision -#endif - -#ifndef GL_ARB_vertex_attrib_64bit -/* reuse GL_RGB32I */ -/* reuse GL_DOUBLE_VEC2 */ -/* reuse GL_DOUBLE_VEC3 */ -/* reuse GL_DOUBLE_VEC4 */ -/* reuse GL_DOUBLE_MAT2 */ -/* reuse GL_DOUBLE_MAT3 */ -/* reuse GL_DOUBLE_MAT4 */ -/* reuse GL_DOUBLE_MAT2x3 */ -/* reuse GL_DOUBLE_MAT2x4 */ -/* reuse GL_DOUBLE_MAT3x2 */ -/* reuse GL_DOUBLE_MAT3x4 */ -/* reuse GL_DOUBLE_MAT4x2 */ -/* reuse GL_DOUBLE_MAT4x3 */ -#endif - -#ifndef GL_ARB_viewport_array -/* reuse GL_SCISSOR_BOX */ -/* reuse GL_VIEWPORT */ -/* reuse GL_DEPTH_RANGE */ -/* reuse GL_SCISSOR_TEST */ #define GL_MAX_VIEWPORTS 0x825B #define GL_VIEWPORT_SUBPIXEL_BITS 0x825C #define GL_VIEWPORT_BOUNDS_RANGE 0x825D #define GL_LAYER_PROVOKING_VERTEX 0x825E #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F #define GL_UNDEFINED_VERTEX 0x8260 -/* reuse GL_FIRST_VERTEX_CONVENTION */ -/* reuse GL_LAST_VERTEX_CONVENTION */ -/* reuse GL_PROVOKING_VERTEX */ +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings); +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReleaseShaderCompiler (void); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); +GLAPI void APIENTRY glClearDepthf (GLfloat d); +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings); +GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); +GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); +GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); +GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); +GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); +GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); #endif +#endif /* GL_VERSION_4_1 */ -#ifndef GL_ARB_cl_event -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 -#endif - -#ifndef GL_ARB_debug_output -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 -#endif - -#ifndef GL_ARB_robustness -/* reuse GL_NO_ERROR */ -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -#endif - -#ifndef GL_ARB_shader_stencil_export -#endif - -#ifndef GL_ARB_base_instance -#endif - -#ifndef GL_ARB_shading_language_420pack -#endif - -#ifndef GL_ARB_transform_feedback_instanced -#endif - -#ifndef GL_ARB_compressed_texture_pixel_storage +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 #define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 #define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 #define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 @@ -2284,20 +2072,8 @@ extern "C" { #define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C #define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D #define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E -#endif - -#ifndef GL_ARB_conservative_depth -#endif - -#ifndef GL_ARB_internalformat_query #define GL_NUM_SAMPLE_COUNTS 0x9380 -#endif - -#ifndef GL_ARB_map_buffer_alignment #define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC -#endif - -#ifndef GL_ARB_shader_atomic_counters #define GL_ATOMIC_COUNTER_BUFFER 0x92C0 #define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 #define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 @@ -2327,9 +2103,6 @@ extern "C" { #define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 #define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA #define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#endif - -#ifndef GL_ARB_shader_image_load_store #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 #define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 #define GL_UNIFORM_BARRIER_BIT 0x00000004 @@ -2394,16 +2167,75 @@ extern "C" { #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD #define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE #define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#endif - -#ifndef GL_ARB_shading_language_packing -#endif - -#ifndef GL_ARB_texture_storage +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); +typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); +GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); +GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); #endif +#endif /* GL_VERSION_4_2 */ -#ifndef GL_KHR_debug +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER_BIT 0x00000020 #define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 #define GL_DEBUG_CALLBACK_FUNCTION 0x8244 @@ -2420,6 +2252,12 @@ extern "C" { #define GL_DEBUG_TYPE_PORTABILITY 0x824F #define GL_DEBUG_TYPE_PERFORMANCE 0x8250 #define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 #define GL_DEBUG_TYPE_MARKER 0x8268 #define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 #define GL_DEBUG_TYPE_POP_GROUP 0x826A @@ -2432,1521 +2270,3491 @@ extern "C" { #define GL_QUERY 0x82E3 #define GL_PROGRAM_PIPELINE 0x82E4 #define GL_SAMPLER 0x82E6 -#define GL_DISPLAY_LIST 0x82E7 -/* DISPLAY_LIST used in compatibility profile only */ #define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 #define GL_DEBUG_OUTPUT 0x92E0 #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -/* reuse GL_STACK_UNDERFLOW */ -/* reuse GL_STACK_OVERFLOW */ +#define GL_MAX_UNIFORM_LOCATIONS 0x826E +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F +#define GL_IS_PER_PATCH 0x92E7 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF +#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_VERTEX_BINDING_BUFFER 0x8F4F +#define GL_DISPLAY_LIST 0x82E7 +typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); +GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); +GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); +GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); +GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GLAPI void APIENTRY glPopDebugGroup (void); +GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); #endif +#endif /* GL_VERSION_4_3 */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_TEXTURE_BUFFER_BINDING 0x8C2A +#define GL_MAP_PERSISTENT_BIT 0x0040 +#define GL_MAP_COHERENT_BIT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 +#define GL_CLEAR_TEXTURE 0x9365 +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 +typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); +typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); +typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers); +typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); +GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures); +GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers); +GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures); +GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +#endif +#endif /* GL_VERSION_4_4 */ + +#ifndef GL_VERSION_4_5 +#define GL_VERSION_4_5 1 +#define GL_CONTEXT_LOST 0x0507 +#define GL_NEGATIVE_ONE_TO_ONE 0x935E +#define GL_ZERO_TO_ONE 0x935F +#define GL_CLIP_ORIGIN 0x935C +#define GL_CLIP_DEPTH_MODE 0x935D +#define GL_QUERY_WAIT_INVERTED 0x8E17 +#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 +#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 +#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A +#define GL_MAX_CULL_DISTANCES 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA +#define GL_TEXTURE_TARGET 0x1006 +#define GL_QUERY_TARGET 0x82EA +#define GL_GUILTY_CONTEXT_RESET 0x8253 +#define GL_INNOCENT_CONTEXT_RESET 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 +#define GL_LOSE_CONTEXT_ON_RESET 0x8252 +#define GL_NO_RESET_NOTIFICATION 0x8261 +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 +#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB +#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC +typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); +typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); +typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum buf); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum src); +typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); +typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil); +typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint *textures); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); +typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint *samplers); +typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef void (APIENTRYP PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); +typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (APIENTRYP PFNGLGETNMAPDVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth); +GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param); +GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); +GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers); +GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glCopyNamedBufferSubData (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glClearNamedBufferData (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubData (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void *APIENTRY glMapNamedBuffer (GLuint buffer, GLenum access); +GLAPI void *APIENTRY glMapNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI GLboolean APIENTRY glUnmapNamedBuffer (GLuint buffer); +GLAPI void APIENTRY glFlushMappedNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glGetNamedBufferParameteriv (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferParameteri64v (GLuint buffer, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetNamedBufferPointerv (GLuint buffer, GLenum pname, void **params); +GLAPI void APIENTRY glGetNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void APIENTRY glCreateFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI void APIENTRY glNamedFramebufferRenderbuffer (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glNamedFramebufferParameteri (GLuint framebuffer, GLenum pname, GLint param); +GLAPI void APIENTRY glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayer (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferDrawBuffer (GLuint framebuffer, GLenum buf); +GLAPI void APIENTRY glNamedFramebufferDrawBuffers (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glNamedFramebufferReadBuffer (GLuint framebuffer, GLenum src); +GLAPI void APIENTRY glInvalidateNamedFramebufferData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); +GLAPI void APIENTRY glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil); +GLAPI void APIENTRY glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameteriv (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glCreateRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glNamedRenderbufferStorage (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisample (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameteriv (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glCreateTextures (GLenum target, GLsizei n, GLuint *textures); +GLAPI void APIENTRY glTextureBuffer (GLuint texture, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glTextureBufferRange (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTextureStorage1D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTextureStorage2D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureStorage3D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glTextureStorage2DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage3DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCompressedTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCopyTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureParameterf (GLuint texture, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfv (GLuint texture, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glTextureParameteri (GLuint texture, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterIiv (GLuint texture, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuiv (GLuint texture, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glTextureParameteriv (GLuint texture, GLenum pname, const GLint *param); +GLAPI void APIENTRY glGenerateTextureMipmap (GLuint texture); +GLAPI void APIENTRY glBindTextureUnit (GLuint unit, GLuint texture); +GLAPI void APIENTRY glGetTextureImage (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetCompressedTextureImage (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetTextureLevelParameterfv (GLuint texture, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameteriv (GLuint texture, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterfv (GLuint texture, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterIiv (GLuint texture, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuiv (GLuint texture, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetTextureParameteriv (GLuint texture, GLenum pname, GLint *params); +GLAPI void APIENTRY glCreateVertexArrays (GLsizei n, GLuint *arrays); +GLAPI void APIENTRY glDisableVertexArrayAttrib (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glEnableVertexArrayAttrib (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glVertexArrayElementBuffer (GLuint vaobj, GLuint buffer); +GLAPI void APIENTRY glVertexArrayVertexBuffer (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexArrayVertexBuffers (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +GLAPI void APIENTRY glVertexArrayAttribBinding (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexArrayAttribFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayAttribIFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayAttribLFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayBindingDivisor (GLuint vaobj, GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glGetVertexArrayiv (GLuint vaobj, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayIndexediv (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayIndexed64iv (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); +GLAPI void APIENTRY glCreateSamplers (GLsizei n, GLuint *samplers); +GLAPI void APIENTRY glCreateProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI void APIENTRY glCreateQueries (GLenum target, GLsizei n, GLuint *ids); +GLAPI void APIENTRY glGetQueryBufferObjecti64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glGetQueryBufferObjectiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glGetQueryBufferObjectui64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glGetQueryBufferObjectuiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glMemoryBarrierByRegion (GLbitfield barriers); +GLAPI void APIENTRY glGetTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetCompressedTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +GLAPI GLenum APIENTRY glGetGraphicsResetStatus (void); +GLAPI void APIENTRY glGetnCompressedTexImage (GLenum target, GLint lod, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetnTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetnUniformdv (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +GLAPI void APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GLAPI void APIENTRY glGetnMapdv (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfv (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapiv (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfv (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuiv (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusv (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStipple (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTable (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +GLAPI void APIENTRY glGetnConvolutionFilter (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +GLAPI void APIENTRY glGetnSeparableFilter (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +GLAPI void APIENTRY glGetnHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glGetnMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glTextureBarrier (void); +#endif +#endif /* GL_VERSION_4_5 */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +#endif /* GL_ARB_ES2_compatibility */ + +#ifndef GL_ARB_ES3_1_compatibility +#define GL_ARB_ES3_1_compatibility 1 +#endif /* GL_ARB_ES3_1_compatibility */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 +#endif /* GL_ARB_ES3_compatibility */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 +#endif /* GL_ARB_arrays_of_arrays */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 +#endif /* GL_ARB_base_instance */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 +typedef uint64_t GLuint64EXT; +#define GL_UNSIGNED_INT64_ARB 0x140F +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture); +GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler); +GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle); +GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle); +GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access); +GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle); +GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle); +GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle); +GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params); +#endif +#endif /* GL_ARB_bindless_texture */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +#endif /* GL_ARB_blend_func_extended */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 +#endif /* GL_ARB_buffer_storage */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +struct _cl_context; +struct _cl_event; +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); +#endif +#endif /* GL_ARB_cl_event */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 +#endif /* GL_ARB_clear_buffer_object */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 +#endif /* GL_ARB_clear_texture */ + +#ifndef GL_ARB_clip_control +#define GL_ARB_clip_control 1 +#endif /* GL_ARB_clip_control */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); +#endif +#endif /* GL_ARB_color_buffer_float */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +#endif /* GL_ARB_compatibility */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 +#endif /* GL_ARB_compressed_texture_pixel_storage */ #ifndef GL_ARB_compute_shader -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_LOCAL_INVOCATIONS 0x90EB -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_LOCAL_WORK_SIZE 0x8267 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_EXT_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_SGIX_impact_pixel_texture -#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 -#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 -#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 -#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 -#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 -#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 -#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif +#define GL_ARB_compute_shader 1 +#endif /* GL_ARB_compute_shader */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +#endif +#endif /* GL_ARB_compute_variable_group_size */ + +#ifndef GL_ARB_conditional_render_inverted +#define GL_ARB_conditional_render_inverted 1 +#endif /* GL_ARB_conditional_render_inverted */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 +#endif /* GL_ARB_conservative_depth */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#endif /* GL_ARB_copy_buffer */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 +#endif /* GL_ARB_copy_image */ + +#ifndef GL_ARB_cull_distance +#define GL_ARB_cull_distance 1 +#endif /* GL_ARB_cull_distance */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif +#endif /* GL_ARB_debug_output */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif /* GL_ARB_depth_buffer_float */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +#endif /* GL_ARB_depth_clamp */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif /* GL_ARB_depth_texture */ + +#ifndef GL_ARB_derivative_control +#define GL_ARB_derivative_control 1 +#endif /* GL_ARB_derivative_control */ + +#ifndef GL_ARB_direct_state_access +#define GL_ARB_direct_state_access 1 +#endif /* GL_ARB_direct_state_access */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_ARB_draw_buffers */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif +#endif /* GL_ARB_draw_buffers_blend */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +#endif /* GL_ARB_draw_indirect */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_ARB_draw_instanced */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 +#endif /* GL_ARB_enhanced_layouts */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +#endif /* GL_ARB_explicit_attrib_location */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 +#endif /* GL_ARB_explicit_uniform_location */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +#endif /* GL_ARB_fragment_coord_conventions */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 +#endif /* GL_ARB_fragment_layer_viewport */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); +#endif +#endif /* GL_ARB_fragment_program */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif /* GL_ARB_fragment_program_shadow */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif /* GL_ARB_fragment_shader */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#endif /* GL_ARB_framebuffer_object */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif /* GL_ARB_framebuffer_sRGB */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif +#endif /* GL_ARB_geometry_shader4 */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +#endif /* GL_ARB_get_program_binary */ + +#ifndef GL_ARB_get_texture_sub_image +#define GL_ARB_get_texture_sub_image 1 +#endif /* GL_ARB_get_texture_sub_image */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +#endif /* GL_ARB_gpu_shader5 */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +typedef unsigned short GLhalfARB; +#define GL_HALF_FLOAT_ARB 0x140B +#endif /* GL_ARB_half_float_pixel */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif /* GL_ARB_half_float_vertex */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 +#define GL_BLEND_COLOR 0x8005 +#define GL_BLEND_EQUATION 0x8009 +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogram (GLenum target); +GLAPI void APIENTRY glResetMinmax (GLenum target); +#endif +#endif /* GL_ARB_imaging */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#endif +#endif /* GL_ARB_indirect_parameters */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); +#endif +#endif /* GL_ARB_instanced_arrays */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 +#endif /* GL_ARB_internalformat_query */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 +#define GL_SRGB_DECODE_ARB 0x8299 +#endif /* GL_ARB_internalformat_query2 */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 +#endif /* GL_ARB_invalidate_subdata */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 +#endif /* GL_ARB_map_buffer_alignment */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#endif /* GL_ARB_map_buffer_range */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_ARB_matrix_palette */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 +#endif /* GL_ARB_multi_bind */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 +#endif /* GL_ARB_multi_draw_indirect */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); +#endif +#endif /* GL_ARB_multisample */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); +#endif +#endif /* GL_ARB_multitexture */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); +GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQueryARB (GLenum target); +GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); +#endif +#endif /* GL_ARB_occlusion_query */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +#endif /* GL_ARB_occlusion_query2 */ + +#ifndef GL_ARB_pipeline_statistics_query +#define GL_ARB_pipeline_statistics_query 1 +#define GL_VERTICES_SUBMITTED_ARB 0x82EE +#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 +#endif /* GL_ARB_pipeline_statistics_query */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif /* GL_ARB_pixel_buffer_object */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_ARB_point_parameters */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif /* GL_ARB_point_sprite */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 +#endif /* GL_ARB_program_interface_query */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +#endif /* GL_ARB_provoking_vertex */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 +#endif /* GL_ARB_query_buffer_object */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 +#endif /* GL_ARB_robust_buffer_access_behavior */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img); +GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +#endif +#endif /* GL_ARB_robustness */ + +#ifndef GL_ARB_robustness_isolation +#define GL_ARB_robustness_isolation 1 +#endif /* GL_ARB_robustness_isolation */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); +#endif +#endif /* GL_ARB_sample_shading */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +#endif /* GL_ARB_sampler_objects */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +#endif /* GL_ARB_seamless_cube_map */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +#endif /* GL_ARB_separate_shader_objects */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 +#endif /* GL_ARB_shader_atomic_counters */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 +#endif /* GL_ARB_shader_bit_encoding */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 +#endif /* GL_ARB_shader_draw_parameters */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 +#endif /* GL_ARB_shader_group_vote */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 +#endif /* GL_ARB_shader_image_load_store */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 +#endif /* GL_ARB_shader_image_size */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef char GLcharARB; +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif +#endif /* GL_ARB_shader_objects */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 +#endif /* GL_ARB_shader_precision */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +#endif /* GL_ARB_shader_stencil_export */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 +#endif /* GL_ARB_shader_storage_buffer_object */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +#endif /* GL_ARB_shader_subroutine */ + +#ifndef GL_ARB_shader_texture_image_samples +#define GL_ARB_shader_texture_image_samples 1 +#endif /* GL_ARB_shader_texture_image_samples */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +#endif /* GL_ARB_shader_texture_lod */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif /* GL_ARB_shading_language_100 */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 +#endif /* GL_ARB_shading_language_420pack */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); +GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif +#endif /* GL_ARB_shading_language_include */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 +#endif /* GL_ARB_shading_language_packing */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif /* GL_ARB_shadow */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif /* GL_ARB_shadow_ambient */ + +#ifndef GL_ARB_sparse_buffer +#define GL_ARB_sparse_buffer 1 +#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 +#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 +typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferPageCommitmentARB (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); +GLAPI void APIENTRY glNamedBufferPageCommitmentEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +GLAPI void APIENTRY glNamedBufferPageCommitmentARB (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +#endif +#endif /* GL_ARB_sparse_buffer */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#endif +#endif /* GL_ARB_sparse_texture */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 +#endif /* GL_ARB_stencil_texturing */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +#endif /* GL_ARB_sync */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +#endif /* GL_ARB_tessellation_shader */ + +#ifndef GL_ARB_texture_barrier +#define GL_ARB_texture_barrier 1 +#endif /* GL_ARB_texture_barrier */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif /* GL_ARB_texture_border_clamp */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); +#endif +#endif /* GL_ARB_texture_buffer_object */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 +#endif /* GL_ARB_texture_buffer_range */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img); +#endif +#endif /* GL_ARB_texture_compression */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#endif /* GL_ARB_texture_compression_bptc */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif /* GL_ARB_texture_compression_rgtc */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif /* GL_ARB_texture_cube_map */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#endif /* GL_ARB_texture_cube_map_array */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif /* GL_ARB_texture_env_add */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif /* GL_ARB_texture_env_combine */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif /* GL_ARB_texture_env_crossbar */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif /* GL_ARB_texture_env_dot3 */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif /* GL_ARB_texture_float */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F +#endif /* GL_ARB_texture_gather */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +#endif /* GL_ARB_texture_multisample */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 +#endif /* GL_ARB_texture_query_levels */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +#endif /* GL_ARB_texture_query_lod */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif /* GL_ARB_texture_rectangle */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif /* GL_ARB_texture_rg */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +#endif /* GL_ARB_texture_rgb10_a2ui */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 +#endif /* GL_ARB_texture_stencil8 */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 +#endif /* GL_ARB_texture_storage */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 +#endif /* GL_ARB_texture_storage_multisample */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +#endif /* GL_ARB_texture_swizzle */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 +#endif /* GL_ARB_texture_view */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +#endif /* GL_ARB_timer_query */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +#endif /* GL_ARB_transform_feedback2 */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +#endif /* GL_ARB_transform_feedback3 */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 +#endif /* GL_ARB_transform_feedback_instanced */ + +#ifndef GL_ARB_transform_feedback_overflow_query +#define GL_ARB_transform_feedback_overflow_query 1 +#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED +#endif /* GL_ARB_transform_feedback_overflow_query */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); +#endif +#endif /* GL_ARB_transpose_matrix */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#endif /* GL_ARB_uniform_buffer_object */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +#endif /* GL_ARB_vertex_array_bgra */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#endif /* GL_ARB_vertex_array_object */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 +#endif /* GL_ARB_vertex_attrib_binding */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); +GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); +GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); +GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); +GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); +GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); +GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); +GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexBlendARB (GLint count); +#endif +#endif /* GL_ARB_vertex_blend */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +typedef ptrdiff_t GLsizeiptrARB; +typedef ptrdiff_t GLintptrARB; +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_ARB_vertex_buffer_object */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer); +#endif +#endif /* GL_ARB_vertex_program */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); +#endif +#endif /* GL_ARB_vertex_shader */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +#endif /* GL_ARB_viewport_array */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); +#endif +#endif /* GL_ARB_window_pos */ + +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 +#define GL_MULTIPLY_KHR 0x9294 +#define GL_SCREEN_KHR 0x9295 +#define GL_OVERLAY_KHR 0x9296 +#define GL_DARKEN_KHR 0x9297 +#define GL_LIGHTEN_KHR 0x9298 +#define GL_COLORDODGE_KHR 0x9299 +#define GL_COLORBURN_KHR 0x929A +#define GL_HARDLIGHT_KHR 0x929B +#define GL_SOFTLIGHT_KHR 0x929C +#define GL_DIFFERENCE_KHR 0x929E +#define GL_EXCLUSION_KHR 0x92A0 +#define GL_HSL_HUE_KHR 0x92AD +#define GL_HSL_SATURATION_KHR 0x92AE +#define GL_HSL_COLOR_KHR 0x92AF +#define GL_HSL_LUMINOSITY_KHR 0x92B0 +typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendBarrierKHR (void); +#endif +#endif /* GL_KHR_blend_equation_advanced */ + +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#endif /* GL_KHR_blend_equation_advanced_coherent */ + +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 +#endif /* GL_KHR_context_flush_control */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +#endif /* GL_KHR_debug */ + +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 +#endif /* GL_KHR_no_error */ + +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 +#endif /* GL_KHR_robust_buffer_access_behavior */ + +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 +#endif /* GL_KHR_robustness */ + +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#endif /* GL_KHR_texture_compression_astc_hdr */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif /* GL_KHR_texture_compression_astc_ldr */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s); +typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t); +typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r); +typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q); +typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x, GLbyte y); +typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y, GLbyte z); +typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z, GLbyte w); +typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s); +GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t); +GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r); +GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glTexCoord1bOES (GLbyte s); +GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t); +GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r); +GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex2bOES (GLbyte x, GLbyte y); +GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y, GLbyte z); +GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z, GLbyte w); +GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords); +#endif +#endif /* GL_OES_byte_coordinates */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif /* GL_OES_compressed_paletted_texture */ + +#ifndef GL_OES_fixed_point +#define GL_OES_fixed_point 1 +typedef GLint GLfixed; +#define GL_FIXED_OES 0x140C +typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref); +typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth); +typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); +typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation); +typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); +typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); +typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); +typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value); +typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); +typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue); +typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components); +typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u); +typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v); +typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v); +typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values); +typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component); +typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); +typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); +typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2); +typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token); +typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values); +typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities); +typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y); +typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w); +typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); +typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2); +typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s); +typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t); +typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r); +typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x); +typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y); +typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref); +GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glClearDepthxOES (GLfixed depth); +GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); +GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f); +GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation); +GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); +GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glLineWidthxOES (GLfixed width); +GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); +GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glPointSizexOES (GLfixed size); +GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); +GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value); +GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); +GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue); +GLAPI void APIENTRY glColor3xvOES (const GLfixed *components); +GLAPI void APIENTRY glColor4xvOES (const GLfixed *components); +GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u); +GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords); +GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v); +GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer); +GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v); +GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values); +GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glIndexxOES (GLfixed component); +GLAPI void APIENTRY glIndexxvOES (const GLfixed *component); +GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); +GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); +GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2); +GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); +GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s); +GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t); +GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r); +GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glPassThroughxOES (GLfixed token); +GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values); +GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param); +GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor); +GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities); +GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y); +GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w); +GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); +GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2); +GLAPI void APIENTRY glTexCoord1xOES (GLfixed s); +GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t); +GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r); +GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glVertex2xOES (GLfixed x); +GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y); +GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords); +#endif +#endif /* GL_OES_fixed_point */ + +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent); +#endif +#endif /* GL_OES_query_matrix */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif /* GL_OES_read_format */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); +typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); +typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation); +typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearDepthfOES (GLclampf depth); +GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); +GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f); +GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation); +GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +#endif +#endif /* GL_OES_single_precision */ #ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 #define GL_MULTISAMPLE_3DFX 0x86B2 #define GL_SAMPLE_BUFFERS_3DFX 0x86B3 #define GL_SAMPLES_3DFX 0x86B4 #define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif +#endif /* GL_3DFX_multisample */ #ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); #endif +#endif /* GL_3DFX_tbuffer */ -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#endif +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif /* GL_3DFX_texture_compression_FXT1 */ -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D +#endif /* GL_AMD_blend_minmax_factor */ -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +#endif /* GL_AMD_conservative_depth */ -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); #endif +#endif /* GL_AMD_debug_output */ -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F +#endif /* GL_AMD_depth_clamp_separate */ -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); #endif +#endif /* GL_AMD_draw_buffers_blend */ -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 +#endif /* GL_AMD_gcn_shader */ -#ifndef GL_ATI_texture_mirror_once -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 +typedef int64_t GLint64EXT; +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); #endif +#endif /* GL_AMD_gpu_shader_int64 */ -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 +typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param); #endif +#endif /* GL_AMD_interleaved_elements */ -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_IBM 0x8370 +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); #endif +#endif /* GL_AMD_multi_draw_indirect */ -#ifndef GL_NV_evaluators -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); +GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); +GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); #endif +#endif /* GL_AMD_name_gen_delete */ -#ifndef GL_NV_packed_depth_stencil -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF +typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); #endif +#endif /* GL_AMD_occlusion_query_event */ -#ifndef GL_NV_register_combiners2 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #endif +#endif /* GL_AMD_performance_monitor */ -#ifndef GL_NV_texture_compression_vtc -#endif +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 +#endif /* GL_AMD_pinned_memory */ -#ifndef GL_NV_texture_rectangle -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 +#endif /* GL_AMD_query_buffer_object */ -#ifndef GL_NV_texture_shader -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV -#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV -#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); #endif +#endif /* GL_AMD_sample_positions */ -#ifndef GL_NV_texture_shader2 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +#endif /* GL_AMD_seamless_cubemap_per_texture */ -#ifndef GL_NV_vertex_array_range2 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 +#endif /* GL_AMD_shader_atomic_counter_ops */ -#ifndef GL_NV_vertex_program -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#endif +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +#endif /* GL_AMD_shader_stencil_export */ -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 +#endif /* GL_AMD_shader_trinary_minmax */ -#ifndef GL_SGIX_scalebias_hint -#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); #endif +#endif /* GL_AMD_sparse_texture */ -#ifndef GL_OML_interlace -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D +typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); #endif +#endif /* GL_AMD_stencil_operation_extended */ -#ifndef GL_OML_subsample -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif /* GL_AMD_texture_texture4 */ -#ifndef GL_OML_resample -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +#endif /* GL_AMD_transform_feedback3_lines_triangles */ -#ifndef GL_NV_copy_depth_to_color -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 +#endif /* GL_AMD_transform_feedback4 */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 +#endif /* GL_AMD_vertex_shader_layer */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); +GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); #endif +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 +#endif /* GL_AMD_vertex_shader_viewport_index */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#endif /* GL_APPLE_aux_depth_stencil */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif /* GL_APPLE_client_storage */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif +#endif /* GL_APPLE_element_array */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); +#endif +#endif /* GL_APPLE_fence */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#endif /* GL_APPLE_float_pixels */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); +#endif +#endif /* GL_APPLE_flush_buffer_range */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif +#endif /* GL_APPLE_object_purgeable */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#define GL_RGB_422_APPLE 0x8A1F +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_RAW_422_APPLE 0x8A51 +#endif /* GL_APPLE_rgb_422 */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#endif /* GL_APPLE_row_bytes */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif /* GL_APPLE_specular_vector */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_APPLE_texture_range */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif /* GL_APPLE_transform_hint */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); +#endif +#endif /* GL_APPLE_vertex_array_object */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); +#endif +#endif /* GL_APPLE_vertex_array_range */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#define GL_YCBCR_422_APPLE 0x85B9 +#endif /* GL_APPLE_ycbcr_422 */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_ATI_draw_buffers */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif +#endif /* GL_ATI_element_array */ #ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 #define GL_BUMP_ROT_MATRIX_ATI 0x8775 #define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 #define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 @@ -3955,9 +5763,20 @@ extern "C" { #define GL_DU8DV8_ATI 0x877A #define GL_BUMP_ENVMAP_ATI 0x877B #define GL_BUMP_TARGET_ATI 0x877C +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); #endif +#endif /* GL_ATI_envmap_bumpmap */ #ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 #define GL_FRAGMENT_SHADER_ATI 0x8920 #define GL_REG_0_ATI 0x8921 #define GL_REG_1_ATI 0x8922 @@ -4062,9 +5881,63 @@ extern "C" { #define GL_COMP_BIT_ATI 0x00000002 #define GL_NEGATE_BIT_ATI 0x00000004 #define GL_BIAS_BIT_ATI 0x00000008 +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); +GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); #endif +#endif /* GL_ATI_fragment_shader */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); +#endif +#endif /* GL_ATI_map_object_buffer */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif /* GL_ATI_meminfo */ + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif /* GL_ATI_pixel_format_float */ #ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 #define GL_PN_TRIANGLES_ATI 0x87F0 #define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 #define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 @@ -4074,9 +5947,64 @@ extern "C" { #define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 #define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 #define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); #endif +#endif /* GL_ATI_pn_triangles */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif +#endif /* GL_ATI_separate_stencil */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif /* GL_ATI_text_fragment_shader */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif /* GL_ATI_texture_env_combine3 */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif /* GL_ATI_texture_float */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif /* GL_ATI_texture_mirror_once */ #ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 #define GL_STATIC_ATI 0x8760 #define GL_DYNAMIC_ATI 0x8761 #define GL_PRESERVE_ATI 0x8762 @@ -4085,9 +6013,2238 @@ extern "C" { #define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 #define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 #define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); #endif +#endif /* GL_ATI_vertex_array_object */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); +#endif +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); +GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); +GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); +#endif +#endif /* GL_ATI_vertex_streams */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif /* GL_EXT_422_pixels */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#define GL_ABGR_EXT 0x8000 +#endif /* GL_EXT_abgr */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif /* GL_EXT_bgra */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); +#endif +#endif /* GL_EXT_bindable_uniform */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#endif +#endif /* GL_EXT_blend_color */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); +#endif +#endif /* GL_EXT_blend_equation_separate */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif +#endif /* GL_EXT_blend_func_separate */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif /* GL_EXT_blend_logic_op */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_BLEND_EQUATION_EXT 0x8009 +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); +#endif +#endif /* GL_EXT_blend_minmax */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif /* GL_EXT_blend_subtract */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif /* GL_EXT_clip_volume_hint */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif /* GL_EXT_cmyka */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif +#endif /* GL_EXT_color_subtable */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif +#endif /* GL_EXT_compiled_vertex_array */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +#endif +#endif /* GL_EXT_convolution */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); +GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); +GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_coordinate_frame */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#endif /* GL_EXT_copy_texture */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_cull_vertex */ + +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +#endif /* GL_EXT_debug_label */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPopGroupMarkerEXT (void); +#endif +#endif /* GL_EXT_debug_marker */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); +#endif +#endif /* GL_EXT_depth_bounds_test */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); +GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glEnableVertexArrayEXT (GLuint vaobj, GLenum array); +GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array); +GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param); +GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param); +GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); +GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); +GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor); +#endif +#endif /* GL_EXT_direct_state_access */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +#endif +#endif /* GL_EXT_draw_buffers2 */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_EXT_draw_instanced */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +#endif +#endif /* GL_EXT_draw_range_elements */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_fog_coord */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +#endif /* GL_EXT_framebuffer_blit */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_EXT_framebuffer_multisample */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); +#endif +#endif /* GL_EXT_framebuffer_object */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif /* GL_EXT_framebuffer_sRGB */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +#endif +#endif /* GL_EXT_geometry_shader4 */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif +#endif /* GL_EXT_gpu_program_parameters */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); +#endif +#endif /* GL_EXT_gpu_shader4 */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogramEXT (GLenum target); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); +#endif +#endif /* GL_EXT_histogram */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif /* GL_EXT_index_array_formats */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); +#endif +#endif /* GL_EXT_index_func */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); +#endif +#endif /* GL_EXT_index_material */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif /* GL_EXT_index_texture */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); +GLAPI void APIENTRY glTextureLightEXT (GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); +#endif +#endif /* GL_EXT_light_texture */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif /* GL_EXT_misc_attribute */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#endif +#endif /* GL_EXT_multi_draw_arrays */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); +#endif +#endif /* GL_EXT_multisample */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif /* GL_EXT_packed_depth_stencil */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif /* GL_EXT_packed_float */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif /* GL_EXT_packed_pixels */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_paletted_texture */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif /* GL_EXT_pixel_buffer_object */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_pixel_transform */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_EXT_point_parameters */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); +#endif +#endif /* GL_EXT_polygon_offset */ + +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B +typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp); +#endif +#endif /* GL_EXT_polygon_offset_clamp */ + +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 +#endif /* GL_EXT_post_depth_coverage */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); +#endif +#endif /* GL_EXT_provoking_vertex */ + +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +typedef void (APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations); +#endif +#endif /* GL_EXT_raster_multisample */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif /* GL_EXT_rescale_normal */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_secondary_color */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); +GLAPI void APIENTRY glActiveProgramEXT (GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); +#endif +#endif /* GL_EXT_separate_shader_objects */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif /* GL_EXT_separate_specular_color */ + +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 +#endif /* GL_EXT_shader_image_load_formatted */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); +#endif +#endif /* GL_EXT_shader_image_load_store */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 +#endif /* GL_EXT_shader_integer_mix */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif /* GL_EXT_shadow_funcs */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif /* GL_EXT_shared_texture_palette */ + +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 +#endif /* GL_EXT_sparse_texture2 */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif +#endif /* GL_EXT_stencil_clear_tag */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); +#endif +#endif /* GL_EXT_stencil_two_side */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif /* GL_EXT_stencil_wrap */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_EXT_subtexture */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif /* GL_EXT_texture */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_EXT_texture3D */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif +#endif /* GL_EXT_texture_array */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); +#endif +#endif /* GL_EXT_texture_buffer_object */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif /* GL_EXT_texture_compression_latc */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif /* GL_EXT_texture_cube_map */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif /* GL_EXT_texture_env_add */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif /* GL_EXT_texture_env_combine */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif /* GL_EXT_texture_env_dot3 */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 +#endif /* GL_EXT_texture_filter_minmax */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif +#endif /* GL_EXT_texture_integer */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif /* GL_EXT_texture_lod_bias */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif +#endif /* GL_EXT_texture_object */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); +#endif +#endif /* GL_EXT_texture_perturb_normal */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif /* GL_EXT_texture_sRGB */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif /* GL_EXT_texture_shared_exponent */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#endif /* GL_EXT_texture_snorm */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif /* GL_EXT_texture_swizzle */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#define GL_TIME_ELAPSED_EXT 0x88BF +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); +#endif +#endif /* GL_EXT_timer_query */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif +#endif /* GL_EXT_transform_feedback */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint i); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +#endif +#endif /* GL_EXT_vertex_array */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif /* GL_EXT_vertex_array_bgra */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); +#endif +#endif /* GL_EXT_vertex_attrib_64bit */ #ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 #define GL_VERTEX_SHADER_EXT 0x8780 #define GL_VERTEX_SHADER_BINDING_EXT 0x8781 #define GL_OP_INDEX_EXT 0x8782 @@ -4198,181 +8355,855 @@ extern "C" { #define GL_INVARIANT_DATATYPE_EXT 0x87EB #define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC #define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); +GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); +GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr); +GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); +GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); +GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); +GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); +GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); +GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); +GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); +GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); #endif +#endif /* GL_EXT_vertex_shader */ -#ifndef GL_ATI_vertex_streams -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); #endif +#endif /* GL_EXT_vertex_weighting */ -#ifndef GL_ATI_element_array -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 +#define GL_SYNC_X11_FENCE_EXT 0x90E1 +typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); #endif +#endif /* GL_EXT_x11_sync_object */ -#ifndef GL_SUN_mesh_array -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); #endif +#endif /* GL_GREMEDY_frame_terminator */ -#ifndef GL_SUN_slice_accum -#define GL_SLICE_ACCUM_SUN 0x85CC +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string); #endif +#endif /* GL_GREMEDY_string_marker */ -#ifndef GL_NV_multisample_filter_hint -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif /* GL_HP_convolution_border_modes */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); #endif +#endif /* GL_HP_image_transform */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif /* GL_HP_occlusion_test */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif /* GL_HP_texture_lighting */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#define GL_CULL_VERTEX_IBM 103050 +#endif /* GL_IBM_cull_vertex */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +#endif +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif /* GL_IBM_rasterpos_clip */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 +typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target); +#endif +#endif /* GL_IBM_static_data */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +#endif +#endif /* GL_IBM_vertex_array_lists */ + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif +#endif /* GL_INGR_blend_func_separate */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif /* GL_INGR_color_clamp */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#define GL_INTERLACE_READ_INGR 0x8568 +#endif /* GL_INGR_interlace_read */ + +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 +#endif /* GL_INTEL_fragment_shader_ordering */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); +typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture); +GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level); +GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +#endif +#endif /* GL_INTEL_map_texture */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer); +#endif +#endif /* GL_INTEL_parallel_arrays */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 +typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); +typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); +typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); +typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); +typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); +typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); +GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); +GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); +GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); +GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); +GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#endif +#endif /* GL_INTEL_performance_query */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif /* GL_MESAX_texture_stack */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#define GL_PACK_INVERT_MESA 0x8758 +#endif /* GL_MESA_pack_invert */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif +#endif /* GL_MESA_resize_buffers */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); +#endif +#endif /* GL_MESA_window_pos */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif /* GL_MESA_ycbcr_texture */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id); +GLAPI void APIENTRY glEndConditionalRenderNVX (void); +#endif +#endif /* GL_NVX_conditional_render */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B +#endif /* GL_NVX_gpu_memory_info */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +#endif +#endif /* GL_NV_bindless_multi_draw_indirect */ + +#ifndef GL_NV_bindless_multi_draw_indirect_count +#define GL_NV_bindless_multi_draw_indirect_count 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessCountNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessCountNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +#endif +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); +GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); +GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); +GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); +GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); +GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); +GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); +GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); +#endif +#endif /* GL_NV_bindless_texture */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLUE_NV 0x1905 +#define GL_COLORBURN_NV 0x929A +#define GL_COLORDODGE_NV 0x9299 +#define GL_CONJOINT_NV 0x9284 +#define GL_CONTRAST_NV 0x92A1 +#define GL_DARKEN_NV 0x9297 +#define GL_DIFFERENCE_NV 0x929E +#define GL_DISJOINT_NV 0x9283 +#define GL_DST_ATOP_NV 0x928F +#define GL_DST_IN_NV 0x928B +#define GL_DST_NV 0x9287 +#define GL_DST_OUT_NV 0x928D +#define GL_DST_OVER_NV 0x9289 +#define GL_EXCLUSION_NV 0x92A0 +#define GL_GREEN_NV 0x1904 +#define GL_HARDLIGHT_NV 0x929B +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_INVERT_OVG_NV 0x92B4 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LIGHTEN_NV 0x9298 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_MINUS_NV 0x929F +#define GL_MULTIPLY_NV 0x9294 +#define GL_OVERLAY_NV 0x9296 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_PLUS_NV 0x9291 +#define GL_RED_NV 0x1903 +#define GL_SCREEN_NV 0x9295 +#define GL_SOFTLIGHT_NV 0x929C +#define GL_SRC_ATOP_NV 0x928E +#define GL_SRC_IN_NV 0x928A +#define GL_SRC_NV 0x9286 +#define GL_SRC_OUT_NV 0x928C +#define GL_SRC_OVER_NV 0x9288 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_XOR_NV 0x1506 +typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value); +GLAPI void APIENTRY glBlendBarrierNV (void); +#endif +#endif /* GL_NV_blend_equation_advanced */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#endif /* GL_NV_blend_equation_advanced_coherent */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif /* GL_NV_blend_square */ + +#ifndef GL_NV_command_list +#define GL_NV_command_list 1 +#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 +#define GL_NOP_COMMAND_NV 0x0001 +#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 +#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 +#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 +#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 +#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 +#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 +#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 +#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 +#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000A +#define GL_BLEND_COLOR_COMMAND_NV 0x000B +#define GL_STENCIL_REF_COMMAND_NV 0x000C +#define GL_LINE_WIDTH_COMMAND_NV 0x000D +#define GL_POLYGON_OFFSET_COMMAND_NV 0x000E +#define GL_ALPHA_REF_COMMAND_NV 0x000F +#define GL_VIEWPORT_COMMAND_NV 0x0010 +#define GL_SCISSOR_COMMAND_NV 0x0011 +#define GL_FRONT_FACE_COMMAND_NV 0x0012 +typedef void (APIENTRYP PFNGLCREATESTATESNVPROC) (GLsizei n, GLuint *states); +typedef void (APIENTRYP PFNGLDELETESTATESNVPROC) (GLsizei n, const GLuint *states); +typedef GLboolean (APIENTRYP PFNGLISSTATENVPROC) (GLuint state); +typedef void (APIENTRYP PFNGLSTATECAPTURENVPROC) (GLuint state, GLenum mode); +typedef GLuint (APIENTRYP PFNGLGETCOMMANDHEADERNVPROC) (GLenum tokenID, GLuint size); +typedef GLushort (APIENTRYP PFNGLGETSTAGEINDEXNVPROC) (GLenum shadertype); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSNVPROC) (GLenum primitiveMode, GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, GLuint count); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSADDRESSNVPROC) (GLenum primitiveMode, const GLuint64 *indirects, const GLsizei *sizes, GLuint count); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESNVPROC) (GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC) (const GLuint64 *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +typedef void (APIENTRYP PFNGLCREATECOMMANDLISTSNVPROC) (GLsizei n, GLuint *lists); +typedef void (APIENTRYP PFNGLDELETECOMMANDLISTSNVPROC) (GLsizei n, const GLuint *lists); +typedef GLboolean (APIENTRYP PFNGLISCOMMANDLISTNVPROC) (GLuint list); +typedef void (APIENTRYP PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC) (GLuint list, GLuint segment, const void **indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +typedef void (APIENTRYP PFNGLCOMMANDLISTSEGMENTSNVPROC) (GLuint list, GLuint segments); +typedef void (APIENTRYP PFNGLCOMPILECOMMANDLISTNVPROC) (GLuint list); +typedef void (APIENTRYP PFNGLCALLCOMMANDLISTNVPROC) (GLuint list); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCreateStatesNV (GLsizei n, GLuint *states); +GLAPI void APIENTRY glDeleteStatesNV (GLsizei n, const GLuint *states); +GLAPI GLboolean APIENTRY glIsStateNV (GLuint state); +GLAPI void APIENTRY glStateCaptureNV (GLuint state, GLenum mode); +GLAPI GLuint APIENTRY glGetCommandHeaderNV (GLenum tokenID, GLuint size); +GLAPI GLushort APIENTRY glGetStageIndexNV (GLenum shadertype); +GLAPI void APIENTRY glDrawCommandsNV (GLenum primitiveMode, GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, GLuint count); +GLAPI void APIENTRY glDrawCommandsAddressNV (GLenum primitiveMode, const GLuint64 *indirects, const GLsizei *sizes, GLuint count); +GLAPI void APIENTRY glDrawCommandsStatesNV (GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +GLAPI void APIENTRY glDrawCommandsStatesAddressNV (const GLuint64 *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +GLAPI void APIENTRY glCreateCommandListsNV (GLsizei n, GLuint *lists); +GLAPI void APIENTRY glDeleteCommandListsNV (GLsizei n, const GLuint *lists); +GLAPI GLboolean APIENTRY glIsCommandListNV (GLuint list); +GLAPI void APIENTRY glListDrawCommandsStatesClientNV (GLuint list, GLuint segment, const void **indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +GLAPI void APIENTRY glCommandListSegmentsNV (GLuint list, GLuint segments); +GLAPI void APIENTRY glCompileCommandListNV (GLuint list); +GLAPI void APIENTRY glCallCommandListNV (GLuint list); +#endif +#endif /* GL_NV_command_list */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC +#endif /* GL_NV_compute_program5 */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif +#endif /* GL_NV_conditional_render */ + +#ifndef GL_NV_conservative_raster +#define GL_NV_conservative_raster 1 +#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 +#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 +#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 +#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 +typedef void (APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits); +#endif +#endif /* GL_NV_conservative_raster */ + +#ifndef GL_NV_conservative_raster_dilate +#define GL_NV_conservative_raster_dilate 1 +#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 +#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A +#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B +typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConservativeRasterParameterfNV (GLenum pname, GLfloat value); +#endif +#endif /* GL_NV_conservative_raster_dilate */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif /* GL_NV_copy_depth_to_color */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* GL_NV_copy_image */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 +#endif /* GL_NV_deep_texture3D */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); +#endif +#endif /* GL_NV_depth_buffer_float */ #ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 #define GL_DEPTH_CLAMP_NV 0x864F -#endif +#endif /* GL_NV_depth_clamp */ -#ifndef GL_NV_occlusion_query -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 +typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); #endif +#endif /* GL_NV_draw_texture */ -#ifndef GL_NV_point_sprite -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); #endif +#endif /* GL_NV_evaluators */ -#ifndef GL_NV_texture_shader3 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); #endif +#endif /* GL_NV_explicit_multisample */ -#ifndef GL_NV_vertex_program1_1 +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); +GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GLAPI void APIENTRY glFinishFenceNV (GLuint fence); +GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); #endif +#endif /* GL_NV_fence */ -#ifndef GL_EXT_shadow_funcs -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif - -#ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E -#endif - -#ifndef GL_APPLE_fence -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -#ifndef GL_S3_s3tc -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif - -#ifndef GL_ATI_texture_float -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 +#define GL_FILL_RECTANGLE_NV 0x933C +#endif /* GL_NV_fill_rectangle */ #ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 #define GL_FLOAT_R_NV 0x8880 #define GL_FLOAT_RG_NV 0x8881 #define GL_FLOAT_RGB_NV 0x8882 @@ -4388,236 +9219,127 @@ extern "C" { #define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C #define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D #define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif /* GL_NV_float_buffer */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +#endif /* GL_NV_fog_distance */ + +#ifndef GL_NV_fragment_coverage_to_color +#define GL_NV_fragment_coverage_to_color 1 +#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD +#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE +typedef void (APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentCoverageColorNV (GLuint color); #endif +#endif /* GL_NV_fragment_coverage_to_color */ #ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 #define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 #define GL_FRAGMENT_PROGRAM_NV 0x8870 #define GL_MAX_TEXTURE_COORDS_NV 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 #define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 #define GL_PROGRAM_ERROR_STRING_NV 0x8874 +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); #endif - -#ifndef GL_NV_half_float -#define GL_HALF_FLOAT_NV 0x140B -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#endif - -#ifndef GL_NV_primitive_restart -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif - -#ifndef GL_NV_vertex_program2 -#endif - -#ifndef GL_ATI_map_object_buffer -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#endif - -#ifndef GL_OES_read_format -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#endif - -#ifndef GL_MESA_pack_invert -#define GL_PACK_INVERT_MESA 0x8758 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif - -#ifndef GL_NV_fragment_program_option -#endif +#endif /* GL_NV_fragment_program */ #ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 #define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 #define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 #define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 #define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 #define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif +#endif /* GL_NV_fragment_program2 */ -#ifndef GL_NV_vertex_program2_option -/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ -/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ -#endif +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif /* GL_NV_fragment_program4 */ -#ifndef GL_NV_vertex_program3 -/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ -#endif +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif /* GL_NV_fragment_program_option */ -#ifndef GL_EXT_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#endif +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 +#endif /* GL_NV_fragment_shader_interlock */ -#ifndef GL_GREMEDY_string_marker +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 +typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); +typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v); +typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); +GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v); +GLAPI void APIENTRY glCoverageModulationNV (GLenum components); #endif +#endif /* GL_NV_framebuffer_mixed_samples */ -#ifndef GL_EXT_packed_depth_stencil -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); #endif +#endif /* GL_NV_framebuffer_multisample_coverage */ -#ifndef GL_EXT_stencil_clear_tag -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); #endif +#endif /* GL_NV_geometry_program4 */ -#ifndef GL_EXT_texture_sRGB -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif /* GL_NV_geometry_shader4 */ -#ifndef GL_EXT_framebuffer_blit -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -#endif - -#ifndef GL_EXT_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#endif - -#ifndef GL_MESAX_texture_stack -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#endif - -#ifndef GL_EXT_timer_query -#define GL_TIME_ELAPSED_EXT 0x88BF -#endif - -#ifndef GL_EXT_gpu_program_parameters -#endif - -#ifndef GL_APPLE_flush_buffer_range -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -#endif +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 +#endif /* GL_NV_geometry_shader_passthrough */ #ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 #define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 #define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 #define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 @@ -4626,629 +9348,44 @@ extern "C" { #define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 #define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 #define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); #endif - -#ifndef GL_NV_geometry_program4 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#endif - -#ifndef GL_EXT_geometry_shader4 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ -/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ -/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ -/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -/* reuse GL_LINES_ADJACENCY_EXT */ -/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ -/* reuse GL_TRIANGLES_ADJACENCY_EXT */ -/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ -/* reuse GL_PROGRAM_POINT_SIZE_EXT */ -#endif - -#ifndef GL_NV_vertex_program4 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -#endif - -#ifndef GL_EXT_gpu_shader4 -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#endif - -#ifndef GL_EXT_draw_instanced -#endif - -#ifndef GL_EXT_packed_float -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#endif - -#ifndef GL_EXT_texture_array -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ -#endif - -#ifndef GL_EXT_texture_buffer_object -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -#endif - -#ifndef GL_EXT_texture_compression_latc -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#endif - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif - -#ifndef GL_EXT_texture_shared_exponent -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#endif - -#ifndef GL_NV_depth_buffer_float -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -#endif - -#ifndef GL_NV_fragment_program4 -#endif - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -#endif - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#endif - -#ifndef GL_NV_geometry_shader4 -#endif - -#ifndef GL_NV_parameter_buffer_object -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -#endif - -#ifndef GL_EXT_draw_buffers2 -#endif - -#ifndef GL_NV_transform_feedback -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#define GL_LAYER_NV 0x8DAA -#define GL_NEXT_BUFFER_NV -2 -#define GL_SKIP_COMPONENTS4_NV -3 -#define GL_SKIP_COMPONENTS3_NV -4 -#define GL_SKIP_COMPONENTS2_NV -5 -#define GL_SKIP_COMPONENTS1_NV -6 -#endif - -#ifndef GL_EXT_bindable_uniform -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -#endif - -#ifndef GL_EXT_texture_integer -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -#endif - -#ifndef GL_GREMEDY_frame_terminator -#endif - -#ifndef GL_NV_conditional_render -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -#endif - -#ifndef GL_NV_present_video -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -#endif - -#ifndef GL_EXT_transform_feedback -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -#endif - -#ifndef GL_EXT_direct_state_access -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -#endif - -#ifndef GL_EXT_vertex_array_bgra -/* reuse GL_BGRA */ -#endif - -#ifndef GL_EXT_texture_swizzle -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#endif - -#ifndef GL_NV_explicit_multisample -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -#endif - -#ifndef GL_NV_transform_feedback2 -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -#endif - -#ifndef GL_ATI_meminfo -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD -#endif - -#ifndef GL_AMD_performance_monitor -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -#endif - -#ifndef GL_AMD_texture_texture4 -#endif - -#ifndef GL_AMD_vertex_shader_tesselator -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 -#endif - -#ifndef GL_EXT_provoking_vertex -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F -#endif - -#ifndef GL_EXT_texture_snorm -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B -/* reuse GL_RED_SNORM */ -/* reuse GL_RG_SNORM */ -/* reuse GL_RGB_SNORM */ -/* reuse GL_RGBA_SNORM */ -/* reuse GL_R8_SNORM */ -/* reuse GL_RG8_SNORM */ -/* reuse GL_RGB8_SNORM */ -/* reuse GL_RGBA8_SNORM */ -/* reuse GL_R16_SNORM */ -/* reuse GL_RG16_SNORM */ -/* reuse GL_RGB16_SNORM */ -/* reuse GL_RGBA16_SNORM */ -/* reuse GL_SIGNED_NORMALIZED */ -#endif - -#ifndef GL_AMD_draw_buffers_blend -#endif - -#ifndef GL_APPLE_texture_range -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -/* reuse GL_STORAGE_CACHED_APPLE */ -/* reuse GL_STORAGE_SHARED_APPLE */ -#endif - -#ifndef GL_APPLE_float_pixels -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F -#endif - -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 -#endif - -#ifndef GL_APPLE_aux_depth_stencil -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 -#endif - -#ifndef GL_APPLE_object_purgeable -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D -#endif - -#ifndef GL_APPLE_row_bytes -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 -#endif - -#ifndef GL_APPLE_rgb_422 -#define GL_RGB_422_APPLE 0x8A1F -/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */ -/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */ -#endif - -#ifndef GL_NV_video_capture -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C -#endif - -#ifndef GL_NV_copy_image -#endif - -#ifndef GL_EXT_separate_shader_objects -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D -#endif - -#ifndef GL_NV_parameter_buffer_object2 -#endif - -#ifndef GL_NV_shader_buffer_load -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 -#endif - -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 -#endif - -#ifndef GL_NV_texture_barrier -#endif - -#ifndef GL_AMD_shader_stencil_export -#endif - -#ifndef GL_AMD_seamless_cubemap_per_texture -/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ -#endif - -#ifndef GL_AMD_conservative_depth -#endif - -#ifndef GL_EXT_shader_image_load_store -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF -#endif - -#ifndef GL_EXT_vertex_attrib_64bit -/* reuse GL_DOUBLE */ -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -#endif +#endif /* GL_NV_gpu_program4 */ #ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 #define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A #define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B #define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C @@ -5257,136 +9394,202 @@ extern "C" { #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F #define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 #define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); #endif +#endif /* GL_NV_gpu_program5 */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 +#endif /* GL_NV_gpu_program5_mem_extended */ #ifndef GL_NV_gpu_shader5 -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -/* reuse GL_PATCHES */ -#endif +#define GL_NV_gpu_shader5 1 +#endif /* GL_NV_gpu_shader5 */ -#ifndef GL_NV_shader_buffer_store -#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 -/* reuse GL_READ_WRITE */ -/* reuse GL_WRITE_ONLY */ +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +typedef unsigned short GLhalfNV; +#define GL_HALF_FLOAT_NV 0x140B +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); #endif +#endif /* GL_NV_half_float */ -#ifndef GL_NV_tessellation_program5 -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#ifndef GL_NV_internalformat_sample_query +#define GL_NV_internalformat_sample_query 1 +#define GL_MULTISAMPLES_NV 0x9371 +#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 +#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 +#define GL_CONFORMANT_NV 0x9374 +typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); #endif +#endif /* GL_NV_internalformat_sample_query */ -#ifndef GL_NV_vertex_attrib_integer_64bit -/* reuse GL_INT64_NV */ -/* reuse GL_UNSIGNED_INT64_NV */ -#endif +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif /* GL_NV_light_max_exponent */ #ifndef GL_NV_multisample_coverage -#define GL_COVERAGE_SAMPLES_NV 0x80A9 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#endif +#define GL_NV_multisample_coverage 1 +#endif /* GL_NV_multisample_coverage */ -#ifndef GL_AMD_name_gen_delete -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 -#endif +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif /* GL_NV_multisample_filter_hint */ -#ifndef GL_AMD_debug_output -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); #endif +#endif /* GL_NV_occlusion_query */ -#ifndef GL_NV_vdpau_interop -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE -#endif +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif /* GL_NV_packed_depth_stencil */ -#ifndef GL_AMD_transform_feedback3_lines_triangles +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); #endif +#endif /* GL_NV_parameter_buffer_object */ -#ifndef GL_AMD_depth_clamp_separate -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F -#endif - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#endif - -#ifndef GL_NV_texture_multisample -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 -#endif - -#ifndef GL_AMD_blend_minmax_factor -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#endif - -#ifndef GL_AMD_sample_positions -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F -#endif - -#ifndef GL_EXT_x11_sync_object -#define GL_SYNC_X11_FENCE_EXT 0x90E1 -#endif - -#ifndef GL_AMD_multi_draw_indirect -#endif - -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB -#endif +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +#endif /* GL_NV_parameter_buffer_object2 */ #ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 #define GL_PATH_FORMAT_SVG_NV 0x9070 #define GL_PATH_FORMAT_PS_NV 0x9071 #define GL_STANDARD_FONT_NAME_NV 0x9072 @@ -5408,27 +9611,19 @@ extern "C" { #define GL_PATH_FILL_COVER_MODE_NV 0x9082 #define GL_PATH_STROKE_COVER_MODE_NV 0x9083 #define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_PATH_SAMPLE_QUALITY_NV 0x9085 -#define GL_PATH_STROKE_BOUND_NV 0x9086 -#define GL_PATH_STROKE_OVERSAMPLE_COUNT_NV 0x9087 #define GL_COUNT_UP_NV 0x9088 #define GL_COUNT_DOWN_NV 0x9089 #define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A #define GL_CONVEX_HULL_NV 0x908B -#define GL_MULTI_HULLS_NV 0x908C #define GL_BOUNDING_BOX_NV 0x908D #define GL_TRANSLATE_X_NV 0x908E #define GL_TRANSLATE_Y_NV 0x908F #define GL_TRANSLATE_2D_NV 0x9090 #define GL_TRANSLATE_3D_NV 0x9091 #define GL_AFFINE_2D_NV 0x9092 -#define GL_PROJECTIVE_2D_NV 0x9093 #define GL_AFFINE_3D_NV 0x9094 -#define GL_PROJECTIVE_3D_NV 0x9095 #define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_PROJECTIVE_2D_NV 0x9097 #define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_TRANSPOSE_PROJECTIVE_3D_NV 0x9099 #define GL_UTF8_NV 0x909A #define GL_UTF16_NV 0x909B #define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C @@ -5447,13 +9642,11 @@ extern "C" { #define GL_SKIP_MISSING_GLYPH_NV 0x90A9 #define GL_USE_MISSING_GLYPH_NV 0x90AA #define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC #define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD #define GL_ADJACENT_PAIRS_NV 0x90AE #define GL_FIRST_TO_REST_NV 0x90AF #define GL_PATH_GEN_MODE_NV 0x90B0 #define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 #define GL_PATH_GEN_COMPONENTS_NV 0x90B3 #define GL_PATH_STENCIL_FUNC_NV 0x90B7 #define GL_PATH_STENCIL_REF_NV 0x90B8 @@ -5508,2656 +9701,1399 @@ extern "C" { #define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 #define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 #define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_NV 0x00100000 -#define GL_FONT_ASCENDER_NV 0x00200000 -#define GL_FONT_DESCENDER_NV 0x00400000 -#define GL_FONT_HEIGHT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_NV 0x08000000 -#define GL_FONT_HAS_KERNING_NV 0x10000000 +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_ROUNDED_RECT_NV 0xE8 +#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 +#define GL_ROUNDED_RECT2_NV 0xEA +#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB +#define GL_ROUNDED_RECT4_NV 0xEC +#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED +#define GL_ROUNDED_RECT8_NV 0xEE +#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 +#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 +#define GL_FONT_UNAVAILABLE_NV 0x936A +#define GL_FONT_UNINTELLIGIBLE_NV 0x936B +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 +#define GL_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_2_BYTES_NV 0x1407 +#define GL_3_BYTES_NV 0x1408 +#define GL_4_BYTES_NV 0x1409 +#define GL_EYE_LINEAR_NV 0x2400 +#define GL_OBJECT_LINEAR_NV 0x2401 +#define GL_CONSTANT_NV 0x8576 +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_PROJECTION_NV 0x1701 +#define GL_PATH_MODELVIEW_NV 0x1700 +#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 +#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 +#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 +#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 +#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 +#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 +#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 +#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 +#define GL_FRAGMENT_INPUT_NV 0x936D +typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); +typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); +typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); +typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); +typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); +typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); +GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); +GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); +GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); +GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); +GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); +GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); +GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); +GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); +GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); +GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); +GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); +GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); +GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); +GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); +GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); +GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); +GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); +GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); +GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +GLAPI void APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); +GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); +GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); +GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); #endif +#endif /* GL_NV_path_rendering */ -#ifndef GL_AMD_pinned_memory -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 -#endif +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 +#define GL_SHARED_EDGE_NV 0xC0 +#endif /* GL_NV_path_rendering_shared_edge */ -#ifndef GL_AMD_stencil_operation_extended -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); #endif +#endif /* GL_NV_pixel_data_range */ -#ifndef GL_AMD_vertex_shader_viewport_index +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); #endif +#endif /* GL_NV_point_sprite */ -#ifndef GL_AMD_vertex_shader_layer +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); #endif +#endif /* GL_NV_present_video */ -#ifndef GL_NV_bindless_texture +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); #endif +#endif /* GL_NV_primitive_restart */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); +#endif +#endif /* GL_NV_register_combiners */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); +#endif +#endif /* GL_NV_register_combiners2 */ + +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 +typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glResolveDepthValuesNV (void); +#endif +#endif /* GL_NV_sample_locations */ + +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 +#endif /* GL_NV_sample_mask_override_coverage */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 +#endif /* GL_NV_shader_atomic_counters */ #ifndef GL_NV_shader_atomic_float -#endif +#define GL_NV_shader_atomic_float 1 +#endif /* GL_NV_shader_atomic_float */ +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 +#endif /* GL_NV_shader_atomic_fp16_vector */ -/*************************************************************/ +#ifndef GL_NV_shader_atomic_int64 +#define GL_NV_shader_atomic_int64 1 +#endif /* GL_NV_shader_atomic_int64 */ -#include -#ifndef GL_VERSION_2_0 -/* GL type for program/shader text */ -typedef char GLchar; +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); +GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); +GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); +GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); +GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); +GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); #endif +#endif /* GL_NV_shader_buffer_load */ -#ifndef GL_VERSION_1_5 -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -#endif +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +#endif /* GL_NV_shader_buffer_store */ -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -#endif +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 +#endif /* GL_NV_shader_storage_buffer_object */ -#ifndef GL_ARB_shader_objects -/* GL types for program/shader text and shader object handles */ -typedef char GLcharARB; -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif -#endif +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B +#endif /* GL_NV_shader_thread_group */ -/* GL type for "half" precision (s10e5) float data in host memory */ -#ifndef GL_ARB_half_float_pixel -typedef unsigned short GLhalfARB; -#endif +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 +#endif /* GL_NV_shader_thread_shuffle */ -#ifndef GL_NV_half_float -typedef unsigned short GLhalfNV; -#endif +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#endif /* GL_NV_tessellation_program5 */ -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include -#endif -#endif +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif /* GL_NV_texgen_emboss */ -#ifndef GL_EXT_timer_query -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -#endif +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif /* GL_NV_texgen_reflection */ -#ifndef GL_ARB_sync -typedef int64_t GLint64; -typedef uint64_t GLuint64; -typedef struct __GLsync *GLsync; +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureBarrierNV (void); #endif +#endif /* GL_NV_texture_barrier */ -#ifndef GL_ARB_cl_event -/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ -struct _cl_context; -struct _cl_event; -#endif +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif /* GL_NV_texture_compression_vtc */ -#ifndef GL_ARB_debug_output -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); -#endif +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif /* GL_NV_texture_env_combine4 */ -#ifndef GL_AMD_debug_output -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); -#endif +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif /* GL_NV_texture_expand_normal */ -#ifndef GL_KHR_debug -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); #endif +#endif /* GL_NV_texture_multisample */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif /* GL_NV_texture_rectangle */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif /* GL_NV_texture_shader */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif /* GL_NV_texture_shader2 */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif /* GL_NV_texture_shader3 */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLsizei count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); +GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif +#endif /* GL_NV_transform_feedback */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); +#endif +#endif /* GL_NV_transform_feedback2 */ + +#ifndef GL_NV_uniform_buffer_unified_memory +#define GL_NV_uniform_buffer_unified_memory 1 +#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E +#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F +#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 +#endif /* GL_NV_uniform_buffer_unified_memory */ #ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 typedef GLintptr GLvdpauSurfaceNV; -#endif - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void APIENTRY glBlendEquation (GLenum mode); -GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_VERSION_1_2_DEPRECATED -#define GL_VERSION_1_2_DEPRECATED 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogram (GLenum target); -GLAPI void APIENTRY glResetMinmax (GLenum target); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -#endif - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum texture); -GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_VERSION_1_3_DEPRECATED -#define GL_VERSION_1_3_DEPRECATED 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClientActiveTexture (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -#endif - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount); -GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_VERSION_1_4_DEPRECATED -#define GL_VERSION_1_4_DEPRECATED 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordf (GLfloat coord); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); -GLAPI void APIENTRY glFogCoordd (GLdouble coord); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2iv (const GLint *v); -GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); -GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3iv (const GLint *v); -GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -#endif - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQuery (GLuint id); -GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQuery (GLenum target); -GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); -GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); -GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); -GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); -GLAPI void APIENTRY glCompileShader (GLuint shader); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum type); -GLAPI void APIENTRY glDeleteProgram (GLuint program); -GLAPI void APIENTRY glDeleteShader (GLuint shader); -GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); -GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer); -GLAPI GLboolean APIENTRY glIsProgram (GLuint program); -GLAPI GLboolean APIENTRY glIsShader (GLuint shader); -GLAPI void APIENTRY glLinkProgram (GLuint program); -GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar **string, const GLint *length); -GLAPI void APIENTRY glUseProgram (GLuint program); -GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glValidateProgram (GLuint program); -GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar **string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -/* OpenGL 3.0 also reuses entry points from these extensions: */ -/* ARB_framebuffer_object */ -/* ARB_map_buffer_range */ -/* ARB_vertex_array_object */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); -GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); -GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedback (void); -GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); -GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); -GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); -GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); -GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); -GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -#endif - -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -/* OpenGL 3.1 also reuses entry points from these extensions: */ -/* ARB_copy_buffer */ -/* ARB_uniform_buffer_object */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); -#endif - -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 -/* OpenGL 3.2 also reuses entry points from these extensions: */ -/* ARB_draw_elements_base_vertex */ -/* ARB_provoking_vertex */ -/* ARB_sync */ -/* ARB_texture_multisample */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); -GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -#endif - -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 -/* OpenGL 3.3 also reuses entry points from these extensions: */ -/* ARB_blend_func_extended */ -/* ARB_sampler_objects */ -/* ARB_explicit_attrib_location, but it has none */ -/* ARB_occlusion_query2 (no entry points) */ -/* ARB_shader_bit_encoding (no entry points) */ -/* ARB_texture_rgb10_a2ui (no entry points) */ -/* ARB_texture_swizzle (no entry points) */ -/* ARB_timer_query */ -/* ARB_vertex_type_2_10_10_10_rev */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); -#endif - -#ifndef GL_VERSION_4_0 -#define GL_VERSION_4_0 1 -/* OpenGL 4.0 also reuses entry points from these extensions: */ -/* ARB_texture_query_lod (no entry points) */ -/* ARB_draw_indirect */ -/* ARB_gpu_shader5 (no entry points) */ -/* ARB_gpu_shader_fp64 */ -/* ARB_shader_subroutine */ -/* ARB_tessellation_shader */ -/* ARB_texture_buffer_object_rgb32 (no entry points) */ -/* ARB_texture_cube_map_array (no entry points) */ -/* ARB_texture_gather (no entry points) */ -/* ARB_transform_feedback2 */ -/* ARB_transform_feedback3 */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShading (GLfloat value); -GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); -typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#endif - -#ifndef GL_VERSION_4_1 -#define GL_VERSION_4_1 1 -/* OpenGL 4.1 reuses entry points from these extensions: */ -/* ARB_ES2_compatibility */ -/* ARB_get_program_binary */ -/* ARB_separate_shader_objects */ -/* ARB_shader_precision (no entry points) */ -/* ARB_vertex_attrib_64bit */ -/* ARB_viewport_array */ -#endif - -#ifndef GL_VERSION_4_2 -#define GL_VERSION_4_2 1 -/* OpenGL 4.2 reuses entry points from these extensions: */ -/* ARB_base_instance */ -/* ARB_shading_language_420pack (no entry points) */ -/* ARB_transform_feedback_instanced */ -/* ARB_compressed_texture_pixel_storage (no entry points) */ -/* ARB_conservative_depth (no entry points) */ -/* ARB_internalformat_query */ -/* ARB_map_buffer_alignment (no entry points) */ -/* ARB_shader_atomic_counters */ -/* ARB_shader_image_load_store */ -/* ARB_shading_language_packing (no entry points) */ -/* ARB_texture_storage */ -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); -GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); -GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); -GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); -GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); -GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); -GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); -GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); -GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glVertexBlendARB (GLint count); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#endif - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#endif - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); -GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#endif - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); -GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#endif - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); -GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); -GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); -GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); -GLAPI void APIENTRY glEndQueryARB (GLenum target); -GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); -GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); -GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); -GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -#endif - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#endif - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -#endif - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmap (GLenum target); -GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -#endif - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); -GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -#endif - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); -#endif - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -#endif - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#endif - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -#endif - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -#endif - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArray (GLuint array); -GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); -#endif - -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices); -GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); -GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -#endif - -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 -#endif - -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#endif - -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 -#endif - -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 -#endif - -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); -GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); -#endif - -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 -#endif - -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertex (GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); -#endif - -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 -#endif - -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); -GLAPI GLboolean APIENTRY glIsSync (GLsync sync); -GLAPI void APIENTRY glDeleteSync (GLsync sync); -GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); -typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); -typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); -typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#endif - -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); -#endif - -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 -#endif - -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -#endif - -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); -#endif - -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 -#endif - -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 -#endif - -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 -#endif - -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); -GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); -GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); -typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); -typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); -#endif - -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 -#endif - -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); -#endif - -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 -#endif - -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 -#endif - -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); -GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); -GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); -GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); -GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); -GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); -GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); -GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); -GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); -typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); -typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); -typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); -#endif - -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 -#endif - -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 -#endif - -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 -#endif - -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); -GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); -#endif - -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); -GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); -GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); -GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); -GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); -GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); -GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); -GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); -GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); -GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); -typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); -typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); -#endif - -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect); -GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); -#endif - -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 -#endif - -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); -GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); -#endif - -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); -GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); -GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); -typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); -#endif - -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); -GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); -#endif - -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 -#endif - -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedback (void); -GLAPI void APIENTRY glResumeTransformFeedback (void); -GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); -#endif - -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); -GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); -GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); -GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); -typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -#endif - -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReleaseShaderCompiler (void); -GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); -GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); -GLAPI void APIENTRY glClearDepthf (GLfloat d); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); -typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); -typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); -#endif - -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); -GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); -typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); -#endif - -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* const *strings); -GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); -GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); -GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); -GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); -GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); -GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); -GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* const *strings); -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -#endif - -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); -#endif - -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); -GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); -GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); -GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); -typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); -#endif - -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); -#endif - -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -#endif - -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); -GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); -GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); -GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); -GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); -GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); -GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); -GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); -GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); -GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); -GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); -GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); -GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); -GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); -typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); -typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); -typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); -typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); -typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); -typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -#endif - -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 -#endif - -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); -#endif - -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 -#endif - -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei primcount); -GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); -#endif - -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 -#endif - -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 -#endif - -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -#endif - -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 -#endif - -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); -#endif - -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); -#endif - -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 -#endif - -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -#endif - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); -GLAPI void APIENTRY glPopDebugGroup (void); -GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); -typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif - -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); -#endif - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogramEXT (GLenum target); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress); +GLAPI void APIENTRY glVDPAUFiniNV (void); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); +GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif +#endif /* GL_NV_vdpau_interop */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer); +#endif +#endif /* GL_NV_vertex_array_range */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif /* GL_NV_vertex_array_range2 */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); +GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); +#endif +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); +GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); +GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); +GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); +#endif +#endif /* GL_NV_vertex_program */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif /* GL_NV_vertex_program1_1 */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif /* GL_NV_vertex_program2 */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif /* GL_NV_vertex_program2_option */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif /* GL_NV_vertex_program3 */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); +#endif +#endif /* GL_NV_vertex_program4 */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif +#endif /* GL_NV_video_capture */ + +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 +#endif /* GL_NV_viewport_array2 */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif /* GL_OML_interlace */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif /* GL_OML_resample */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif /* GL_OML_subsample */ + +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_MAX_VIEWS_OVR 0x9631 +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +#endif +#endif /* GL_OVR_multiview */ + +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 +#endif /* GL_OVR_multiview2 */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); +#endif +#endif /* GL_PGI_misc_hints */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif /* GL_PGI_vertex_hints */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif /* GL_REND_screen_coordinates */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 +#endif /* GL_S3_s3tc */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); +#endif +#endif /* GL_SGIS_detail_texture */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); +#endif +#endif /* GL_SGIS_fog_function */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif /* GL_SGIS_generate_mipmap */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); +#endif +#endif /* GL_SGIS_multisample */ #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); @@ -8165,443 +11101,266 @@ GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); #endif +#endif /* GL_SGIS_pixel_texture */ -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); -GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint i); -GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); -GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params); -GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#endif +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif /* GL_SGIS_point_line_texgen */ #ifndef GL_SGIS_point_parameters #define GL_SGIS_point_parameters 1 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); #endif +#endif /* GL_SGIS_point_parameters */ -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); #endif +#endif /* GL_SGIS_sharpen_texture */ -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); #endif +#endif /* GL_SGIS_texture4D */ -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif /* GL_SGIS_texture_border_clamp */ + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #endif +#endif /* GL_SGIS_texture_color_mask */ -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); #endif +#endif /* GL_SGIS_texture_filter4 */ -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif /* GL_SGIS_texture_lod */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif /* GL_SGIS_texture_select */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#define GL_ASYNC_MARKER_SGIX 0x8329 +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); #endif +#endif /* GL_SGIX_async */ -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#endif +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif /* GL_SGIX_async_histogram */ -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif /* GL_SGIX_async_pixel */ -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); -GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); -GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif /* GL_SGIX_blend_alpha_minmax */ #ifndef GL_SGIX_calligraphic_fragment #define GL_SGIX_calligraphic_fragment 1 -#endif +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif /* GL_SGIX_calligraphic_fragment */ -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif /* GL_SGIX_clipmap */ -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif /* GL_SGIX_convolution_accuracy */ -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif /* GL_SGIX_depth_pass_instrument */ -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif /* GL_SGIX_depth_texture */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +GLAPI void APIENTRY glFlushRasterSGIX (void); #endif +#endif /* GL_SGIX_flush_raster */ -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif /* GL_SGIX_fog_offset */ #ifndef GL_SGIX_fragment_lighting #define GL_SGIX_fragment_lighting 1 +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); @@ -8621,295 +11380,332 @@ GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #endif +#endif /* GL_SGIX_fragment_lighting */ -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); #endif +#endif /* GL_SGIX_framezoom */ -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); -GLAPI void APIENTRY glTextureLightEXT (GLenum pname); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params); #endif +#endif /* GL_SGIX_igloo_interface */ -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); #endif +#endif /* GL_SGIX_instruments */ -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#define GL_INTERLACE_SGIX 0x8094 +#endif /* GL_SGIX_interlace */ -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif /* GL_SGIX_ir_instrument1 */ -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#define GL_LIST_PRIORITY_SGIX 0x8182 +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer); -GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); +GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); +GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); #endif +#endif /* GL_SGIX_list_priority */ -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); #endif +#endif /* GL_SGIX_pixel_texture */ -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif /* GL_SGIX_pixel_tiles */ -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); #endif +#endif /* GL_SGIX_polynomial_ffd */ -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); #endif +#endif /* GL_SGIX_reference_plane */ -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif /* GL_SGIX_resample */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif /* GL_SGIX_scalebias_hint */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif /* GL_SGIX_shadow */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif /* GL_SGIX_shadow_ambient */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); #endif +#endif /* GL_SGIX_sprite */ -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif /* GL_SGIX_subsample */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glTagSampleBufferSGIX (void); #endif +#endif /* GL_SGIX_tag_sample_buffer */ -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif /* GL_SGIX_texture_add_env */ -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif /* GL_SGIX_texture_lod_bias */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif /* GL_SGIX_texture_scale_bias */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif /* GL_SGIX_vertex_preclip */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif /* GL_SGIX_ycrcb */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif /* GL_SGIX_ycrcb_subsample */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif /* GL_SGIX_ycrcba */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif /* GL_SGI_color_matrix */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); -GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); -GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); -GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); -GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); #endif +#endif /* GL_SGI_color_table */ -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif /* GL_SGI_texture_color_table */ #ifndef GL_SUNX_constant_data #define GL_SUNX_constant_data 1 +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); #endif +#endif /* GL_SUNX_constant_data */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif /* GL_SUN_convolution_border_modes */ #ifndef GL_SUN_global_alpha #define GL_SUN_global_alpha 1 +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); @@ -8919,19 +11715,50 @@ GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); #endif +#endif /* GL_SUN_global_alpha */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif +#endif /* GL_SUN_mesh_array */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif /* GL_SUN_slice_accum */ #ifndef GL_SUN_triangle_list #define GL_SUN_triangle_list 1 +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); @@ -8939,19 +11766,52 @@ GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer); #endif +#endif /* GL_SUN_triangle_list */ #ifndef GL_SUN_vertex #define GL_SUN_vertex 1 +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); @@ -8993,2931 +11853,19 @@ GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); #endif +#endif /* GL_SUN_vertex */ -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); -GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#endif - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); -GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); -GLAPI void APIENTRY glFinishFenceNV (GLuint fence); -GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#endif - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#endif - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); -GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); -GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); -GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); -GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#endif - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#endif - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#endif - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); -GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); -GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); -GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr); -GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); -GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); -GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); -GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); -GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); -GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); -GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); -GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); -GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); -GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); -GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); -GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); -GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); -GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); -GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#endif - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); -GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#endif - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#endif - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#endif - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -/* This is really a WGL extension, but defines some associated GL enums. - * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. - */ -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#endif - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#endif - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#endif - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#endif - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#endif - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#endif - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#endif - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#endif - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#endif - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#endif - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); -#endif - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -#endif - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); -#endif - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -#endif - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -#endif - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); -#endif - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#endif - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); -#endif - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -#endif - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); -GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -#endif - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -#endif - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); -GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); -GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); -GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); -GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -#endif - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -#endif - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -#endif - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#endif - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -#endif - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#endif - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -#endif - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); -GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -#endif - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -#endif - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -#endif - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -#endif - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); -#endif - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); -GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); -GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); -GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); -#endif - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); -GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); -GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); -GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); -GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); -#endif - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); -GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); -GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -#endif - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); -GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#endif - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); -#endif - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); -GLAPI void APIENTRY glEndConditionalRenderNV (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#endif - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); -GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); -#endif - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); -GLAPI void APIENTRY glEndTransformFeedbackEXT (void); -GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); -GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -#endif - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); -GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); -GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); -GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); -GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); -GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); -GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); -GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); -GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); -GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); -GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string); -GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); -GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); -GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); -GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); -GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); -GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); -GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); -GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); -GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); -GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); -GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); -GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); -GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); -GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); -GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); -GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); -GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); -GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); -GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); -#endif - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -#endif - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -#endif - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); -GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); -#endif - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); -GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); -GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); -GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); -GLAPI void APIENTRY glPauseTransformFeedbackNV (void); -GLAPI void APIENTRY glResumeTransformFeedbackNV (void); -GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -#endif - -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 -#endif - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); -GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); -GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); -GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); -typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); -typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); -typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); -#endif - -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 -#endif - -#ifndef GL_AMD_vertex_shader_tesselator -#define GL_AMD_vertex_shader_tesselator 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); -GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 -#endif - -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); -GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); -GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -#endif - -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer); -GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 -#endif - -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); -GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); -GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -#endif - -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 -#endif - -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); -GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); -#endif - -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 -#endif - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -#endif - -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); -GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); -typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); -#endif - -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -#endif - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); -GLAPI void APIENTRY glActiveProgramEXT (GLuint program); -GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); -typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); -#endif - -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 -#endif - -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); -GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); -GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); -GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); -GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); -GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); -GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); -GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); -GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); -GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); -GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); -typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); -typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); -typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); -typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif - -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); -GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); -GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); -#endif - -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureBarrierNV (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); -#endif - -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 -#endif - -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 -#endif - -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 -#endif - -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); -#endif - -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); -GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); -GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); -GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -#endif - -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); -GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); -#endif - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); -GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); -GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); -GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); -GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); -GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif - -#ifndef GL_NV_shader_buffer_store -#define GL_NV_shader_buffer_store 1 -#endif - -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 -#endif - -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); -GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); -GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); -GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); -GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); -GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); -GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -#endif - -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 -#endif - -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); -GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); -GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); -typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); -typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); -#endif - -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); -#endif - -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress); -GLAPI void APIENTRY glVDPAUFiniNV (void); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); -GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); -GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress); -typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); -typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); -typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); -#endif - -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 -#endif - -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 -#endif - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -#endif - -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -#endif - -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 -#endif - -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); -#endif - -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -#endif - -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); -#endif - -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 -#endif - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); -GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); -GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); -GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString); -GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); -GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); -GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); -GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); -GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); -GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); -GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); -GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); -GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); -GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); -GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); -GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); -GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); -GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); -GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); -GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); -GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); -GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); -GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); -GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); -GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); -typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords); -typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString); -typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); -typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); -typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); -typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); -typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); -typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); -typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); -typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); -typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); -typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -#endif - -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 -#endif - -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); -#endif - -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 -#endif - -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 -#endif - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); -GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); -GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); -GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); -GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); -GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); -GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); -GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); -GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); -GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); -GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -#endif - -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 -#endif +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif /* GL_WIN_phong_shading */ +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif /* GL_WIN_specular_fog */ #ifdef __cplusplus } From 51e243deb5bfe245b388be13f9b5e1e66d1fe2ae Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 31 Jul 2015 13:28:16 +0200 Subject: [PATCH 094/203] Fix point size/line width setting regression in OpenGL --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index e05e1e2d8e..a1a2e7e7a9 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -6036,9 +6036,13 @@ do_issue_render_mode() { // The thickness affects both the line width and the point size. if (thickness != _point_size) { - glLineWidth(_point_size); + if (GLCAT.is_spam()) { + GLCAT.spam() << "setting thickness to " << thickness << "\n"; + } + + glLineWidth(thickness); #ifndef OPENGLES_2 - glPointSize(_point_size); + glPointSize(thickness); #endif _point_size = thickness; } From 6a782e8c3141cf26dcda14b43f0946ec6fd1f3b7 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 1 Aug 2015 19:13:45 +0200 Subject: [PATCH 095/203] Avoid accidentally getting a non-compat context on Windows Catalyst driver --- panda/src/wgldisplay/wglGraphicsStateGuardian.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx index 236ab57a77..b4b9f5f157 100644 --- a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx +++ b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx @@ -644,8 +644,10 @@ make_context(HDC hdc) { attrib_list[n++] = WGL_CONTEXT_FLAGS_ARB; attrib_list[n++] = WGL_CONTEXT_DEBUG_BIT_ARB; } +#ifndef SUPPORT_FIXED_FUNCTION attrib_list[n++] = WGL_CONTEXT_PROFILE_MASK_ARB; attrib_list[n++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; +#endif attrib_list[n] = NULL; _context = _wglCreateContextAttribsARB(hdc, 0, attrib_list); From de715b5a0eed8e2e78460b30ba76ead3cb0041fd Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 4 Aug 2015 17:48:46 +0200 Subject: [PATCH 096/203] Fix inability for interrogate to parse /*c*//* and /*c*/// --- dtool/src/cppparser/cppPreprocessor.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 52c758acd6..4f6384e89d 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -979,13 +979,14 @@ skip_whitespace(int c) { //////////////////////////////////////////////////////////////////// int CPPPreprocessor:: skip_comment(int c) { - if (c == '/') { + while (c == '/') { int next_c = get(); if (next_c == '*') { _last_cpp_comment = false; c = skip_c_comment(get()); } else if (next_c == '/') { c = skip_cpp_comment(get()); + break; } else { _last_cpp_comment = false; unget(next_c); From 9396f998fb386ab6749fa5d40c4675379e11e764 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Fri, 31 Jul 2015 12:19:08 -0500 Subject: [PATCH 097/203] Avoid crash in p3tinydisplay when there is no initial window --- panda/src/tinydisplay/tinyXGraphicsWindow.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/tinydisplay/tinyXGraphicsWindow.cxx b/panda/src/tinydisplay/tinyXGraphicsWindow.cxx index 99e8e9777e..924ababedb 100644 --- a/panda/src/tinydisplay/tinyXGraphicsWindow.cxx +++ b/panda/src/tinydisplay/tinyXGraphicsWindow.cxx @@ -604,6 +604,10 @@ create_full_frame_buffer() { //////////////////////////////////////////////////////////////////// void TinyXGraphicsWindow:: create_reduced_frame_buffer() { + if (!_full_frame_buffer) { + return; + } + if (_reduced_frame_buffer != NULL) { ZB_close(_reduced_frame_buffer); _reduced_frame_buffer = NULL; From 22d5c2f8dd35eed6c9bc8f1c66fc56f4cc012903 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Mon, 3 Aug 2015 08:11:52 -0500 Subject: [PATCH 098/203] For tinydisplay, don't lose color/alpha scale when lighting --- panda/src/tinydisplay/td_light.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/tinydisplay/td_light.cxx b/panda/src/tinydisplay/td_light.cxx index a7b03a3bc5..c49b47e4b4 100644 --- a/panda/src/tinydisplay/td_light.cxx +++ b/panda/src/tinydisplay/td_light.cxx @@ -127,9 +127,9 @@ void gl_shade_vertex(GLContext *c,GLVertex *v) B+=att * lB; } - v->color.v[0]=clampf(R,0,1); - v->color.v[1]=clampf(G,0,1); - v->color.v[2]=clampf(B,0,1); - v->color.v[3]=A; + v->color.v[0]=clampf(R*v->color.v[0],0,1); + v->color.v[1]=clampf(G*v->color.v[1],0,1); + v->color.v[2]=clampf(B*v->color.v[2],0,1); + v->color.v[3]=clampf(A*v->color.v[3],0,1); } From 29ef15db3f8615cecfcae2ae7667ebfa2f57fc4e Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 14:16:51 +0200 Subject: [PATCH 099/203] Fix symbol visibility issue in p3d_plugin.so --- direct/src/plugin/p3d_plugin.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct/src/plugin/p3d_plugin.h b/direct/src/plugin/p3d_plugin.h index e053e6e21b..418d3c1143 100644 --- a/direct/src/plugin/p3d_plugin.h +++ b/direct/src/plugin/p3d_plugin.h @@ -53,7 +53,11 @@ #endif #else /* _WIN32 */ +#if defined(BUILDING_P3D_PLUGIN) && defined(__GNUC__) +#define EXPCL_P3D_PLUGIN __attribute__((visibility("default"))) +#else #define EXPCL_P3D_PLUGIN +#endif #endif /* _WIN32 */ From d66135f4b8f25ec6bdbf7f7756ad2f6131ccf2f4 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 14:35:12 +0200 Subject: [PATCH 100/203] Add ability to change window icon after window has already opened on Windows --- panda/src/windisplay/winGraphicsWindow.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index a226dcde1b..0146f2f89c 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -284,6 +284,17 @@ set_properties_now(WindowProperties &properties) { properties.clear_title(); } + if (properties.has_icon_filename()) { + HICON icon = get_icon(properties.get_icon_filename()); + if (icon != 0) { + ::SendMessage(_hWnd, WM_SETICON, ICON_SMALL, (LPARAM)icon); + ::SendMessage(_hWnd, WM_SETICON, ICON_BIG, (LPARAM)icon); + + _properties.set_icon_filename(properties.get_icon_filename()); + properties.clear_icon_filename(); + } + } + if (properties.has_cursor_hidden()) { bool hide_cursor = properties.get_cursor_hidden(); _properties.set_cursor_hidden(hide_cursor); From 0e6092004dd327ca1488b3c8dd87892a06e4155d Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 15:47:49 +0200 Subject: [PATCH 101/203] Fix perPlatform bug in pdeploy --- direct/src/p3d/DeploymentTools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 10677cd5d4..5bb3f3a159 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -73,7 +73,7 @@ class Standalone: self.tempDir = Filename.temporary("", self.basename, "") + "/" self.tempDir.makeDir() - self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = appRunner, hostDir = self.tempDir, asMirror = False) + self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = appRunner, hostDir = self.tempDir, asMirror = False, perPlatform = True) self.http = HTTPClient.getGlobalPtr() if not self.host.hasContentsFile: @@ -233,7 +233,7 @@ class PackageTree: if hostUrl in self.hosts: return self.hosts[hostUrl] - host = HostInfo(hostUrl, appRunner = appRunner, hostDir = self.hostDir, asMirror = False) + host = HostInfo(hostUrl, appRunner = appRunner, hostDir = self.hostDir, asMirror = False, perPlatform = True) if not host.hasContentsFile: if not host.readContentsFile(): if not host.downloadContentsFile(self.http): From b50fbe8263ab56212f50759cce84cb8b0f7f0e9a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 15:49:26 +0200 Subject: [PATCH 102/203] Restore old packp3d behavior: main file should be considered relative to -d directory --- direct/src/p3d/packp3d.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/direct/src/p3d/packp3d.py b/direct/src/p3d/packp3d.py index 7dbe3a30b9..3544022fd6 100755 --- a/direct/src/p3d/packp3d.py +++ b/direct/src/p3d/packp3d.py @@ -170,19 +170,20 @@ def makePackedApp(args): appDir = Filename('.') appBase = appFilename.getBasenameWoExtension() - if not main: + if main: + main = Filename.fromOsSpecific(main) + main.makeAbsolute(root) + else: main = Filename(root, 'main.py') - if main.exists(): - main = 'main.py' - else: + if not main.exists(): main = glob.glob(os.path.join(root.toOsSpecific(), '*.py')) if len(main) == 0: raise ArgumentError, 'No Python files in root directory.' elif len(main) > 1: raise ArgumentError, 'Multiple Python files in root directory; specify the main application with -m "main".' - main = os.path.split(main[0])[1] - main = Filename.fromOsSpecific(main) + main = Filename.fromOsSpecific(os.path.split(main[0])[1]) + main.makeAbsolute(root) packager.installDir = appDir packager.allowPythonDev = allowPythonDev From 0c7b65b1fd943ff4314281ab3b35a77376843859 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 15:52:02 +0200 Subject: [PATCH 103/203] Fix issue where packp3d fails if import.xml is refreshed while contents.xml remains old --- direct/src/p3d/AppRunner.py | 2 +- direct/src/p3d/Packager.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/src/p3d/AppRunner.py b/direct/src/p3d/AppRunner.py index b9a1f17572..ff63e5aa8d 100644 --- a/direct/src/p3d/AppRunner.py +++ b/direct/src/p3d/AppRunner.py @@ -471,7 +471,7 @@ class AppRunner(DirectObject): file.unlink() return False - if not fileSpec.fullVerify(pathname = localPathname): + if not fileSpec.fullVerify(pathname = localPathname, notify = self.notify): # No good after download. self.notify.info("%s is still no good after downloading." % (url)) return False diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index d2166ec4f8..84448e23a7 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -3008,10 +3008,10 @@ class Packager: # environment. return None + # Make sure we have a fresh version of the contents file. host = appRunner.getHost(hostUrl) - if not host.readContentsFile(): - if not host.downloadContentsFile(appRunner.http): - return None + if not host.downloadContentsFile(appRunner.http): + return None packageInfos = [] packageInfo = host.getPackage(packageName, version, platform = platform) From b06ff60c10a5bf7a18af5da39321b4ae49d27e9f Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Thu, 6 Aug 2015 09:54:31 -0500 Subject: [PATCH 104/203] Fix DynamicTextFont.makeCopy() implementation --- panda/src/pnmtext/freetypeFont.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/pnmtext/freetypeFont.cxx b/panda/src/pnmtext/freetypeFont.cxx index c2a5d176b1..974787a331 100644 --- a/panda/src/pnmtext/freetypeFont.cxx +++ b/panda/src/pnmtext/freetypeFont.cxx @@ -68,6 +68,7 @@ FreetypeFont(const FreetypeFont ©) : _requested_scale_factor(copy._requested_scale_factor), _scale_factor(copy._scale_factor), _native_antialias(copy._native_antialias), + _font_pixels_per_unit(copy._font_pixels_per_unit), _line_height(copy._line_height), _space_advance(copy._space_advance), _face(copy._face), From f1df65034de12f8e75afe072964a1aada4c6ec79 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 7 Aug 2015 17:29:03 +0200 Subject: [PATCH 105/203] Fix Mac 10.11 compile error --- panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm index 63ee5dc244..01e4624015 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm @@ -210,7 +210,7 @@ choose_pixel_format(const FrameBufferProperties &properties, attribs.push_back(CGDisplayIDToOpenGLDisplayMask(display)); // End of the array - attribs.push_back((NSOpenGLPixelFormatAttribute) nil); + attribs.push_back((NSOpenGLPixelFormatAttribute)0); // Create the format. NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]]; From af8de103af1a34aee7467eed57f4d9f9ecd4cfed Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 7 Aug 2015 17:40:01 +0200 Subject: [PATCH 106/203] Ignore non-required packages rather than erroring if their dependencies were missing --- direct/src/p3d/Packager.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 84448e23a7..36883ceb52 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -372,6 +372,9 @@ class Packager: self.requiredFilenames = [] self.requiredModules = [] + # A list of required packages that were missing. + self.missingPackages = [] + # This records the current list of modules we have added so # far. self.freezer = FreezeTool.Freezer(platform = self.packager.platform) @@ -495,6 +498,12 @@ class Packager: as a true package. Either is implemented with a Multifile. """ + if self.missingPackages: + missing = ', '.join([name for name, version in self.missingPackages]) + self.notify.warning("Cannot build package %s due to missing dependencies: %s" % (self.packageName, missing)) + self.cleanup() + return False + self.multifile = Multifile() # Write the multifile to a temporary filename until we @@ -3217,7 +3226,9 @@ class Packager: requires = self.currentPackage.requires) if not package: message = 'Unknown package %s, version "%s"' % (packageName, version) - raise PackagerError, message + self.notify.warning(message) + self.currentPackage.missingPackages.append((packageName, pversion)) + continue self.requirePackage(package) From 14bd992e77f31baf782fd9063f6b3127e2b74c5d Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 7 Aug 2015 18:45:37 +0200 Subject: [PATCH 107/203] Remove use of deprecated "register" keyword --- panda/src/pnmimagetypes/colrops.c | 20 ++--- panda/src/pnmimagetypes/pnmFileTypePNM.cxx | 24 +++--- panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx | 14 +-- panda/src/tinydisplay/zbuffer.cxx | 2 +- panda/src/tinydisplay/zdither.cxx | 6 +- panda/src/tinydisplay/zline.h | 12 +-- panda/src/tinydisplay/ztriangle.h | 12 +-- panda/src/tinydisplay/ztriangle_two.h | 95 ++++++++++----------- 8 files changed, 92 insertions(+), 93 deletions(-) diff --git a/panda/src/pnmimagetypes/colrops.c b/panda/src/pnmimagetypes/colrops.c index 997c89f8d8..a82bf85399 100644 --- a/panda/src/pnmimagetypes/colrops.c +++ b/panda/src/pnmimagetypes/colrops.c @@ -47,7 +47,7 @@ int setcolrcor(double (*f)(double, double), double a2) /* set brightness correction */ { double mult; - register int i, j; + int i, j; /* allocate tables */ if (g_bval == NULL && (g_bval = (BYTE (*)[256])bmalloc((MAXGSHIFT+1)*256)) == NULL) @@ -67,7 +67,7 @@ int setcolrinv(double (*f)(double, double), double a2) /* set inverse brightness correction */ { double mult; - register int i, j; + int i, j; /* allocate tables */ if (g_mant == NULL && (g_mant = (BYTE *)bmalloc(256)) == NULL) return(-1); @@ -97,10 +97,10 @@ int setcolrgam(double g) /* set gamma conversion */ } -int colrs_gambs(register COLR *scan, int len) +int colrs_gambs(COLR *scan, int len) /* convert scanline of colrs to gamma bytes */ { - register int i, expo; + int i, expo; if (g_bval == NULL) return(-1); @@ -145,10 +145,10 @@ int colrs_gambs(register COLR *scan, int len) } -int gambs_colrs(register COLR *scan, int len) +int gambs_colrs(COLR *scan, int len) /* convert gamma bytes to colr scanline */ { - register int nexpo; + int nexpo; if (g_mant == NULL || g_nexp == NULL) return(-1); @@ -181,7 +181,7 @@ int gambs_colrs(register COLR *scan, int len) void -shiftcolrs(register COLR *scan, register int len, register int adjust) +shiftcolrs(COLR *scan, int len, int adjust) /* shift a scanline of colors by 2^adjust */ { int minexp; @@ -201,11 +201,11 @@ shiftcolrs(register COLR *scan, register int len, register int adjust) void -normcolrs(register COLR *scan, int len, int adjust) +normcolrs(COLR *scan, int len, int adjust) /* normalize a scanline of colrs */ { - register int c; - register int shift; + int c; + int shift; while (len-- > 0) { shift = scan[0][EXP] + adjust - COLXS; diff --git a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx index 8a080fc953..6e800c3372 100644 --- a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx @@ -317,8 +317,8 @@ getbit (istream * const file) { static void pbm_readpbmrow( istream *file, bit *bitrow, int cols, int format ) { - register int col, bitshift; - register bit* bP; + int col, bitshift; + bit* bP; switch ( format ) { @@ -328,7 +328,7 @@ pbm_readpbmrow( istream *file, bit *bitrow, int cols, int format ) { break; case RPBM_FORMAT: { - register unsigned char item; + unsigned char item; bitshift = -1; item = 0; /* item's value is meaningless here */ for ( col = 0, bP = bitrow; col < cols; ++col, ++bP ) { @@ -486,12 +486,12 @@ ppm_readppmrow(istream* const fileP, static void pnm_readpnmrow( istream* file, xel* xelrow, int cols, xelval maxval, int format ) { - register int col; - register xel* xP; + int col; + xel* xP; gray* grayrow; - register gray* gP; + gray* gP; bit* bitrow; - register bit* bP; + bit* bP; switch ( PNM_FORMAT_TYPE(format) ) { @@ -815,8 +815,8 @@ pgm_writepgmrow(ostream* const fileP, static void ppm_writeppmrowraw(ostream *file, pixel *pixelrow, int cols, pixval maxval ) { - register int col; - register pixval val; + int col; + pixval val; for ( col = 0; col < cols; ++col ) { @@ -843,9 +843,9 @@ ppm_writeppmrowraw(ostream *file, pixel *pixelrow, int cols, pixval maxval ) { static void ppm_writeppmrowplain(ostream *file, pixel *pixelrow, int cols, pixval maxval ) { - register int col, charcount; - register pixel* pP; - register pixval val; + int col, charcount; + pixel* pP; + pixval val; charcount = 0; for ( col = 0, pP = pixelrow; col < cols; ++col, ++pP ) diff --git a/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx b/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx index e16b857d61..ab09b1f034 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx @@ -1033,7 +1033,7 @@ write_data(xel *array, xelval *alpha) { grn[TIFF_COLORMAP_MAXCOLORS], blu[TIFF_COLORMAP_MAXCOLORS]; int row, colors, i; - register int col; + int col; int grayscale = false; struct tiff * tif; short photometric = 0; @@ -1064,7 +1064,7 @@ write_data(xel *array, xelval *alpha) { << colors << " colors found; writing an 8-bit palette file.\n"; grayscale = true; for ( i = 0; i < colors; ++i ) { - register xelval r, g, b; + xelval r, g, b; r = PPM_GETR( chv[i].color ); g = PPM_GETG( chv[i].color ); @@ -1203,7 +1203,7 @@ write_data(xel *array, xelval *alpha) { } else { tP = buf; for ( col = 0; col < _x_size; ++col ) { - register int s; + int s; s = ppm_lookupcolor( cht, (pixel *)(&row_data[col]) ); if ( s == -1 ) { @@ -1219,10 +1219,10 @@ write_data(xel *array, xelval *alpha) { } } } else { - register xelval bigger_maxval; - register int bitshift; - register unsigned char byte; - register xelval s; + xelval bigger_maxval; + int bitshift; + unsigned char byte; + xelval s; bigger_maxval = pm_bitstomaxval( bitspersample ); bitshift = 8 - bitspersample; diff --git a/panda/src/tinydisplay/zbuffer.cxx b/panda/src/tinydisplay/zbuffer.cxx index fa5677398d..4623a85353 100644 --- a/panda/src/tinydisplay/zbuffer.cxx +++ b/panda/src/tinydisplay/zbuffer.cxx @@ -358,7 +358,7 @@ memset_l(void *adr, int val, int count) { void memset_RGB24(void *adr,int r, int v, int b,long count) { long i, n; - register long v1,v2,v3,*pt=(long *)(adr); + long v1,v2,v3,*pt=(long *)(adr); unsigned char *p,R=(unsigned char)r,V=(unsigned char)v,B=(unsigned char)b; p=(unsigned char *)adr; diff --git a/panda/src/tinydisplay/zdither.cxx b/panda/src/tinydisplay/zdither.cxx index a2ae2838e9..37e826e1e8 100644 --- a/panda/src/tinydisplay/zdither.cxx +++ b/panda/src/tinydisplay/zdither.cxx @@ -89,7 +89,7 @@ ZDither_lookupColor(int r,int g,int b) { #define DITHER_PIXEL2(a) \ { \ - register int v,t,r,g,c; \ + int v,t,r,g,c; \ v=*(unsigned int *)(pp+(a)); \ g=(v & 0x07DF07DF) + g_d; \ r=(((v & 0xF800F800) >> 2) + r_d) & 0x70007000; \ @@ -110,8 +110,8 @@ ZB_ditherFrameBuffer(ZBuffer *zb,unsigned char *buf, unsigned short *pp1; int r_d,g_d,b_d; unsigned char *ctable=zb->dctable; - register unsigned char *dest; - register unsigned short *pp; + unsigned char *dest; + unsigned short *pp; assert( ((long)buf & 1) == 0 && (linesize & 1) == 0); diff --git a/panda/src/tinydisplay/zline.h b/panda/src/tinydisplay/zline.h index 8e162d54a4..b5a3284d59 100644 --- a/panda/src/tinydisplay/zline.h +++ b/panda/src/tinydisplay/zline.h @@ -1,17 +1,17 @@ { int n, dx, dy, sx, pp_inc_1, pp_inc_2; - register int a; - register PIXEL *pp; + int a; + PIXEL *pp; #if defined(INTERP_RGB) - register unsigned int r, g, b; + unsigned int r, g, b; #endif #ifdef INTERP_RGB - register unsigned int rinc, ginc, binc; + unsigned int rinc, ginc, binc; #endif #ifdef INTERP_Z - register ZPOINT *pz; + ZPOINT *pz; int zinc; - register int z, zz; + int z, zz; #endif if (p1->y > p2->y || (p1->y == p2->y && p1->x > p2->x)) { diff --git a/panda/src/tinydisplay/ztriangle.h b/panda/src/tinydisplay/ztriangle.h index 2c3e5c1d1f..c8fdfc4c53 100644 --- a/panda/src/tinydisplay/ztriangle.h +++ b/panda/src/tinydisplay/ztriangle.h @@ -344,17 +344,17 @@ #ifndef DRAW_LINE /* generic draw line */ { - register PIXEL *pp; - register int n; + PIXEL *pp; + int n; #ifdef INTERP_Z - register ZPOINT *pz; - register unsigned int z,zz; + ZPOINT *pz; + unsigned int z,zz; #endif #ifdef INTERP_RGB - register unsigned int or1,og1,ob1,oa1; + unsigned int or1,og1,ob1,oa1; #endif #ifdef INTERP_ST - register unsigned int s,t; + unsigned int s,t; #endif #ifdef INTERP_STZ PN_stdfloat sz,tz; diff --git a/panda/src/tinydisplay/ztriangle_two.h b/panda/src/tinydisplay/ztriangle_two.h index eade11cceb..d1c5a56916 100644 --- a/panda/src/tinydisplay/ztriangle_two.h +++ b/panda/src/tinydisplay/ztriangle_two.h @@ -326,13 +326,13 @@ FNAME(white_perspective) (ZBuffer *zb, #define DRAW_LINE() \ { \ - register ZPOINT *pz; \ - register PIXEL *pp; \ - register int s,t,z,zz; \ - register int n,dsdx,dtdx; \ - PN_stdfloat sz,tz,fz,zinv; \ + ZPOINT *pz; \ + PIXEL *pp; \ + int s,t,z,zz; \ + int n,dsdx,dtdx; \ + PN_stdfloat sz,tz,fz,zinv; \ n=(x2>>16)-x1; \ - fz=(PN_stdfloat)z1; \ + fz=(PN_stdfloat)z1; \ zinv=1.0f / fz; \ pp=(PIXEL *)((char *)pp1 + x1 * PSZB); \ pz=pz1+x1; \ @@ -341,7 +341,7 @@ FNAME(white_perspective) (ZBuffer *zb, tz=tz1; \ while (n>=(NB_INTERP-1)) { \ { \ - PN_stdfloat ss,tt; \ + PN_stdfloat ss,tt; \ ss=(sz * zinv); \ tt=(tz * zinv); \ s=(int) ss; \ @@ -452,14 +452,14 @@ FNAME(flat_perspective) (ZBuffer *zb, #define DRAW_LINE() \ { \ - register ZPOINT *pz; \ - register PIXEL *pp; \ - register int s,t,z,zz; \ - register int n,dsdx,dtdx; \ - register int or1,og1,ob1,oa1; \ - PN_stdfloat sz,tz,fz,zinv; \ + ZPOINT *pz; \ + PIXEL *pp; \ + int s,t,z,zz; \ + int n,dsdx,dtdx; \ + int or1,og1,ob1,oa1; \ + PN_stdfloat sz,tz,fz,zinv; \ n=(x2>>16)-x1; \ - fz=(PN_stdfloat)z1; \ + fz=(PN_stdfloat)z1; \ zinv=1.0f / fz; \ pp=(PIXEL *)((char *)pp1 + x1 * PSZB); \ pz=pz1+x1; \ @@ -472,7 +472,7 @@ FNAME(flat_perspective) (ZBuffer *zb, oa1 = a1; \ while (n>=(NB_INTERP-1)) { \ { \ - PN_stdfloat ss,tt; \ + PN_stdfloat ss,tt; \ ss=(sz * zinv); \ tt=(tz * zinv); \ s=(int) ss; \ @@ -592,14 +592,14 @@ FNAME(smooth_perspective) (ZBuffer *zb, #define DRAW_LINE() \ { \ - register ZPOINT *pz; \ - register PIXEL *pp; \ - register int s,t,z,zz; \ - register int n,dsdx,dtdx; \ - register int or1,og1,ob1,oa1; \ - PN_stdfloat sz,tz,fz,zinv; \ + ZPOINT *pz; \ + PIXEL *pp; \ + int s,t,z,zz; \ + int n,dsdx,dtdx; \ + int or1,og1,ob1,oa1; \ + PN_stdfloat sz,tz,fz,zinv; \ n=(x2>>16)-x1; \ - fz=(PN_stdfloat)z1; \ + fz=(PN_stdfloat)z1; \ zinv=1.0f / fz; \ pp=(PIXEL *)((char *)pp1 + x1 * PSZB); \ pz=pz1+x1; \ @@ -612,7 +612,7 @@ FNAME(smooth_perspective) (ZBuffer *zb, oa1 = a1; \ while (n>=(NB_INTERP-1)) { \ { \ - PN_stdfloat ss,tt; \ + PN_stdfloat ss,tt; \ ss=(sz * zinv); \ tt=(tz * zinv); \ s=(int) ss; \ @@ -723,14 +723,14 @@ FNAME(smooth_multitex2) (ZBuffer *zb, #define DRAW_LINE() \ { \ - register ZPOINT *pz; \ - register PIXEL *pp; \ - register int s,t,sa,ta,z,zz; \ - register int n,dsdx,dtdx,dsadx,dtadx; \ - register int or1,og1,ob1,oa1; \ - PN_stdfloat sz,tz,sza,tza,fz,zinv; \ + ZPOINT *pz; \ + PIXEL *pp; \ + int s,t,sa,ta,z,zz; \ + int n,dsdx,dtdx,dsadx,dtadx; \ + int or1,og1,ob1,oa1; \ + PN_stdfloat sz,tz,sza,tza,fz,zinv; \ n=(x2>>16)-x1; \ - fz=(PN_stdfloat)z1; \ + fz=(PN_stdfloat)z1; \ zinv=1.0f / fz; \ pp=(PIXEL *)((char *)pp1 + x1 * PSZB); \ pz=pz1+x1; \ @@ -745,7 +745,7 @@ FNAME(smooth_multitex2) (ZBuffer *zb, oa1 = a1; \ while (n>=(NB_INTERP-1)) { \ { \ - PN_stdfloat ss,tt; \ + PN_stdfloat ss,tt; \ ss=(sz * zinv); \ tt=(tz * zinv); \ s=(int) ss; \ @@ -755,7 +755,7 @@ FNAME(smooth_multitex2) (ZBuffer *zb, CALC_MIPMAP_LEVEL(mipmap_level, mipmap_dx, dsdx, dtdx); \ } \ { \ - PN_stdfloat ssa,tta; \ + PN_stdfloat ssa,tta; \ ssa=(sza * zinv); \ tta=(tza * zinv); \ sa=(int) ssa; \ @@ -783,7 +783,7 @@ FNAME(smooth_multitex2) (ZBuffer *zb, tza+=ndtzadx; \ } \ { \ - PN_stdfloat ss,tt; \ + PN_stdfloat ss,tt; \ ss=(sz * zinv); \ tt=(tz * zinv); \ s=(int) ss; \ @@ -793,7 +793,7 @@ FNAME(smooth_multitex2) (ZBuffer *zb, CALC_MIPMAP_LEVEL(mipmap_level, mipmap_dx, dsdx, dtdx); \ } \ { \ - PN_stdfloat ssa,tta; \ + PN_stdfloat ssa,tta; \ ssa=(sza * zinv); \ tta=(tza * zinv); \ sa=(int) ssa; \ @@ -884,14 +884,14 @@ FNAME(smooth_multitex3) (ZBuffer *zb, #define DRAW_LINE() \ { \ - register ZPOINT *pz; \ - register PIXEL *pp; \ - register int s,t,sa,ta,sb,tb,z,zz; \ - register int n,dsdx,dtdx,dsadx,dtadx,dsbdx,dtbdx; \ - register int or1,og1,ob1,oa1; \ - PN_stdfloat sz,tz,sza,tza,szb,tzb,fz,zinv; \ + ZPOINT *pz; \ + PIXEL *pp; \ + int s,t,sa,ta,sb,tb,z,zz; \ + int n,dsdx,dtdx,dsadx,dtadx,dsbdx,dtbdx; \ + int or1,og1,ob1,oa1; \ + PN_stdfloat sz,tz,sza,tza,szb,tzb,fz,zinv; \ n=(x2>>16)-x1; \ - fz=(PN_stdfloat)z1; \ + fz=(PN_stdfloat)z1; \ zinv=1.0f / fz; \ pp=(PIXEL *)((char *)pp1 + x1 * PSZB); \ pz=pz1+x1; \ @@ -908,7 +908,7 @@ FNAME(smooth_multitex3) (ZBuffer *zb, oa1 = a1; \ while (n>=(NB_INTERP-1)) { \ { \ - PN_stdfloat ss,tt; \ + PN_stdfloat ss,tt; \ ss=(sz * zinv); \ tt=(tz * zinv); \ s=(int) ss; \ @@ -918,7 +918,7 @@ FNAME(smooth_multitex3) (ZBuffer *zb, CALC_MIPMAP_LEVEL(mipmap_level, mipmap_dx, dsdx, dtdx); \ } \ { \ - PN_stdfloat ssa,tta; \ + PN_stdfloat ssa,tta; \ ssa=(sza * zinv); \ tta=(tza * zinv); \ sa=(int) ssa; \ @@ -928,7 +928,7 @@ FNAME(smooth_multitex3) (ZBuffer *zb, CALC_MIPMAP_LEVEL(mipmap_levela, mipmap_dxa, dsadx, dtadx); \ } \ { \ - PN_stdfloat ssb,ttb; \ + PN_stdfloat ssb,ttb; \ ssb=(szb * zinv); \ ttb=(tzb * zinv); \ sb=(int) ssb; \ @@ -958,7 +958,7 @@ FNAME(smooth_multitex3) (ZBuffer *zb, tzb+=ndtzbdx; \ } \ { \ - PN_stdfloat ss,tt; \ + PN_stdfloat ss,tt; \ ss=(sz * zinv); \ tt=(tz * zinv); \ s=(int) ss; \ @@ -968,7 +968,7 @@ FNAME(smooth_multitex3) (ZBuffer *zb, CALC_MIPMAP_LEVEL(mipmap_level, mipmap_dx, dsdx, dtdx); \ } \ { \ - PN_stdfloat ssa,tta; \ + PN_stdfloat ssa,tta; \ ssa=(sza * zinv); \ tta=(tza * zinv); \ sa=(int) ssa; \ @@ -978,7 +978,7 @@ FNAME(smooth_multitex3) (ZBuffer *zb, CALC_MIPMAP_LEVEL(mipmap_levela, mipmap_dxa, dsadx, dtadx); \ } \ { \ - PN_stdfloat ssb,ttb; \ + PN_stdfloat ssb,ttb; \ ssb=(szb * zinv); \ ttb=(tzb * zinv); \ sb=(int) ssb; \ @@ -1008,4 +1008,3 @@ FNAME(smooth_multitex3) (ZBuffer *zb, #undef INTERP_MIPMAP #undef CALC_MIPMAP_LEVEL #undef ZB_LOOKUP_TEXTURE - From c41a4120bcbe7ecf04430ca6a215b97c573c2d23 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 7 Aug 2015 21:41:15 +0200 Subject: [PATCH 108/203] Fix OSX compile error due to Apple's broken glext.h --- panda/src/glstuff/glGraphicsStateGuardian_src.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index d83b585941..5272dfb771 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -222,6 +222,8 @@ typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTPROC) (GLuint64 handle); typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64PROC) (GLuint index, GLuint64EXT x); typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VPROC) (GLuint index, const GLuint64EXT *v); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); #endif // OPENGLES #endif // __EDG__ From 81801654a2941303d2e7c07a0a3490d75b77b039 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 8 Aug 2015 12:43:58 +0200 Subject: [PATCH 109/203] Fix finding extension modules ending in "module.so" with the VFS importer --- direct/src/showbase/VFSImporter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index 6f8c76266f..31dd83523b 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -76,8 +76,7 @@ class VFSImporter: if desc[2] != imp.C_EXTENSION: continue - filename = Filename(path) - filename.setExtension(desc[0][1:]) + filename = Filename(path + desc[0]) vfile = vfs.getFile(filename, True) if vfile: return VFSLoader(dir_path, vfile, filename, FTExtensionModule, From 74190f9e5019f0e90f5f64f5e4d769fa23f81ced Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 8 Aug 2015 20:49:51 +0200 Subject: [PATCH 110/203] Work towards supporting Python 3 in the rtdist --- direct/src/p3d/Packager.py | 30 +++---- direct/src/p3d/coreapi.pdef | 2 +- direct/src/p3d/ppackage.py | 14 ++-- direct/src/plugin/p3dPythonRun.cxx | 64 ++++++++++++++- direct/src/plugin/p3dPythonRun.h | 9 ++- direct/src/showutil/FreezeTool.py | 13 +-- makepanda/makepanda.py | 2 + panda/src/downloader/stringStream.h | 24 ++++-- panda/src/downloader/stringStream_ext.cxx | 99 +++++++++++++++++++++++ panda/src/downloader/stringStream_ext.h | 43 ++++++++++ 10 files changed, 262 insertions(+), 38 deletions(-) create mode 100644 panda/src/downloader/stringStream_ext.cxx create mode 100644 panda/src/downloader/stringStream_ext.h diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 813fefa0b2..16ebdabbff 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -467,7 +467,7 @@ class Packager: if self.p3dApplication: allowPythonDev = self.configs.get('allow_python_dev', 0) if int(allowPythonDev): - print "\n*** Generating %s.p3d with allow_python_dev enabled ***\n" % (self.packageName) + print("\n*** Generating %s.p3d with allow_python_dev enabled ***\n" % (self.packageName)) return result @@ -721,7 +721,7 @@ class Packager: self.packageDesc = packageDir + self.packageDesc self.packageImportDesc = packageDir + self.packageImportDesc - print "Generating %s" % (self.packageFilename) + print("Generating %s" % (self.packageFilename)) if self.p3dApplication: self.packageFullpath = Filename(self.packager.p3dInstallDir, self.packageFilename) @@ -1251,13 +1251,13 @@ class Packager: elf.close() return None - if not ident.startswith("\177ELF"): + if not ident.startswith(b"\177ELF"): # No elf magic! Beware of orcs. return None # Make sure we read in the correct endianness and integer size - byteOrder = "<>"[ord(ident[5]) - 1] - elfClass = ord(ident[4]) - 1 # 0 = 32-bits, 1 = 64-bits + byteOrder = "<>"[ord(ident[5:6]) - 1] + elfClass = ord(ident[4:5]) - 1 # 0 = 32-bits, 1 = 64-bits headerStruct = byteOrder + ("HHIIIIIHHHHHH", "HHIQQQIHHHHHH")[elfClass] sectionStruct = byteOrder + ("4xI8xIII8xI", "4xI16xQQI12xQ")[elfClass] dynamicStruct = byteOrder + ("iI", "qQ")[elfClass] @@ -1291,17 +1291,17 @@ class Packager: elf.seek(offset) data = elf.read(entsize) tag, val = struct.unpack_from(dynamicStruct, data) - newSectionData = "" + newSectionData = b"" startReplace = None pad = 0 # Read tags until we find a NULL tag. while tag != 0: if tag == 1: # A NEEDED entry. Read it from the string table. - filenames.append(stringTables[link][val : stringTables[link].find('\0', val)]) + filenames.append(stringTables[link][val : stringTables[link].find(b'\0', val)]) elif tag == 15 or tag == 29: - rpath += stringTables[link][val : stringTables[link].find('\0', val)].split(':') + rpath += stringTables[link][val : stringTables[link].find(b'\0', val)].split(b':') # An RPATH or RUNPATH entry. if not startReplace: startReplace = elf.tell() - entsize @@ -1315,7 +1315,7 @@ class Packager: tag, val = struct.unpack_from(dynamicStruct, data) if startReplace is not None: - newSectionData += data + ("\0" * pad) + newSectionData += data + (b"\0" * pad) rewriteSections.append((startReplace, newSectionData)) elf.close() @@ -1348,7 +1348,7 @@ class Packager: for offset, data in rewriteSections: elf.seek(offset) elf.write(data) - elf.write("\0" * pad) + elf.write(b"\0" * pad) elf.close() return filenames @@ -2486,7 +2486,7 @@ class Packager: if not os.path.isfile('/sbin/ldconfig'): return False - handle = subprocess.Popen(['/sbin/ldconfig', '-p'], stdout=subprocess.PIPE) + handle = subprocess.Popen(['/sbin/ldconfig', '-p'], stdout=subprocess.PIPE, universal_newlines=True) out, err = handle.communicate() if handle.returncode != 0: @@ -3069,7 +3069,7 @@ class Packager: tuples = [] for package in packages: version = self.__makeVersionTuple(package.version) - tuples.append((version, file)) + tuples.append((version, package)) tuples.sort(reverse = True) return [t[1] for t in tuples] @@ -3082,7 +3082,7 @@ class Packager: tuples = [] for package in packages: version = self.__makeVersionTuple(package.packageVersion) - tuples.append((version, file)) + tuples.append((version, package)) tuples.sort(reverse = True) return [t[1] for t in tuples] @@ -3141,9 +3141,9 @@ class Packager: if panda1.version == panda2.version: return True - print 'Rejecting package %s, version "%s": depends on %s, version "%s" instead of version "%s"' % ( + print('Rejecting package %s, version "%s": depends on %s, version "%s" instead of version "%s"' % ( package.packageName, package.version, - panda1.packageName, panda1.version, panda2.version) + panda1.packageName, panda1.version, panda2.version)) return False def __findPackageInRequires(self, packageName, list): diff --git a/direct/src/p3d/coreapi.pdef b/direct/src/p3d/coreapi.pdef index bf066e5d51..03612be605 100644 --- a/direct/src/p3d/coreapi.pdef +++ b/direct/src/p3d/coreapi.pdef @@ -66,7 +66,7 @@ class images(package): token = '%s_img' % (name) configDict[token] = basename else: - print "Could not locate %s" % (filename) + print("Could not locate %s" % (filename)) # Also make a few special cases. We use the same default image # for many of the states. diff --git a/direct/src/p3d/ppackage.py b/direct/src/p3d/ppackage.py index dc00bdc567..4cb02eae80 100755 --- a/direct/src/p3d/ppackage.py +++ b/direct/src/p3d/ppackage.py @@ -139,12 +139,12 @@ from direct.p3d import Packager from panda3d.core import * def usage(code, msg = ''): - print >> sys.stderr, usageText % { + sys.stderr.write(usageText % { 'version' : PandaSystem.getPackageVersionString(), 'host' : PandaSystem.getPackageHostUrl(), 'prog' : os.path.split(sys.argv[0])[1] - } - print >> sys.stderr, msg + }) + sys.stderr.write(msg + '\n') sys.exit(code) installDir = None @@ -161,7 +161,7 @@ platforms = [] try: opts, args = getopt.getopt(sys.argv[1:], 'i:ps:S:DuP:R:Ha:hv') -except getopt.error, msg: +except getopt.error as msg: usage(1, msg) for opt, arg in opts: @@ -199,7 +199,7 @@ for opt, arg in opts: elif opt == '-h': usage(0) else: - print 'illegal option: ' + arg + print('illegal option: ' + arg) sys.exit(1) if not args: @@ -220,7 +220,7 @@ else: if universalBinaries: if platforms: - print '\nYou may not specify both -u and -P.\n' + print('\nYou may not specify both -u and -P.\n') sys.exit(1) if PandaSystem.getPlatform().startswith('osx_'): platforms = ['osx_i386', 'osx_amd64'] @@ -251,7 +251,7 @@ for platform in platforms: except Packager.PackagerError: # Just print the error message and exit gracefully. inst = sys.exc_info()[1] - print inst.args[0] + print(inst.args[0]) sys.exit(1) # An explicit call to exit() is required to exit the program, when diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index e3be05bfc8..88a7131470 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -54,16 +54,26 @@ P3DPythonRun(const char *program_name, const char *archive_file, _interactive_console = interactive_console; if (program_name != NULL) { +#if PY_MAJOR_VERSION >= 3 + // Python 3 case: we have to convert it to a wstring. + TextEncoder enc; + enc.set_text(program_name); + _program_name = enc.get_wtext(); +#else + // Python 2 is happy with a regular string. _program_name = program_name; +#endif } if (archive_file != NULL) { _archive_file = Filename::from_os_specific(archive_file); } _py_argc = 1; - _py_argv = (char **)malloc(2 * sizeof(char *)); - +#if PY_MAJOR_VERSION >= 3 + _py_argv[0] = (wchar_t *)_program_name.c_str(); +#else _py_argv[0] = (char *)_program_name.c_str(); +#endif _py_argv[1] = NULL; #ifdef NDEBUG @@ -78,7 +88,11 @@ P3DPythonRun(const char *program_name, const char *archive_file, // Initialize Python. It appears to be important to do this before // we open the pipe streams and spawn the thread, below. +#if PY_MAJOR_VERSION >= 3 + Py_SetProgramName((wchar_t *)_program_name.c_str()); +#else Py_SetProgramName((char *)_program_name.c_str()); +#endif Py_Initialize(); PyEval_InitThreads(); PySys_SetArgv(_py_argc, _py_argv); @@ -290,7 +304,20 @@ run_python() { "Send an asynchronous request to the plugin host" }, { NULL, NULL, 0, NULL } /* Sentinel */ }; + +#if PY_MAJOR_VERSION >= 3 + static PyModuleDef p3dpython_module = { + PyModuleDef_HEAD_INIT, + "p3dpython", + NULL, + -1, + p3dpython_methods, + NULL, NULL, NULL, NULL + }; + PyObject *p3dpython = PyModule_Create(&p3dpython_module); +#else PyObject *p3dpython = Py_InitModule("p3dpython", p3dpython_methods); +#endif if (p3dpython == NULL) { PyErr_Print(); return false; @@ -644,8 +671,11 @@ handle_pyobj_command(TiXmlElement *xcommand, bool needs_response, result = PyBool_FromLong(PyObject_IsTrue(obj)); } else if (strcmp(method_name, "__int__") == 0) { +#if PY_MAJOR_VERSION >= 3 + result = PyNumber_Long(obj); +#else result = PyNumber_Int(obj); - +#endif } else if (strcmp(method_name, "__float__") == 0) { result = PyNumber_Float(obj); @@ -1510,10 +1540,12 @@ pyobj_to_xml(PyObject *value) { xvalue->SetAttribute("type", "bool"); xvalue->SetAttribute("value", PyObject_IsTrue(value)); +#if PY_MAJOR_VERSION < 3 } else if (PyInt_Check(value)) { // A plain integer value. xvalue->SetAttribute("type", "int"); xvalue->SetAttribute("value", PyInt_AsLong(value)); +#endif } else if (PyLong_Check(value)) { // A long integer value. This gets converted either as an integer @@ -1535,9 +1567,21 @@ pyobj_to_xml(PyObject *value) { xvalue->SetAttribute("type", "float"); xvalue->SetDoubleAttribute("value", PyFloat_AsDouble(value)); + } else if (PyUnicode_Check(value)) { // A unicode value. Convert to utf-8 for the XML encoding. xvalue->SetAttribute("type", "string"); + +#if PY_MAJOR_VERSION >= 3 + // In Python 3, there are only unicode strings, and there is a + // handy function for getting the UTF-8 encoded version. + Py_ssize_t length = 0; + char *buffer = PyUnicode_AsUTF8AndSize(value, &length); + if (buffer != NULL) { + string str(buffer, length); + xvalue->SetAttribute("value", str); + } +#else PyObject *as_str = PyUnicode_AsUTF8String(value); if (as_str != NULL) { char *buffer; @@ -1571,6 +1615,7 @@ pyobj_to_xml(PyObject *value) { } Py_DECREF(ustr); } +#endif // PY_MAJOR_VERSION } else if (PyTuple_Check(value)) { // An immutable sequence. Pass it as a concrete. @@ -1609,7 +1654,11 @@ pyobj_to_xml(PyObject *value) { PyObject *as_str; if (PyUnicode_Check(a)) { // The key is a unicode value. +#if PY_MAJOR_VERSION >= 3 + as_str = a; +#else as_str = PyUnicode_AsUTF8String(a); +#endif } else { // The key is a string value or something else. Make it // a string. @@ -1617,7 +1666,12 @@ pyobj_to_xml(PyObject *value) { } char *buffer; Py_ssize_t length; +#if PY_MAJOR_VERSION >= 3 + buffer = PyUnicode_AsUTF8AndSize(as_str, &length); + if (buffer != NULL) { +#else if (PyString_AsStringAndSize(as_str, &buffer, &length) != -1) { +#endif string str(buffer, length); xitem->SetAttribute("key", str); } @@ -1702,7 +1756,11 @@ xml_to_pyobj(TiXmlElement *xvalue) { } else if (strcmp(type, "int") == 0) { int value; if (xvalue->QueryIntAttribute("value", &value) == TIXML_SUCCESS) { +#if PY_MAJOR_VERSION >= 3 + return PyLong_FromLong(value); +#else return PyInt_FromLong(value); +#endif } } else if (strcmp(type, "float") == 0) { diff --git a/direct/src/plugin/p3dPythonRun.h b/direct/src/plugin/p3dPythonRun.h index 1f52c5eeb1..974b27684e 100644 --- a/direct/src/plugin/p3dPythonRun.h +++ b/direct/src/plugin/p3dPythonRun.h @@ -159,10 +159,15 @@ private: int _session_id; - string _program_name; Filename _archive_file; int _py_argc; - char **_py_argv; +#if PY_MAJOR_VERSION >= 3 + wchar_t *_py_argv[2]; + wstring _program_name; +#else + char *_py_argv[2]; + string _program_name; +#endif bool _interactive_console; PyObject *_runner; diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 781caf9588..871cf403a2 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -8,7 +8,7 @@ import marshal import imp import platform import types -from distutils.sysconfig import PREFIX, get_python_inc, get_python_version +from distutils.sysconfig import PREFIX, get_python_inc, get_python_version, get_config_var # Temporary (?) try..except to protect against unbuilt p3extend_frozen. try: @@ -63,7 +63,7 @@ class CompilationEnvironment: # Paths to Python stuff. self.Python = None self.PythonIPath = get_python_inc() - self.PythonVersion = get_python_version() + self.PythonVersion = get_config_var("LDVERSION") or get_python_version() # The VC directory of Microsoft Visual Studio (if relevant) self.MSVC = None @@ -970,7 +970,7 @@ class Freezer: stuff = ("", "rb", imp.PY_COMPILED) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) else: - fp = open(pathname, modulefinder.READ_MODE) + fp = open(pathname, 'U') stuff = ("", "r", imp.PY_SOURCE) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) @@ -1062,7 +1062,7 @@ class Freezer: def __addPyc(self, multifile, filename, code, compressionLevel): if code: - data = imp.get_magic() + '\0\0\0\0' + \ + data = imp.get_magic() + b'\0\0\0\0' + \ marshal.dumps(code) stream = StringStream(data) @@ -1341,7 +1341,10 @@ class Freezer: for i in range(0, len(code), 16): result += '\n ' for c in code[i:i+16]: - result += ('%d,' % ord(c)) + if isinstance(c, int): # Python 3 + result += ('%d,' % c) + else: # Python 2 + result += ('%d,' % ord(c)) result += '\n};\n' return result diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 30de3f1552..28acd9b1f8 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -3271,6 +3271,7 @@ IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cx TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES) TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader']) TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"]) +TargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx') # # DIRECTORY: panda/metalibs/pandaexpress/ @@ -3905,6 +3906,7 @@ if (not RUNTIME): TargetAdd('core_module.obj', opts=['IMOD:panda3d._core', 'ILIB:_core']) TargetAdd('_core.pyd', input='libp3downloader_igate.obj') + TargetAdd('_core.pyd', input='p3downloader_stringStream_ext.obj') TargetAdd('_core.pyd', input='p3express_ext_composite.obj') TargetAdd('_core.pyd', input='libp3express_igate.obj') diff --git a/panda/src/downloader/stringStream.h b/panda/src/downloader/stringStream.h index d90314c46e..fd3f2ad6bc 100644 --- a/panda/src/downloader/stringStream.h +++ b/panda/src/downloader/stringStream.h @@ -17,29 +17,43 @@ #include "pandabase.h" #include "stringStreamBuf.h" +#include "extension.h" //////////////////////////////////////////////////////////////////// // Class : StringStream // Description : A bi-directional stream object that reads and writes // data to an internal buffer, which can be retrieved -// and/or set as a string. +// and/or set as a string in Python 2 or a bytes object +// in Python 3. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS StringStream : public iostream { -PUBLISHED: - INLINE StringStream(); +public: INLINE StringStream(const string &source); +PUBLISHED: + EXTENSION(StringStream(PyObject *source)); + INLINE StringStream(); + INLINE void clear_data(); INLINE size_t get_data_size(); - INLINE string get_data(); - INLINE void set_data(const string &data); + EXTENSION(PyObject *get_data()); + EXTENSION(void set_data(PyObject *data)); + + MAKE_PROPERTY(data, get_data, set_data); public: +#ifndef CPPPARSER + INLINE string get_data(); + INLINE void set_data(const string &data); +#endif + INLINE void swap_data(pvector &data); private: StringStreamBuf _buf; + + friend class Extension; }; #include "stringStream.I" diff --git a/panda/src/downloader/stringStream_ext.cxx b/panda/src/downloader/stringStream_ext.cxx new file mode 100644 index 0000000000..84343420a2 --- /dev/null +++ b/panda/src/downloader/stringStream_ext.cxx @@ -0,0 +1,99 @@ +// Filename: stringStream_ext.cxx +// Created by: rdb (09Dec13) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "stringStream_ext.h" + +#ifdef HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: StringStream::__init__ +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +void Extension:: +__init__(PyObject *source) { + set_data(source); +} + +//////////////////////////////////////////////////////////////////// +// Function: StringStream::get_data +// Access: Published +// Description: Returns the contents of the data stream as a string. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +get_data() { + _this->flush(); + const pvector &data = _this->_buf.get_data(); + if (!data.empty()) { +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromStringAndSize((char *)&data[0], data.size()); +#else + return PyString_FromStringAndSize((char *)&data[0], data.size()); +#endif + } +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromStringAndSize("", 0); +#else + return PyString_FromStringAndSize("", 0); +#endif +} + +//////////////////////////////////////////////////////////////////// +// Function: StringStream::set_data +// Access: Published +// Description: Replaces the contents of the data stream. This +// implicitly reseeks to 0. +//////////////////////////////////////////////////////////////////// +void Extension:: +set_data(PyObject *data) { + _this->_buf.clear(); + + if (data == NULL) { + return; + } + +#if PY_VERSION_HEX >= 0x02060000 + if (PyObject_CheckBuffer(data)) { + Py_buffer view; + if (PyObject_GetBuffer(data, &view, PyBUF_CONTIG_RO) == -1) { + PyErr_SetString(PyExc_TypeError, + "StringStream requires a contiguous buffer"); + return; + } + pvector pv; + pv.insert(pv.end(), (const unsigned char *)view.buf, (const unsigned char *)view.buf + view.len); + _this->_buf.swap_data(pv); + PyBuffer_Release(&view); + return; + } +#endif + +#if PY_MAJOR_VERSION < 3 + if (PyString_Check(data)) { + char *buffer; + Py_ssize_t length; + if (PyString_AsStringAndSize(data, &buffer, &length) != -1) { + pvector pv; + pv.insert(pv.end(), (const unsigned char *)buffer, (const unsigned char *)buffer + length); + _this->_buf.swap_data(pv); + } + return; + } +#endif + + PyErr_SetString(PyExc_TypeError, + "StringStream requires a bytes or buffer object"); +} + +#endif diff --git a/panda/src/downloader/stringStream_ext.h b/panda/src/downloader/stringStream_ext.h new file mode 100644 index 0000000000..200a9c25c9 --- /dev/null +++ b/panda/src/downloader/stringStream_ext.h @@ -0,0 +1,43 @@ +// Filename: stringStream_ext.h +// Created by: rdb (06Aug15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef STRINGSTREAM_EXT_H +#define STRINGSTREAM_EXT_H + +#include "dtoolbase.h" + +#ifdef HAVE_PYTHON + +#include "extension.h" +#include "stringStream.h" +#include "py_panda.h" + +//////////////////////////////////////////////////////////////////// +// Class : Extension +// Description : This class defines the extension methods for +// StringStream, which are called instead of +// any C++ methods with the same prototype. +//////////////////////////////////////////////////////////////////// +template<> +class Extension : public ExtensionBase { +public: + void __init__(PyObject *source); + + PyObject *get_data(); + void set_data(PyObject *data); +}; + +#endif // HAVE_PYTHON + +#endif // STRINGSTREAM_EXT_H From bff070430efc1f2bf2a9dcfc5128322fcf9fa6b6 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 8 Aug 2015 20:52:47 +0200 Subject: [PATCH 111/203] Fix some aliasing warnings --- direct/src/directbase/ppython.cxx | 2 +- panda/src/gobj/geomPrimitive.cxx | 4 ++-- panda/src/gobj/geomPrimitive.h | 2 +- panda/src/gobj/shader.I | 4 ++-- panda/src/gobj/shader.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/direct/src/directbase/ppython.cxx b/direct/src/directbase/ppython.cxx index 4d673d96b6..65f1272c8a 100644 --- a/direct/src/directbase/ppython.cxx +++ b/direct/src/directbase/ppython.cxx @@ -36,7 +36,7 @@ int main(int argc, char *mb_argv[]) { size_t len = mbstowcs(NULL, mb_argv[i], 0); argv[i] = new wchar_t[len + 1]; mbstowcs(argv[i], mb_argv[i], len); - argv[i][len] = NULL; + argv[i][len] = 0; } // Just for good measure argv[argc] = NULL; diff --git a/panda/src/gobj/geomPrimitive.cxx b/panda/src/gobj/geomPrimitive.cxx index 80408a18c5..797ea9e1c8 100644 --- a/panda/src/gobj/geomPrimitive.cxx +++ b/panda/src/gobj/geomPrimitive.cxx @@ -1398,9 +1398,9 @@ modify_ends() { // you do, be sure you know what you are doing! //////////////////////////////////////////////////////////////////// void GeomPrimitive:: -set_ends(CPTA_int ends) { +set_ends(PTA_int ends) { CDWriter cdata(_cycler, true); - cdata->_ends = (PTA_int &)ends; + cdata->_ends = ends; cdata->_modified = Geom::get_next_modified(); cdata->_got_minmax = false; diff --git a/panda/src/gobj/geomPrimitive.h b/panda/src/gobj/geomPrimitive.h index da787edad7..d2a2f4cbd1 100644 --- a/panda/src/gobj/geomPrimitive.h +++ b/panda/src/gobj/geomPrimitive.h @@ -169,7 +169,7 @@ PUBLISHED: INLINE CPTA_int get_ends() const; PTA_int modify_ends(); - void set_ends(CPTA_int ends); + void set_ends(PTA_int ends); INLINE CPT(GeomVertexArrayData) get_mins() const; INLINE CPT(GeomVertexArrayData) get_maxs() const; diff --git a/panda/src/gobj/shader.I b/panda/src/gobj/shader.I index eccb05d79f..0dae6344dd 100644 --- a/panda/src/gobj/shader.I +++ b/panda/src/gobj/shader.I @@ -20,7 +20,7 @@ // type. //////////////////////////////////////////////////////////////////// INLINE Filename Shader:: -get_filename(const ShaderType &type) const { +get_filename(ShaderType type) const { if (_filename._separate && type != ST_none) { switch (type) { case ST_vertex: @@ -59,7 +59,7 @@ get_filename(const ShaderType &type) const { // Description: Return the Shader's text for the given shader type. //////////////////////////////////////////////////////////////////// INLINE const string &Shader:: -get_text(const ShaderType &type) const { +get_text(ShaderType type) const { if (_text._separate) { nassertr(type != ST_none || !_text._shared.empty(), _text._shared); switch (type) { diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 0c2fb79401..c0c31afaae 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -97,8 +97,8 @@ PUBLISHED: const string &tess_evaluation = ""); static PT(Shader) make_compute(ShaderLanguage lang, const string &body); - INLINE Filename get_filename(const ShaderType &type = ST_none) const; - INLINE const string &get_text(const ShaderType &type = ST_none) const; + INLINE Filename get_filename(ShaderType type = ST_none) const; + INLINE const string &get_text(ShaderType type = ST_none) const; INLINE bool get_error_flag() const; INLINE ShaderLanguage get_language() const; From 8a8cc94cbb75616080760cca4fd3d31ba7cfedf7 Mon Sep 17 00:00:00 2001 From: tobspr Date: Sat, 8 Aug 2015 20:24:23 +0200 Subject: [PATCH 112/203] Add setters to BoundingBox and BoundingSphere --- panda/src/mathutil/boundingBox.I | 14 ++++++++++++++ panda/src/mathutil/boundingBox.h | 3 +++ panda/src/mathutil/boundingSphere.I | 25 +++++++++++++++++++++++-- panda/src/mathutil/boundingSphere.h | 4 ++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/panda/src/mathutil/boundingBox.I b/panda/src/mathutil/boundingBox.I index 2b595b5794..9887d75860 100644 --- a/panda/src/mathutil/boundingBox.I +++ b/panda/src/mathutil/boundingBox.I @@ -114,3 +114,17 @@ get_plane(int n) const { get_point(plane_def[n][1]), get_point(plane_def[n][2])); } + +//////////////////////////////////////////////////////////////////// +// Function: BoundingBox::set_min_max +// Access: Published +// Description: Sets the min and max point of the rectangular solid. +//////////////////////////////////////////////////////////////////// +INLINE_MATHUTIL void BoundingBox:: +set_min_max(const LPoint3 &min, const LPoint3 &max) { + nassertv(!min.is_nan() && !max.is_nan()); + nassertv(_min[0] <= _max[0] && _min[1] <= _max[1] && _min[2] <= _max[2]); + _min = min; + _max = max; + _flags = 0; +} diff --git a/panda/src/mathutil/boundingBox.h b/panda/src/mathutil/boundingBox.h index d816e69a58..8d76955e8e 100644 --- a/panda/src/mathutil/boundingBox.h +++ b/panda/src/mathutil/boundingBox.h @@ -46,6 +46,7 @@ public: virtual void output(ostream &out) const; + PUBLISHED: INLINE_MATHUTIL int get_num_points() const; INLINE_MATHUTIL LPoint3 get_point(int n) const; @@ -54,6 +55,8 @@ PUBLISHED: INLINE_MATHUTIL LPlane get_plane(int n) const; MAKE_SEQ(get_planes, get_num_planes, get_plane); + INLINE_MATHUTIL void set_min_max(const LPoint3 &min, const LPoint3 &max); + public: // Inline accessors for speed. INLINE_MATHUTIL const LPoint3 &get_minq() const; diff --git a/panda/src/mathutil/boundingSphere.I b/panda/src/mathutil/boundingSphere.I index c42c7a40e4..708753ec3d 100644 --- a/panda/src/mathutil/boundingSphere.I +++ b/panda/src/mathutil/boundingSphere.I @@ -19,7 +19,7 @@ // Description: Constructs an empty sphere. //////////////////////////////////////////////////////////////////// INLINE_MATHUTIL BoundingSphere:: -BoundingSphere() { +BoundingSphere() : _center(0) { } //////////////////////////////////////////////////////////////////// @@ -44,7 +44,6 @@ BoundingSphere(const LPoint3 ¢er, PN_stdfloat radius) : //////////////////////////////////////////////////////////////////// INLINE_MATHUTIL LPoint3 BoundingSphere:: get_center() const { - nassertr(!is_empty(), LPoint3::zero()); nassertr(!is_infinite(), LPoint3::zero()); return _center; } @@ -61,3 +60,25 @@ get_radius() const { return _radius; } +//////////////////////////////////////////////////////////////////// +// Function: BoundingSphere::set_center +// Access: Published +// Description: Sets the center point of the sphere. +//////////////////////////////////////////////////////////////////// +INLINE_MATHUTIL void BoundingSphere:: +set_center(const LPoint3 ¢er) { + nassertv(!center.is_nan()); + _center = center; +} + +//////////////////////////////////////////////////////////////////// +// Function: BoundingSphere::set_radius +// Access: Published +// Description: Sets the radius of the sphere. +//////////////////////////////////////////////////////////////////// +INLINE_MATHUTIL void BoundingSphere:: +set_radius(PN_stdfloat radius) { + nassertv(!cnan(radius)); + _radius = radius; + _flags = 0; +} diff --git a/panda/src/mathutil/boundingSphere.h b/panda/src/mathutil/boundingSphere.h index d5b8854763..26e78209cb 100644 --- a/panda/src/mathutil/boundingSphere.h +++ b/panda/src/mathutil/boundingSphere.h @@ -47,6 +47,10 @@ PUBLISHED: INLINE_MATHUTIL LPoint3 get_center() const; INLINE_MATHUTIL PN_stdfloat get_radius() const; + INLINE_MATHUTIL void set_center(const LPoint3 ¢er); + INLINE_MATHUTIL void set_radius(PN_stdfloat radius); + + public: virtual const BoundingSphere *as_bounding_sphere() const; From 85e3d2ee3a2112eed8245e2ed58ff32899bade1a Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 9 Aug 2015 13:10:20 +0200 Subject: [PATCH 113/203] Don't override host URL when building CMU runtime distribution --- makepanda/makepanda.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index ca941bfdde..f72103f017 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -460,9 +460,8 @@ SdkAutoDisableMax() SdkAutoDisablePhysX() SdkAutoDisableSpeedTree() -if (RTDIST and DISTRIBUTOR == "cmu"): - HOST_URL = "https://runtime.panda3d.org/" - +if RTDIST and DISTRIBUTOR == "cmu": + # Some validation checks for the CMU builds. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"): exit("The CMU 1.7 runtime distribution must be built against Python 2.6!") elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"): @@ -470,7 +469,7 @@ if (RTDIST and DISTRIBUTOR == "cmu"): elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"): exit("The CMU 1.9 runtime distribution must be built against Python 2.7!") -elif RTDIST and not HOST_URL: +if RTDIST and not HOST_URL: exit("You must specify a host URL when building the rtdist!") if RUNTIME and not HOST_URL: From 5bf0d44735657a283c391a45b278f6f538643a75 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 9 Aug 2015 15:59:00 +0200 Subject: [PATCH 114/203] Fix linker issue on Windows --- panda/src/downloader/stringStream.I | 6 ++---- panda/src/downloader/stringStream.cxx | 14 ++++++++++++++ panda/src/downloader/stringStream.h | 2 +- panda/src/downloader/stringStream_ext.cxx | 8 ++------ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/panda/src/downloader/stringStream.I b/panda/src/downloader/stringStream.I index fe58ee15e5..66481c69ee 100644 --- a/panda/src/downloader/stringStream.I +++ b/panda/src/downloader/stringStream.I @@ -16,7 +16,7 @@ //////////////////////////////////////////////////////////////////// // Function: StringStream::Constructor // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE StringStream:: StringStream() : iostream(&_buf) { @@ -80,9 +80,7 @@ INLINE void StringStream:: set_data(const string &data) { _buf.clear(); if (!data.empty()) { - pvector pv; - pv.insert(pv.end(), (const unsigned char *)&data[0], (const unsigned char *)&data[0] + data.size()); - _buf.swap_data(pv); + set_data((const unsigned char *)data.data(), data.size()); } } diff --git a/panda/src/downloader/stringStream.cxx b/panda/src/downloader/stringStream.cxx index bc9f764bf2..a15172ea08 100644 --- a/panda/src/downloader/stringStream.cxx +++ b/panda/src/downloader/stringStream.cxx @@ -13,3 +13,17 @@ //////////////////////////////////////////////////////////////////// #include "stringStream.h" + +//////////////////////////////////////////////////////////////////// +// Function: StringStream::set_data +// Access: Public +// Description: Replaces the contents of the data stream. This +// implicitly reseeks to 0. +//////////////////////////////////////////////////////////////////// +void StringStream:: +set_data(const unsigned char *data, size_t size) { + _buf.clear(); + pvector pv; + pv.insert(pv.end(), data, data + size); + _buf.swap_data(pv); +} diff --git a/panda/src/downloader/stringStream.h b/panda/src/downloader/stringStream.h index fd3f2ad6bc..cc295e5357 100644 --- a/panda/src/downloader/stringStream.h +++ b/panda/src/downloader/stringStream.h @@ -46,6 +46,7 @@ public: #ifndef CPPPARSER INLINE string get_data(); INLINE void set_data(const string &data); + void set_data(const unsigned char *data, size_t size); #endif INLINE void swap_data(pvector &data); @@ -59,4 +60,3 @@ private: #include "stringStream.I" #endif - diff --git a/panda/src/downloader/stringStream_ext.cxx b/panda/src/downloader/stringStream_ext.cxx index 84343420a2..a1c46d6cef 100644 --- a/panda/src/downloader/stringStream_ext.cxx +++ b/panda/src/downloader/stringStream_ext.cxx @@ -71,9 +71,7 @@ set_data(PyObject *data) { "StringStream requires a contiguous buffer"); return; } - pvector pv; - pv.insert(pv.end(), (const unsigned char *)view.buf, (const unsigned char *)view.buf + view.len); - _this->_buf.swap_data(pv); + _this->set_data((const unsigned char *)view.buf, view.len); PyBuffer_Release(&view); return; } @@ -84,9 +82,7 @@ set_data(PyObject *data) { char *buffer; Py_ssize_t length; if (PyString_AsStringAndSize(data, &buffer, &length) != -1) { - pvector pv; - pv.insert(pv.end(), (const unsigned char *)buffer, (const unsigned char *)buffer + length); - _this->_buf.swap_data(pv); + _this->set_data((const unsigned char *)buffer, (size_t)length); } return; } From 9dc1a0cbad748599950c7fc047dc004e99d0e7a4 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 9 Aug 2015 19:07:24 +0200 Subject: [PATCH 115/203] Backward compatibility hack so that older runtime versions will still be able to use 1.9 rtdist --- direct/src/plugin/p3dInstanceManager.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/direct/src/plugin/p3dInstanceManager.cxx b/direct/src/plugin/p3dInstanceManager.cxx index b5536b8836..793e6cf36e 100644 --- a/direct/src/plugin/p3dInstanceManager.cxx +++ b/direct/src/plugin/p3dInstanceManager.cxx @@ -258,14 +258,22 @@ initialize(int api_version, const string &contents_filename, // TODO: Linux multiplatform support. Just add the // appropriate platform strings to _supported_platforms. + } else { + nout << "Platform string was set by plugin to " << _platform << "\n"; } if (_supported_platforms.empty()) { + // Hack for older plug-ins, which should still remain compatible with + // newer versions of the runtime distribution. + if (_platform == "win32") { + _supported_platforms.push_back("win_i386"); + } + // We always support at least the specific platform on which we're // running. _supported_platforms.push_back(_platform); } - + #ifdef P3D_PLUGIN_LOG_DIRECTORY if (_log_directory.empty()) { _log_directory = P3D_PLUGIN_LOG_DIRECTORY; From 1e870b3c1c32893c11d00409e89575067906df0c Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 9 Aug 2015 22:16:59 +0200 Subject: [PATCH 116/203] Automatically create win32 alias for coreapi package for backward compatibility with older runtimes --- direct/src/p3d/Packager.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 36883ceb52..d0c009a206 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -16,6 +16,7 @@ import getpass import platform import struct import subprocess +import copy from direct.p3d.FileSpec import FileSpec from direct.p3d.SeqValue import SeqValue from direct.showbase import Loader @@ -839,6 +840,14 @@ class Packager: self.packager.contents[pe.getKey()] = pe self.packager.contentsChanged = True + # Hack for coreapi package, to preserve backward compatibility + # with old versions of the runtime, which still called the + # 32-bit Windows platform "win32". + if self.packageName == "coreapi" and self.platform == "win_i386": + pe2 = copy.copy(pe) + pe2.platform = "win32" + self.packager.contents[pe2.getKey()] = pe2 + self.cleanup() return True From 369305c529572f8936d59f57a028e8305de6c3dd Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 9 Aug 2015 22:26:25 +0200 Subject: [PATCH 117/203] Prevent having to relink most of pandatool when version info changes --- pandatool/src/progbase/programBase.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandatool/src/progbase/programBase.cxx b/pandatool/src/progbase/programBase.cxx index 94bcb0e13b..a9b7c666bf 100644 --- a/pandatool/src/progbase/programBase.cxx +++ b/pandatool/src/progbase/programBase.cxx @@ -27,7 +27,7 @@ #include "configVariableBool.h" #include "panda_getopt_long.h" #include "preprocess_argv.h" -#include "pandaVersion.h" +#include "pandaSystem.h" #include #include @@ -222,7 +222,8 @@ write_man_page(ostream &out) { } } - out << " 1 \"" << date_str << "\" \"" PANDA_VERSION_STR "\" Panda3D\n"; + out << " 1 \"" << date_str << "\" \"" + << PandaSystem::get_version_string() << "\" Panda3D\n"; out << ".SH NAME\n"; if (_brief.empty()) { From 12af94707fe4ab7e55f0e52ed262f6b45aeec5ed Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Aug 2015 01:53:16 +0200 Subject: [PATCH 118/203] Fix cloggage of the pipe communicating with the forked X11 splash window subprocess --- direct/src/plugin/p3dX11SplashWindow.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index f1afc5a15b..513458521e 100644 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -681,10 +681,13 @@ subprocess_run() { } } - if (input_ready) { + do { + // Empty the pipe of whatever is in it. receive_command(); - } + input_ready = _pipe_read.has_gdata(); + } while (input_ready); + // Sleep a good amount in order not to lock up the system. struct timespec req; req.tv_sec = 0; req.tv_nsec = 50000000; // 50 ms From 2abc51d88faa17ccb6d0e805522993ba01da60b1 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Aug 2015 01:57:00 +0200 Subject: [PATCH 119/203] Allow specifying contents of .py modules with file(text=...) in pdef --- direct/src/p3d/Packager.py | 5 ++++- direct/src/showutil/FreezeTool.py | 20 +++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index d0c009a206..40c30d8485 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -1841,7 +1841,10 @@ class Packager: self.notify.warning(message) return - self.freezer.addModule(moduleName, filename = file.filename) + if file.text: + self.freezer.addModule(moduleName, filename = file.filename, text = file.text) + else: + self.freezer.addModule(moduleName, filename = file.filename) def addEggFile(self, file): # Precompile egg files to bam's. diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 28c622a9be..68a6eff60a 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -8,6 +8,7 @@ import marshal import imp import platform import types +from StringIO import StringIO from distutils.sysconfig import PREFIX, get_python_inc, get_python_version # Temporary (?) try..except to protect against unbuilt p3extend_frozen. @@ -499,7 +500,8 @@ class Freezer: def __init__(self, moduleName, filename = None, implicit = False, guess = False, exclude = False, forbid = False, - allowChildren = False, fromSource = None): + allowChildren = False, fromSource = None, + text = None): # The Python module name. self.moduleName = moduleName @@ -534,6 +536,9 @@ class Freezer: # record came from, supplied by the caller. self.fromSource = fromSource + # If this is set, it contains Python code of the module. + self.text = text + # Some sanity checks. if not self.exclude: self.allowChildren = True @@ -750,7 +755,8 @@ class Freezer: return modules def addModule(self, moduleName, implicit = False, newName = None, - filename = None, guess = False, fromSource = None): + filename = None, guess = False, fromSource = None, + text = None): """ Adds a module to the list of modules to be exported by this tool. If implicit is true, it is OK if the module does not actually exist. @@ -806,7 +812,7 @@ class Freezer: # It's actually a regular module. self.modules[newParentName] = self.ModuleDef( parentName, implicit = implicit, guess = guess, - fromSource = fromSource) + fromSource = fromSource, text = text) else: # Now get all the py files in the parent directory. @@ -821,7 +827,7 @@ class Freezer: # A normal, explicit module name. self.modules[newName] = self.ModuleDef( moduleName, filename = filename, implicit = implicit, - guess = guess, fromSource = fromSource) + guess = guess, fromSource = fromSource, text = text) def done(self, compileToExe = False): """ Call this method after you have added all modules with @@ -972,7 +978,11 @@ class Freezer: stuff = ("", "rb", imp.PY_COMPILED) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) else: - fp = open(pathname, modulefinder.READ_MODE) + fp = open(pathname, 'U') + if mdef.text: + fp = StringIO(mdef.text) + else: + fp = open(pathname, modulefinder.READ_MODE) stuff = ("", "r", imp.PY_SOURCE) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) From 03e377091da4e8d2712ce4cdfb3b28c6e189998a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Aug 2015 02:01:52 +0200 Subject: [PATCH 120/203] Add in 'rocket' module for rocket package --- direct/src/p3d/panda3d.pdef | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/direct/src/p3d/panda3d.pdef b/direct/src/p3d/panda3d.pdef index 4f3df21c97..87a42eff2b 100644 --- a/direct/src/p3d/panda3d.pdef +++ b/direct/src/p3d/panda3d.pdef @@ -362,8 +362,16 @@ class rocket(package): config(display_name = "Panda3D libRocket support") require('panda3d') - module('panda3d.rocket', required = True) - module('_rocketcore', '_rocketcontrols') + file('rocket.py', extract = True, text = """ +from _rocketcore import * +try: + from _rocketcontrols import * +except ImportError: + pass +""") + + module('panda3d.rocket', '_rocketcore', required = True) + module('_rocketcontrols') file('libp3rocket.dll', required = True) class vrpn(package): From caf986fa2ab7de5e835b3b95f2a74cff8385c1b5 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Aug 2015 02:48:53 +0200 Subject: [PATCH 121/203] Fix uninitialized variable that would sometimes prevent mouse movement from being registered by libRocket --- panda/src/rocket/rocketInputHandler.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/rocket/rocketInputHandler.cxx b/panda/src/rocket/rocketInputHandler.cxx index 71ea099192..c0a4e22464 100644 --- a/panda/src/rocket/rocketInputHandler.cxx +++ b/panda/src/rocket/rocketInputHandler.cxx @@ -34,6 +34,8 @@ TypeHandle RocketInputHandler::_type_handle; RocketInputHandler:: RocketInputHandler(const string &name) : DataNode(name), + _mouse_xy(-1), + _mouse_xy_changed(false), _modifiers(0), _wheel_delta(0) { From d74f02819861183d163bc7580d87a62b12efa3d7 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Aug 2015 04:00:41 +0200 Subject: [PATCH 122/203] Linux splash window shouldn't block waiting for pipe activity --- direct/src/plugin/p3dX11SplashWindow.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index 513458521e..76c0175a18 100644 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -681,11 +681,11 @@ subprocess_run() { } } - do { + while (input_ready) { // Empty the pipe of whatever is in it. receive_command(); input_ready = _pipe_read.has_gdata(); - } while (input_ready); + } // Sleep a good amount in order not to lock up the system. struct timespec req; From 3e6e355577740e120f51df6e4fa56d19bfb0d07c Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Aug 2015 04:34:45 +0200 Subject: [PATCH 123/203] Fix error building rocket package on 1.9 branch --- direct/src/showutil/FreezeTool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 68a6eff60a..54f7c90429 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -978,11 +978,10 @@ class Freezer: stuff = ("", "rb", imp.PY_COMPILED) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) else: - fp = open(pathname, 'U') if mdef.text: fp = StringIO(mdef.text) else: - fp = open(pathname, modulefinder.READ_MODE) + fp = open(pathname, 'U') stuff = ("", "r", imp.PY_SOURCE) self.mf.load_module(mdef.moduleName, fp, pathname, stuff) From 888efc18afcdabe1855cb06522ed2232dfe0c211 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 11 Aug 2015 13:56:47 +0200 Subject: [PATCH 124/203] Avoid unnecessary glVertexAttribDivisor calls --- panda/src/glstuff/glShaderContext_src.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 2a67e0ba21..5df6c93871 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1425,7 +1425,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { GL_TRUE, stride, client_pointer); } - if (_glgsg->_supports_vertex_attrib_divisor) { + if (_glgsg->_supports_vertex_attrib_divisor && divisor > 0) { _glgsg->_glVertexAttribDivisor(p, divisor); _has_divisor = true; } From a24531ff7b8495e47bff4bd7cb0287e46cb95851 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 11 Aug 2015 15:45:27 +0200 Subject: [PATCH 125/203] Various GL tweaks --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 2 +- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 13 +++++-------- panda/src/glstuff/glGraphicsStateGuardian_src.h | 2 +- panda/src/glstuff/glmisc_src.cxx | 6 ++++++ panda/src/glstuff/glmisc_src.h | 1 + 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 78ecf91bb1..2d851775a5 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1277,7 +1277,7 @@ open_buffer() { // Actually, let's always get a colour buffer for now until we // figure out why Intel HD Graphics cards complain otherwise. - if (_fb_properties.get_color_bits() == 0) { + if (gl_force_fbo_color && _fb_properties.get_color_bits() == 0) { _fb_properties.set_color_bits(1); } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 0a40264eb0..1a2317760a 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -11116,7 +11116,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { gtc->_height = height; gtc->_depth = depth; - gtc->update_data_size_bytes(get_texture_memory_size(tex)); + gtc->update_data_size_bytes(get_texture_memory_size(gtc)); } nassertr(gtc->_has_storage, false); @@ -11665,7 +11665,8 @@ upload_simple_texture(CLP(TextureContext) *gtc) { // currently-selected texture). //////////////////////////////////////////////////////////////////// size_t CLP(GraphicsStateGuardian):: -get_texture_memory_size(Texture *tex) { +get_texture_memory_size(CLP(TextureContext) *gtc) { + Texture *tex = gtc->get_texture(); #ifdef OPENGLES // Texture querying not supported on OpenGL ES. int width = tex->get_x_size(); int height = tex->get_y_size(); @@ -11692,10 +11693,6 @@ get_texture_memory_size(Texture *tex) { return tex->get_expected_ram_image_size(); } - GLint minfilter; - glGetTexParameteriv(target, GL_TEXTURE_MIN_FILTER, &minfilter); - bool has_mipmaps = is_mipmap_filter(minfilter); - clear_my_gl_errors(); GLint internal_format; @@ -11755,7 +11752,7 @@ get_texture_memory_size(Texture *tex) { #endif // OPENGLES size_t result = num_bytes * width * height * depth * scale; - if (has_mipmaps) { + if (gtc->_uses_mipmaps) { result = (result * 4) / 3; } @@ -11770,7 +11767,7 @@ get_texture_memory_size(Texture *tex) { //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: check_nonresident_texture(BufferContextChain &chain) { -#ifndef OPENGLES // Residency queries not supported by OpenGL ES. +#if defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES) // Residency queries not supported by OpenGL ES. size_t num_textures = chain.get_count(); if (num_textures == 0) { return; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 5272dfb771..ff8044d324 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -548,7 +548,7 @@ protected: Texture::CompressionMode image_compression); bool upload_simple_texture(CLP(TextureContext) *gtc); - size_t get_texture_memory_size(Texture *tex); + size_t get_texture_memory_size(CLP(TextureContext) *gtc); void check_nonresident_texture(BufferContextChain &chain); bool do_extract_texture_data(CLP(TextureContext) *gtc); bool extract_texture_image(PTA_uchar &image, size_t &page_size, diff --git a/panda/src/glstuff/glmisc_src.cxx b/panda/src/glstuff/glmisc_src.cxx index 743b9ca0ea..0d4e31ae96 100644 --- a/panda/src/glstuff/glmisc_src.cxx +++ b/panda/src/glstuff/glmisc_src.cxx @@ -187,6 +187,12 @@ ConfigVariableBool gl_force_depth_stencil ("gl-force-depth-stencil", false, PRC_DESC("Temporary hack variable 7x00 vs 8x00 nVidia bug. See glGraphicsStateGuardian_src.cxx.")); +ConfigVariableBool gl_force_fbo_color + ("gl-force-fbo-color", true, + PRC_DESC("This is set to true to force all FBOs to have at least one " + "color attachment. This is to work around an Intel driver " + "issue. Set to false to allow depth-only FBOs.")); + ConfigVariableBool gl_check_errors ("gl-check-errors", false, PRC_DESC("Regularly call glGetError() to check for OpenGL errors. " diff --git a/panda/src/glstuff/glmisc_src.h b/panda/src/glstuff/glmisc_src.h index 78a19a5a8f..538206ff11 100644 --- a/panda/src/glstuff/glmisc_src.h +++ b/panda/src/glstuff/glmisc_src.h @@ -65,6 +65,7 @@ extern ConfigVariableBool gl_debug_object_labels; extern ConfigVariableBool gl_debug_buffers; extern ConfigVariableBool gl_finish; extern ConfigVariableBool gl_force_depth_stencil; +extern ConfigVariableBool gl_force_fbo_color; extern ConfigVariableBool gl_check_errors; extern ConfigVariableBool gl_force_flush; extern ConfigVariableBool gl_separate_specular_color; From 9773fd79692b6733faf5ef9779ce8459af38c3da Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 11 Aug 2015 17:08:31 +0200 Subject: [PATCH 126/203] Support cube map arrays --- panda/src/display/graphicsStateGuardian.I | 10 ++++ panda/src/display/graphicsStateGuardian.cxx | 1 + panda/src/display/graphicsStateGuardian.h | 2 + .../glstuff/glGraphicsStateGuardian_src.cxx | 42 ++++++++++++--- panda/src/glstuff/glShaderContext_src.cxx | 24 +++++++++ panda/src/gobj/shader.cxx | 52 ++++++++++++++----- panda/src/gobj/shader.h | 6 ++- panda/src/gobj/texture.I | 32 ++++++++++++ panda/src/gobj/texture.cxx | 31 +++++++++-- panda/src/gobj/texture.h | 4 ++ 10 files changed, 179 insertions(+), 25 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.I b/panda/src/display/graphicsStateGuardian.I index 15b2b89b78..1646f4a741 100644 --- a/panda/src/display/graphicsStateGuardian.I +++ b/panda/src/display/graphicsStateGuardian.I @@ -495,6 +495,16 @@ get_supports_buffer_texture() const { return _supports_buffer_texture; } +//////////////////////////////////////////////////////////////////// +// Function: GraphicsStateGuardian::get_supports_cube_map_array +// Access: Published +// Description: Returns true if this GSG can render cube map arrays. +//////////////////////////////////////////////////////////////////// +INLINE bool GraphicsStateGuardian:: +get_supports_cube_map_array() const { + return _supports_cube_map_array; +} + //////////////////////////////////////////////////////////////////// // Function: GraphicsStateGuardian::get_supports_tex_non_pow2 // Access: Published diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 02ee982feb..fa17aa31da 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -198,6 +198,7 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system, _supports_2d_texture_array = false; _supports_cube_map = false; _supports_buffer_texture = false; + _supports_cube_map_array = false; _supports_tex_non_pow2 = false; _supports_texture_srgb = false; _supports_compressed_texture = false; diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index cc3c78a1bc..b657d867e9 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -132,6 +132,7 @@ PUBLISHED: INLINE bool get_supports_2d_texture_array() const; INLINE bool get_supports_cube_map() const; INLINE bool get_supports_buffer_texture() const; + INLINE bool get_supports_cube_map_array() const; INLINE bool get_supports_tex_non_pow2() const; INLINE bool get_supports_texture_srgb() const; @@ -489,6 +490,7 @@ protected: bool _supports_2d_texture_array; bool _supports_cube_map; bool _supports_buffer_texture; + bool _supports_cube_map_array; bool _supports_tex_non_pow2; bool _supports_texture_srgb; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 1a2317760a..ee713fbce2 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -856,6 +856,11 @@ reset() { } #endif +#ifndef OPENGLES + _supports_cube_map_array = is_at_least_gl_version(4, 0) || + has_extension("GL_ARB_texture_cube_map_array"); +#endif + #ifndef OPENGLES if (is_at_least_gl_version(3, 0)) { _glTexBuffer = (PFNGLTEXBUFFERPROC)get_extension_func("glTexBuffer"); @@ -4541,6 +4546,14 @@ prepare_texture(Texture *tex, int view) { } break; + case Texture::TT_cube_map_array: + if (!_supports_cube_map_array) { + GLCAT.warning() + << "Cube map arrays are not supported by this OpenGL driver.\n"; + return NULL; + } + break; + default: break; } @@ -5747,7 +5760,7 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z, Texture::TextureType texture_type; int z_size; - //TODO: should be extended to support 3D textures and 2D arrays. + //TODO: should be extended to support 3D textures, 2D arrays and cube map arrays. if (z >= 0) { texture_type = Texture::TT_cube_map; z_size = 6; @@ -7512,7 +7525,7 @@ get_texture_target(Texture::TextureType texture_type) const { case Texture::TT_2d_texture_array: #ifndef OPENGLES if (_supports_2d_texture_array) { - return GL_TEXTURE_2D_ARRAY_EXT; + return GL_TEXTURE_2D_ARRAY; } #endif return GL_NONE; @@ -7524,6 +7537,14 @@ get_texture_target(Texture::TextureType texture_type) const { return GL_NONE; } + case Texture::TT_cube_map_array: +#ifndef OPENGLES + if (_supports_cube_map_array) { + return GL_TEXTURE_CUBE_MAP_ARRAY; + } +#endif + return GL_NONE; + case Texture::TT_buffer_texture: #ifndef OPENGLES if (_supports_buffer_texture) { @@ -9695,7 +9716,7 @@ update_standard_texture_bindings() { continue; } #ifndef OPENGLES - if (target == GL_TEXTURE_2D_ARRAY_EXT) { + if (target == GL_TEXTURE_2D_ARRAY || target == GL_TEXTURE_CUBE_MAP_ARRAY) { // Cannot be applied via the FFP. continue; } @@ -10748,6 +10769,12 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { max_dimension_z = _max_2d_texture_array_layers; break; + case Texture::TT_cube_map_array: + max_dimension_x = _max_texture_dimension; + max_dimension_y = _max_texture_dimension; + max_dimension_z = int(_max_2d_texture_array_layers / 6) * 6; + break; + case Texture::TT_buffer_texture: max_dimension_x = _max_buffer_texture_size; max_dimension_y = 1; @@ -11009,6 +11036,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { break; case Texture::TT_3d_texture: case Texture::TT_2d_texture_array: + case Texture::TT_cube_map_array: _glTexStorage3D(target, num_levels, internal_format, width, height, depth); break; } @@ -11343,7 +11371,8 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, #endif // OPENGLES #ifndef OPENGLES - case GL_TEXTURE_2D_ARRAY_EXT: + case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: if (_supports_2d_texture_array) { if (image_compression == Texture::CM_off) { _glTexSubImage3D(page_target, n - mipmap_bias, 0, 0, 0, width, height, depth, @@ -11525,7 +11554,8 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, #endif #ifndef OPENGLES - case GL_TEXTURE_2D_ARRAY_EXT: + case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: if (_supports_2d_texture_array) { if (image_compression == Texture::CM_off) { _glTexImage3D(page_target, n - mipmap_bias, internal_format, @@ -11876,7 +11906,7 @@ do_extract_texture_data(CLP(TextureContext) *gtc) { glGetTexLevelParameteriv(page_target, 0, GL_TEXTURE_DEPTH, &depth); } #ifndef OPENGLES - else if (_supports_2d_texture_array && target == GL_TEXTURE_2D_ARRAY_EXT) { + else if (target == GL_TEXTURE_2D_ARRAY || target == GL_TEXTURE_CUBE_MAP_ARRAY) { glGetTexLevelParameteriv(page_target, 0, GL_TEXTURE_DEPTH, &depth); } #endif diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 7a7e89de89..8cfd20119f 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1096,18 +1096,22 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { case GL_INT_SAMPLER_2D_ARRAY: case GL_INT_SAMPLER_CUBE: case GL_INT_SAMPLER_BUFFER: + case GL_INT_SAMPLER_CUBE_MAP_ARRAY: case GL_UNSIGNED_INT_SAMPLER_1D: case GL_UNSIGNED_INT_SAMPLER_2D: case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_BUFFER: + case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY: case GL_SAMPLER_1D_SHADOW: case GL_SAMPLER_1D: case GL_SAMPLER_CUBE_SHADOW: case GL_SAMPLER_2D_ARRAY: case GL_SAMPLER_2D_ARRAY_SHADOW: case GL_SAMPLER_BUFFER: + case GL_SAMPLER_CUBE_MAP_ARRAY: + case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW: #endif // !OPENGLES case GL_SAMPLER_2D: case GL_SAMPLER_2D_SHADOW: @@ -1460,6 +1464,26 @@ get_sampler_texture_type(int &out, GLenum param_type) { return false; } + case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW: + if (!_glgsg->_supports_shadow_filter) { + GLCAT.error() + << "GLSL shader uses shadow sampler, which is unsupported by the driver.\n"; + return false; + } + // Fall through + case GL_INT_SAMPLER_CUBE_MAP_ARRAY: + case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY: + case GL_SAMPLER_CUBE_MAP_ARRAY: + out = Texture::TT_cube_map_array; + if (_glgsg->_supports_cube_map_array) { + return true; + } else { + GLCAT.error() + << "GLSL shader uses cube map array, which is unsupported by the driver.\n"; + return false; + + } + case GL_INT_SAMPLER_BUFFER: case GL_UNSIGNED_INT_SAMPLER_BUFFER: case GL_SAMPLER_BUFFER: diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 57b5882ea7..7761312d2f 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -82,12 +82,14 @@ cp_report_error(ShaderArgInfo &p, const string &msg) { case SAT_mat4x2: tstr = "mat4x2 "; break; case SAT_mat4x3: tstr = "mat4x3 "; break; case SAT_mat4x4: tstr = "mat4x4 "; break; - case SAT_sampler1d: tstr = "sampler1d "; break; - case SAT_sampler2d: tstr = "sampler2d "; break; - case SAT_sampler3d: tstr = "sampler3d "; break; - case SAT_sampler2dArray: tstr = "sampler2dArray "; break; - case SAT_samplercube: tstr = "samplercube "; break; - default: tstr = "unknown "; break; + case SAT_sampler1d: tstr = "sampler1D "; break; + case SAT_sampler2d: tstr = "sampler2D "; break; + case SAT_sampler3d: tstr = "sampler3D "; break; + case SAT_sampler2d_array: tstr = "sampler2DArray "; break; + case SAT_sampler_cube: tstr = "samplerCUBE "; break; + case SAT_sampler_buffer: tstr = "samplerBUF "; break; + case SAT_sampler_cube_array:tstr = "samplerCUBEARRAY "; break; + default: tstr = "unknown "; break; } string cstr = "invalid"; @@ -244,8 +246,10 @@ cp_errchk_parameter_sampler(ShaderArgInfo &p) if ((p._type!=SAT_sampler1d)&& (p._type!=SAT_sampler2d)&& (p._type!=SAT_sampler3d)&& - (p._type!=SAT_sampler2dArray)&& - (p._type!=SAT_samplercube)) { + (p._type!=SAT_sampler2d_array)&& + (p._type!=SAT_sampler_cube)&& + (p._type!=SAT_sampler_buffer)&& + (p._type!=SAT_sampler_cube_array)) { cp_report_error(p, "parameter should have a 'sampler' type"); return false; } @@ -1215,8 +1219,10 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { case SAT_sampler1d: bind._desired_type = Texture::TT_1d_texture; break; case SAT_sampler2d: bind._desired_type = Texture::TT_2d_texture; break; case SAT_sampler3d: bind._desired_type = Texture::TT_3d_texture; break; - case SAT_sampler2dArray: bind._desired_type = Texture::TT_2d_texture_array; break; - case SAT_samplercube: bind._desired_type = Texture::TT_cube_map; break; + case SAT_sampler2d_array:bind._desired_type = Texture::TT_2d_texture_array; break; + case SAT_sampler_cube: bind._desired_type = Texture::TT_cube_map; break; + case SAT_sampler_buffer: bind._desired_type = Texture::TT_buffer_texture; break; + case SAT_sampler_cube_array:bind._desired_type = Texture::TT_cube_map_array; break; default: cp_report_error(p, "Invalid type for a tex-parameter"); return false; @@ -1358,7 +1364,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { _tex_spec.push_back(bind); return true; } - case SAT_sampler2dArray: { + case SAT_sampler2d_array: { ShaderTexSpec bind; bind._id = p._id; bind._name = kinputname; @@ -1366,7 +1372,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { _tex_spec.push_back(bind); return true; } - case SAT_samplercube: { + case SAT_sampler_cube: { ShaderTexSpec bind; bind._id = p._id; bind._name = kinputname; @@ -1374,6 +1380,22 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) { _tex_spec.push_back(bind); return true; } + case SAT_sampler_buffer: { + ShaderTexSpec bind; + bind._id = p._id; + bind._name = kinputname; + bind._desired_type = Texture::TT_buffer_texture; + _tex_spec.push_back(bind); + return true; + } + case SAT_sampler_cube_array: { + ShaderTexSpec bind; + bind._id = p._id; + bind._name = kinputname; + bind._desired_type = Texture::TT_cube_map_array; + _tex_spec.push_back(bind); + return true; + } default: cp_report_error(p, "invalid type for non-prefix parameter"); return false; @@ -1460,8 +1482,10 @@ cg_parameter_type(CGparameter p) { case CG_SAMPLER1D: return Shader::SAT_sampler1d; case CG_SAMPLER2D: return Shader::SAT_sampler2d; case CG_SAMPLER3D: return Shader::SAT_sampler3d; - case CG_SAMPLER2DARRAY: return Shader::SAT_sampler2dArray; - case CG_SAMPLERCUBE: return Shader::SAT_samplercube; + case CG_SAMPLER2DARRAY: return Shader::SAT_sampler2d_array; + case CG_SAMPLERCUBE: return Shader::SAT_sampler_cube; + case CG_SAMPLERBUF: return Shader::SAT_sampler_buffer; + case CG_SAMPLERCUBEARRAY:return Shader::SAT_sampler_cube_array; // CG_SAMPLER1DSHADOW and CG_SAMPLER2DSHADOW case 1313: return Shader::SAT_sampler1d; case 1314: return Shader::SAT_sampler2d; diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index c0c31afaae..c5b8a3095b 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -230,8 +230,10 @@ public: SAT_sampler1d, SAT_sampler2d, SAT_sampler3d, - SAT_sampler2dArray, - SAT_samplercube, + SAT_sampler2d_array, + SAT_sampler_cube, + SAT_sampler_buffer, + SAT_sampler_cube_array, SAT_unknown }; diff --git a/panda/src/gobj/texture.I b/panda/src/gobj/texture.I index 6c6b945d2f..24a21e06b4 100644 --- a/panda/src/gobj/texture.I +++ b/panda/src/gobj/texture.I @@ -215,6 +215,38 @@ setup_cube_map(int size, ComponentType component_type, Format format) { setup_texture(TT_cube_map, size, size, 6, component_type, format); } +//////////////////////////////////////////////////////////////////// +// Function: Texture::setup_cube_map_array +// Access: Published +// Description: Sets the texture as cube map array with N cube maps. +// Note that this number is not the same as the z_size. +// Follow up with read() or load() to fill +// the texture properties and image data, or use +// set_clear_color to let the texture be cleared to a +// solid color. +//////////////////////////////////////////////////////////////////// +INLINE void Texture:: +setup_cube_map_array(int num_cube_maps) { + setup_cube_map_array(0, num_cube_maps, T_unsigned_byte, F_rgb); +} + +//////////////////////////////////////////////////////////////////// +// Function: Texture::setup_cube_map_array +// Access: Published +// Description: Sets the texture as cube map array with N cube maps +// with the specified dimensions and format. Follow up +// with set_ram_image() or modify_ram_image() to fill +// the image data, or use set_clear_color to let the +// texture be cleared to a solid color. +// +// The num_cube_maps given here is multiplied by six +// to become the z_size of the image. +//////////////////////////////////////////////////////////////////// +INLINE void Texture:: +setup_cube_map_array(int size, int num_cube_maps, ComponentType component_type, Format format) { + setup_texture(TT_cube_map_array, size, size, num_cube_maps * 6, component_type, format); +} + //////////////////////////////////////////////////////////////////// // Function: Texture::setup_buffer_texture // Access: Published diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 66bbe6767e..0ee3a85847 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -1525,6 +1525,10 @@ write(ostream &out, int indent_level) const { out << "cube map, " << cdata->_x_size << " x " << cdata->_y_size; break; + case TT_cube_map_array: + out << "cube map array, " << cdata->_x_size << " x " << cdata->_y_size << " x " << cdata->_z_size; + break; + case TT_buffer_texture: out << "buffer, " << cdata->_x_size; break; @@ -1928,6 +1932,8 @@ format_texture_type(TextureType tt) { return "2d_texture_array"; case TT_cube_map: return "cube_map"; + case TT_cube_map_array: + return "cube_map_array"; case TT_buffer_texture: return "buffer_texture"; } @@ -1952,6 +1958,8 @@ string_texture_type(const string &str) { return TT_2d_texture_array; } else if (cmp_nocase(str, "cube_map") == 0) { return TT_cube_map; + } else if (cmp_nocase(str, "cube_map_array") == 0) { + return TT_cube_map_array; } else if (cmp_nocase(str, "buffer_texture") == 0) { return TT_buffer_texture; } @@ -4875,11 +4883,17 @@ do_reconsider_image_properties(CData *cdata, int x_size, int y_size, int num_com } #ifndef NDEBUG - if (cdata->_texture_type == TT_1d_texture || - cdata->_texture_type == TT_buffer_texture) { + switch (cdata->_texture_type) { + case TT_1d_texture: + case TT_buffer_texture: nassertr(y_size == 1, false); - } else if (cdata->_texture_type == TT_cube_map) { + break; + case TT_cube_map: + case TT_cube_map_array: nassertr(x_size == y_size, false); + break; + default: + break; } #endif if ((cdata->_x_size != x_size)||(cdata->_y_size != y_size)) { @@ -5074,6 +5088,15 @@ do_setup_texture(CData *cdata, Texture::TextureType texture_type, cdata->_default_sampler.set_wrap_w(SamplerState::WM_clamp); break; + case TT_cube_map_array: + // Cube maps array z_size needs to be a multiple of 6. + nassertv(x_size == y_size && z_size % 6 == 0); + + cdata->_default_sampler.set_wrap_u(SamplerState::WM_clamp); + cdata->_default_sampler.set_wrap_v(SamplerState::WM_clamp); + cdata->_default_sampler.set_wrap_w(SamplerState::WM_clamp); + break; + case TT_buffer_texture: nassertv(y_size == 1 && z_size == 1); break; @@ -5246,6 +5269,7 @@ do_set_z_size(CData *cdata, int z_size) { if (cdata->_z_size != z_size) { nassertv((cdata->_texture_type == Texture::TT_3d_texture) || (cdata->_texture_type == Texture::TT_cube_map && z_size == 6) || + (cdata->_texture_type == Texture::TT_cube_map_array && z_size % 6 == 0) || (cdata->_texture_type == Texture::TT_2d_texture_array) || (z_size == 1)); cdata->_z_size = z_size; cdata->inc_image_modified(); @@ -8113,6 +8137,7 @@ make_this_from_bam(const FactoryParams ¶ms) { break; case TT_2d_texture_array: + case TT_cube_map_array: me = TexturePool::load_2d_texture_array(filename, has_read_mipmaps, options); break; diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index d3fc0c4bb8..729f3671ec 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -84,6 +84,7 @@ PUBLISHED: TT_2d_texture_array, TT_cube_map, TT_buffer_texture, + TT_cube_map_array, }; enum ComponentType { @@ -242,6 +243,9 @@ PUBLISHED: INLINE void setup_2d_texture_array(int z_size = 1); INLINE void setup_2d_texture_array(int x_size, int y_size, int z_size, ComponentType component_type, Format format); + INLINE void setup_cube_map_array(int num_cube_maps); + INLINE void setup_cube_map_array(int size, int num_cube_maps, + ComponentType component_type, Format format); INLINE void setup_buffer_texture(int size, ComponentType component_type, Format format, GeomEnums::UsageHint usage); void generate_normalization_cube_map(int size); From 283713a38240458b1317b267e124a7420b7a5966 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 11 Aug 2015 18:27:15 +0200 Subject: [PATCH 127/203] Fix deprecation warning for default shader in GL3.2+ core context --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index ee713fbce2..9927b8c57a 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -170,6 +170,7 @@ static const string default_fshader = "#version 130\n" "in vec2 texcoord;\n" "in vec4 color;\n" + "out vec4 p3d_FragColor;" #else "precision mediump float;\n" "varying vec2 texcoord;\n" @@ -178,11 +179,12 @@ static const string default_fshader = "uniform sampler2D p3d_Texture0;\n" "void main(void) {\n" #ifndef OPENGLES - " gl_FragColor = texture(p3d_Texture0, texcoord);\n" + " p3d_FragColor = texture(p3d_Texture0, texcoord);\n" + " p3d_FragColor *= color;\n" #else " gl_FragColor = texture2D(p3d_Texture0, texcoord).bgra;\n" -#endif " gl_FragColor *= color;\n" +#endif "}\n"; #endif From 03d633f2e763ee062dfad0cc4ecc1feed1bddd74 Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Tue, 11 Aug 2015 11:11:05 -0500 Subject: [PATCH 128/203] For stdpy.file wrapper, handle mode more consistently with Python. For Python 2, ignore unknown characters in the mode rather than silently failing to open. For Python 3, fail if unknown characters appear. --- direct/src/stdpy/file.py | 74 ++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/direct/src/stdpy/file.py b/direct/src/stdpy/file.py index 91cf209b04..25f5b6e1a1 100644 --- a/direct/src/stdpy/file.py +++ b/direct/src/stdpy/file.py @@ -11,6 +11,7 @@ __all__ = [ ] from panda3d import core +import sys import types _vfs = core.VirtualFileSystem.getGlobalPtr() @@ -65,12 +66,27 @@ class file: self.filename = filename self.name = filename.toOsSpecific() + if sys.version_info >= (3, 0): + # Python 3 is much stricter than Python 2, which lets + # unknown flags fall through. + for ch in mode: + if not ch in 'rwxabt+U': + raise IOError("invalid mode: " + mode) + binary = False + if 'b' in mode and 't' in mode: + raise IOError("can't have text and binary mode at once") + if 'b' in mode: # Strip 'b'. This means a binary file. i = mode.index('b') mode = mode[:i] + mode[i + 1:] binary = True + elif 't' in mode: + # Strip 't'. This means a text file (redundant, yes). + i = mode.index('t') + mode = mode[:i] + mode[i + 1:] + binary = False if 'U' in mode: # Strip 'U'. We don't use it; universal-newline support @@ -83,61 +99,69 @@ class file: mode = 'r' # Per Python docs, we insist this is true. - assert mode[0] in 'rwa' + modeType = mode[0] + assert modeType in 'rwa' if binary: filename.setBinary() else: filename.setText() - - # Actually open the streams. - if mode == 'w': - self.__stream = _vfs.openWriteFile(filename, autoUnwrap, True) - if not self.__stream: - message = 'Could not open %s for writing' % (filename) - raise IOError, message - writeMode = True - - elif mode == 'a': - self.__stream = _vfs.openAppendFile(filename) - if not self.__stream: - message = 'Could not open %s for writing' % (filename) - raise IOError, message - writeMode = True - - elif mode == 'w+': + + # Actually open the streams, taking care to + # ignore unknown chars in the mode string. + # We already asserted that it starts with a mode + # char above, so locate the '+' + if modeType == 'w' and '+' in mode: self.__stream = _vfs.openReadWriteFile(filename, True) if not self.__stream: message = 'Could not open %s for writing' % (filename) - raise IOError, message + raise IOError(message) readMode = True writeMode = True - elif mode == 'a+': + elif modeType == 'a' and '+' in mode: self.__stream = _vfs.openReadAppendFile(filename) if not self.__stream: message = 'Could not open %s for writing' % (filename) - raise IOError, message + raise IOError(message) readMode = True writeMode = True - elif mode == 'r+': + elif modeType == 'r' and '+' in mode: self.__stream = _vfs.openReadWriteFile(filename, False) if not self.__stream: message = 'Could not open %s for writing' % (filename) - raise IOError, message + raise IOError(message) readMode = True writeMode = True + + elif modeType == 'w': + self.__stream = _vfs.openWriteFile(filename, autoUnwrap, True) + if not self.__stream: + message = 'Could not open %s for writing' % (filename) + raise IOError(message) + writeMode = True - elif mode == 'r': + elif modeType == 'a': + self.__stream = _vfs.openAppendFile(filename) + if not self.__stream: + message = 'Could not open %s for writing' % (filename) + raise IOError(message) + writeMode = True + + elif modeType == 'r': self.__stream = _vfs.openReadFile(filename, autoUnwrap) if not self.__stream: if not _vfs.exists(filename): message = 'No such file: %s' % (filename) else: message = 'Could not open %s for reading' % (filename) - raise IOError, message + raise IOError(message) readMode = True + + else: + # should not get here unless there's a bug above + raise IOError("Unhandled mode flags: " + mode) self.__needsVfsClose = True From 782c4db6348474a65daf2ba1034f6090369b7459 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 11 Aug 2015 19:11:56 +0200 Subject: [PATCH 129/203] Instead of checking every 100 end_frame() calls, check for errors every second. --- .../glstuff/glGraphicsStateGuardian_src.cxx | 25 ++++++++++--------- .../src/glstuff/glGraphicsStateGuardian_src.h | 4 +-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 9927b8c57a..b552d1dec7 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -351,6 +351,12 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) : _renderbuffer_residency(get_prepared_objects()->get_name(), "renderbuffer") { _error_count = 0; + _last_error_check = -1.0; + + // calling glGetError() forces a sync, this turns it on if you want to. + _check_errors = gl_check_errors; + _force_flush = gl_force_flush; + _gl_shadlang_ver_major = 0; _gl_shadlang_ver_minor = 0; @@ -363,10 +369,6 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) : // the window tells us otherwise. _is_hardware = true; - // calling glGetError() forces a sync, this turns it on if you want to. - _check_errors = gl_check_errors; - _force_flush = gl_force_flush; - _scissor_enabled = false; _scissor_attrib_active = false; @@ -452,6 +454,8 @@ debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei l //////////////////////////////////////////////////////////////////// void CLP(GraphicsStateGuardian):: reset() { + _last_error_check = -1.0; + free_pointers(); GraphicsStateGuardian::reset(); @@ -3300,12 +3304,12 @@ end_frame(Thread *current_thread) { if (_check_errors || (_supports_debug && gl_debug)) { report_my_gl_errors(); } else { - static int frame_counter = -1; - // If _check_errors is false, we still want to check for errors - // the first few frames and once every N frames, so that we know if - // anything went wrong at all. - if (frame_counter++ <= 0) { + // once every second, so that we know if anything went wrong at all. + double current = ClockObject::get_global_clock()->get_frame_time(); + + if (current - _last_error_check >= 1.0) { + _last_error_check = current; PStatTimer timer(_check_error_pcollector); GLenum error_code = glGetError(); @@ -3334,9 +3338,6 @@ end_frame(Thread *current_thread) { panic_deactivate(); } } - } else if (frame_counter > 100) { - // 100 frames have passed. Check next frame. - frame_counter = 0; } } #endif diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index ff8044d324..a2a519d109 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -648,8 +648,6 @@ protected: bool _supports_depth32; #endif - int _error_count; - string _gl_vendor; string _gl_renderer; string _gl_version; @@ -917,6 +915,8 @@ public: //RenderState::SlotMask _inv_state_mask; + int _error_count; + double _last_error_check; bool _check_errors; bool _force_flush; bool _supports_debug; From f161ce82cc43e8dd8dbe4701b4bb2a5a3f1c0a2d Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 12 Aug 2015 18:29:54 +0200 Subject: [PATCH 130/203] Add argument names to quaternion classes so they show up in the API ref --- panda/src/linmath/lorientation_src.h | 10 +++++----- panda/src/linmath/lquaternion_src.h | 6 +++--- panda/src/linmath/lrotation_src.h | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/panda/src/linmath/lorientation_src.h b/panda/src/linmath/lorientation_src.h index 350922667f..7c4e33d0a7 100644 --- a/panda/src/linmath/lorientation_src.h +++ b/panda/src/linmath/lorientation_src.h @@ -21,11 +21,11 @@ class FLOATNAME(LRotation); class EXPCL_PANDA_LINMATH FLOATNAME(LOrientation) : public FLOATNAME(LQuaternion) { PUBLISHED: INLINE_LINMATH FLOATNAME(LOrientation)(); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LQuaternion)&); - INLINE_LINMATH FLOATNAME(LOrientation)(FLOATTYPE, FLOATTYPE, FLOATTYPE, FLOATTYPE); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &, float); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix3) &); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &); + INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LQuaternion) &c); + INLINE_LINMATH FLOATNAME(LOrientation)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k); + INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &point_at, float twist); + INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix3) &m); + INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &m); INLINE_LINMATH FLOATNAME(LOrientation) operator * (const FLOATNAME(LRotation) &other) const; diff --git a/panda/src/linmath/lquaternion_src.h b/panda/src/linmath/lquaternion_src.h index 730c39e637..22b3f0bffe 100644 --- a/panda/src/linmath/lquaternion_src.h +++ b/panda/src/linmath/lquaternion_src.h @@ -20,10 +20,10 @@ class EXPCL_PANDA_LINMATH FLOATNAME(LQuaternion) : public FLOATNAME(LVecBase4) { PUBLISHED: INLINE_LINMATH FLOATNAME(LQuaternion)(); INLINE_LINMATH FLOATNAME(LQuaternion)(const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LQuaternion)(FLOATTYPE, const FLOATNAME(LVecBase3) ©); - INLINE_LINMATH FLOATNAME(LQuaternion)(FLOATTYPE, FLOATTYPE, FLOATTYPE, FLOATTYPE); + INLINE_LINMATH FLOATNAME(LQuaternion)(FLOATTYPE r, const FLOATNAME(LVecBase3) ©); + INLINE_LINMATH FLOATNAME(LQuaternion)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k); - static FLOATNAME(LQuaternion) pure_imaginary(const FLOATNAME(LVector3) &); + static FLOATNAME(LQuaternion) pure_imaginary(const FLOATNAME(LVector3) &v); INLINE_LINMATH FLOATNAME(LQuaternion) conjugate() const; diff --git a/panda/src/linmath/lrotation_src.h b/panda/src/linmath/lrotation_src.h index f71a53a3e5..374a0e17a1 100644 --- a/panda/src/linmath/lrotation_src.h +++ b/panda/src/linmath/lrotation_src.h @@ -19,13 +19,13 @@ class EXPCL_PANDA_LINMATH FLOATNAME(LRotation) : public FLOATNAME(LQuaternion) { PUBLISHED: INLINE_LINMATH FLOATNAME(LRotation)(); - INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LQuaternion) &); + INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LQuaternion) &c); INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE, FLOATTYPE, FLOATTYPE, FLOATTYPE); - INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LVector3) &, FLOATTYPE); - INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix3) &); - INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix4) &); - INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE, FLOATTYPE, FLOATTYPE); + INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k); + INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LVector3) &axis, FLOATTYPE angle); + INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix3) &m); + INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix4) &m); + INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE h, FLOATTYPE p, FLOATTYPE r); INLINE_LINMATH FLOATNAME(LRotation) operator * (FLOATTYPE scalar) const; INLINE_LINMATH FLOATNAME(LRotation) operator / (FLOATTYPE scalar) const; From 9b93b8a030e61c7a45225cd6339c5ecd63ff98b7 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 13 Aug 2015 01:59:07 +0200 Subject: [PATCH 131/203] python-pmw shouldn't be a dependency, merely a recommendency --- makepanda/makepanda.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index f72103f017..64c624100d 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6553,8 +6553,8 @@ def MakeInstallerLinux(): depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip() recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip() if PkgSkip("PYTHON")==0: - depends += ", " + PYTHONV + ", python-pmw" - recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-tk (>= " + PV + ")" + depends += ", " + PYTHONV + recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-pmw, python-tk (>= " + PV + ")" if PkgSkip("NVIDIACG")==0: depends += ", nvidia-cg-toolkit" From 9fdc2d82d143c34ec2aa975d1eb10d84b20728aa Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Thu, 13 Aug 2015 10:58:51 -0500 Subject: [PATCH 132/203] Send libRocket key events before mouse events On Linux (at least), a key event is accompanied with a mouse position event. If a libRocket UI is listening to e.g. "mouseover" events, then any keypress will first appear to be a mouse movement, tripping up code that tries to handle focus with both keyboard and mouse support. This change merely dispatches key events before any mouse events to avoid this problem. --- panda/src/rocket/rocketInputHandler.cxx | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/panda/src/rocket/rocketInputHandler.cxx b/panda/src/rocket/rocketInputHandler.cxx index c0a4e22464..b734e59bef 100644 --- a/panda/src/rocket/rocketInputHandler.cxx +++ b/panda/src/rocket/rocketInputHandler.cxx @@ -302,30 +302,6 @@ void RocketInputHandler:: update_context(Rocket::Core::Context *context, int xoffs, int yoffs) { MutexHolder holder(_lock); - if (_mouse_xy_changed) { - _mouse_xy_changed = false; - - context->ProcessMouseMove(_mouse_xy.get_x() - xoffs, - _mouse_xy.get_y() - yoffs, _modifiers); - } - - if (_mouse_buttons.size() > 0) { - ButtonActivityMap::const_iterator it; - for (it = _mouse_buttons.begin(); it != _mouse_buttons.end(); ++it) { - if (it->second) { - context->ProcessMouseButtonDown(it->first, _modifiers); - } else { - context->ProcessMouseButtonUp(it->first, _modifiers); - } - } - _mouse_buttons.clear(); - } - - if (_wheel_delta != 0) { - context->ProcessMouseWheel(_wheel_delta, _modifiers); - _wheel_delta = 0; - } - if (_keys.size() > 0) { ButtonActivityMap::const_iterator it; for (it = _keys.begin(); it != _keys.end(); ++it) { @@ -356,5 +332,29 @@ update_context(Rocket::Core::Context *context, int xoffs, int yoffs) { _text_input.clear(); } + if (_mouse_xy_changed) { + _mouse_xy_changed = false; + + context->ProcessMouseMove(_mouse_xy.get_x() - xoffs, + _mouse_xy.get_y() - yoffs, _modifiers); + } + + if (_mouse_buttons.size() > 0) { + ButtonActivityMap::const_iterator it; + for (it = _mouse_buttons.begin(); it != _mouse_buttons.end(); ++it) { + if (it->second) { + context->ProcessMouseButtonDown(it->first, _modifiers); + } else { + context->ProcessMouseButtonUp(it->first, _modifiers); + } + } + _mouse_buttons.clear(); + } + + if (_wheel_delta != 0) { + context->ProcessMouseWheel(_wheel_delta, _modifiers); + _wheel_delta = 0; + } + context->Update(); } From 3e34233b1c86638c903c4574c7c7e0b5babf1e1c Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 14 Aug 2015 15:57:56 +0200 Subject: [PATCH 133/203] Implement extracted files for packp3d and pdeploy (only when used together) This also changes start_dir for pdeployed applications to point to the application directory, no longer to ~/.panda3d/start --- direct/src/p3d/DeploymentTools.py | 78 ++++++++-- direct/src/p3d/Packager.py | 4 + direct/src/p3d/packp3d.py | 10 ++ direct/src/plugin/load_plugin.cxx | 23 ++- direct/src/plugin/load_plugin.h | 6 +- direct/src/plugin/p3dAuthSession.cxx | 2 +- direct/src/plugin/p3dInstance.cxx | 2 +- direct/src/plugin/p3dInstanceManager.I | 12 ++ direct/src/plugin/p3dInstanceManager.cxx | 19 ++- direct/src/plugin/p3dInstanceManager.h | 5 +- direct/src/plugin/p3dSession.cxx | 2 +- direct/src/plugin/p3d_plugin.cxx | 9 +- direct/src/plugin/p3d_plugin.h | 5 +- direct/src/plugin_activex/PPInstance.cpp | 6 +- direct/src/plugin_npapi/ppInstance.cxx | 4 +- direct/src/plugin_standalone/p3dEmbed.cxx | 29 +++- direct/src/plugin_standalone/panda3d.cxx | 171 ++++++++++++--------- direct/src/plugin_standalone/panda3d.h | 1 + direct/src/plugin_standalone/panda3dBase.h | 1 + 19 files changed, 271 insertions(+), 118 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 5bb3f3a159..78b2378eda 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -444,6 +444,7 @@ class Installer: notify = directNotify.newCategory("Installer") def __init__(self, p3dfile, shortname, fullname, version, tokens = {}): + self.p3dFilename = p3dfile if not shortname: shortname = p3dfile.getBasenameWoExtension() self.shortname = shortname @@ -477,22 +478,16 @@ class Installer: if not self.authoremail and ' ' not in uname: self.authoremail = "%s@%s" % (uname, socket.gethostname()) - self.standalone = Standalone(p3dfile, tokens) - self.tempDir = Filename.temporary("", self.shortname, "") + "/" - self.tempDir.makeDir() - self.__tempRoots = {} - # Load the p3d file to read out the required packages mf = Multifile() - if not mf.openRead(p3dfile): + if not mf.openRead(self.p3dFilename): Installer.notify.error("Not a Panda3D application: %s" % (p3dfile)) return # Now load the p3dInfo file. - self.hostUrl = PandaSystem.getPackageHostUrl() - if not self.hostUrl: - self.hostUrl = self.standalone.host.hostUrl + self.hostUrl = None self.requires = [] + self.extracts = [] i = mf.findSubfile('p3d_info.xml') if i >= 0: stream = mf.openReadSubfile(i) @@ -511,14 +506,54 @@ class Installer: p3dRequires.Attribute('host'))) p3dRequires = p3dRequires.NextSiblingElement('requires') + p3dExtract = p3dPackage.FirstChildElement('extract') + while p3dExtract: + filename = p3dExtract.Attribute('filename') + self.extracts.append(filename) + p3dExtract = p3dExtract.NextSiblingElement('extract') + if not self.fullname: p3dConfig = p3dPackage.FirstChildElement('config') if p3dConfig: self.fullname = p3dConfig.Attribute('display_name') + else: + Installer.notify.warning("No p3d_info.xml was found in .p3d archive.") + + mf.close() + + if not self.hostUrl: + self.hostUrl = PandaSystem.getPackageHostUrl() + if not self.hostUrl: + self.hostUrl = self.standalone.host.hostUrl + Installer.notify.warning("No host URL was specified by .p3d archive. Falling back to %s" % (self.hostUrl)) if not self.fullname: self.fullname = self.shortname + self.tempDir = Filename.temporary("", self.shortname, "") + "/" + self.tempDir.makeDir() + self.__tempRoots = {} + + if self.extracts: + # Copy .p3d to a temporary file so we can remove the extracts. + p3dfile = Filename(self.tempDir, self.p3dFilename.getBasename()) + shutil.copyfile(self.p3dFilename.toOsSpecific(), p3dfile.toOsSpecific()) + mf = Multifile() + if not mf.openReadWrite(p3dfile): + Installer.notify.error("Failure to open %s for writing." % (p3dfile)) + + # We don't really need this silly thing when embedding, anyway. + mf.setHeaderPrefix("") + + for fn in self.extracts: + if not mf.removeSubfile(fn): + Installer.notify.error("Failure to remove %s from multifile." % (p3dfile)) + + mf.repack() + mf.close() + + self.standalone = Standalone(p3dfile, tokens) + def __del__(self): try: appRunner.rmtree(self.tempDir) @@ -533,6 +568,22 @@ class Installer: if not self.includeRequires: return + # Write out the extracts from the original .p3d. + if self.extracts: + mf = Multifile() + if not mf.openRead(self.p3dFilename): + Installer.notify.error("Failed to open .p3d archive: %s" % (filename)) + + for filename in self.extracts: + i = mf.findSubfile(filename) + if i < 0: + Installer.notify.error("Cannot find extract in .p3d archive: %s" % (filename)) + continue + + if not mf.extractSubfile(i, Filename(hostDir, filename)): + Installer.notify.error("Failed to extract file from .p3d archive: %s" % (filename)) + mf.close() + pkgTree = PackageTree(platform, hostDir, self.hostUrl) pkgTree.installPackage("images", None, self.standalone.host.hostUrl) @@ -660,7 +711,8 @@ class Installer: Filename(tempdir, "usr/bin/").makeDir() if self.includeRequires: - extraTokens = {"host_dir" : "/usr/lib/" + self.shortname.lower()} + extraTokens = {"host_dir" : "/usr/lib/" + self.shortname.lower(), + "start_dir" : "/usr/lib/" + self.shortname.lower()} else: extraTokens = {} self.standalone.build(Filename(tempdir, "usr/bin/" + self.shortname.lower()), platform, extraTokens) @@ -712,7 +764,7 @@ class Installer: print >>desktop, "Type=Application" desktop.close() - if self.includeRequires: + if self.includeRequires or self.extracts: hostDir = Filename(tempdir, "usr/lib/%s/" % self.shortname.lower()) hostDir.makeDir() self.installPackagesInto(hostDir, platform) @@ -853,7 +905,7 @@ class Installer: exefile = Filename(output, "Contents/MacOS/" + self.shortname) exefile.makeDir() if self.includeRequires: - extraTokens = {"host_dir" : "../Resources"} + extraTokens = {"host_dir": "../Resources", "start_dir": "../Resources"} else: extraTokens = {} self.standalone.build(exefile, platform, extraTokens) @@ -1064,7 +1116,7 @@ class Installer: exefile = Filename(Filename.getTempDirectory(), self.shortname + ".exe") exefile.unlink() if self.includeRequires: - extraTokens = {"host_dir" : "."} + extraTokens = {"host_dir": ".", "start_dir": "."} else: extraTokens = {} self.standalone.build(exefile, platform, extraTokens) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 40c30d8485..b0a44d7fa2 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -1496,6 +1496,10 @@ class Packager: xhost = he.makeXml(packager = self.packager) xpackage.InsertEndChild(xhost) + self.extracts.sort() + for name, xextract in self.extracts: + xpackage.InsertEndChild(xextract) + doc.InsertEndChild(xpackage) # Write the xml file to a temporary file on disk, so we diff --git a/direct/src/p3d/packp3d.py b/direct/src/p3d/packp3d.py index 3544022fd6..b26c6d5b22 100755 --- a/direct/src/p3d/packp3d.py +++ b/direct/src/p3d/packp3d.py @@ -57,6 +57,14 @@ Options: instead of -e for files that are uncompressible by their nature (e.g. mpg files). This option may be repeated as necessary. + -x ext + Marks files with the given extensions of needing to be physically + extracted to disk before they can be loaded. This is used for + file types that cannot be loaded via the virtual file system, + such as .ico files on Windows. + This option is currently only implemented when deploying the + application with pdeploy. + -p python_lib_dir Adds a directory to search for additional Python modules. You can use this to add your system's Python path, to allow packp3d @@ -134,6 +142,8 @@ def makePackedApp(args): packager.binaryExtensions.append(value) elif option == '-n': packager.uncompressibleExtensions.append(value) + elif option == '-x': + packager.extractExtensions.append(value) elif option == '-p': sys.path.append(value) elif option == '-c': diff --git a/direct/src/plugin/load_plugin.cxx b/direct/src/plugin/load_plugin.cxx index a9276b9e99..8a8e5ef179 100644 --- a/direct/src/plugin/load_plugin.cxx +++ b/direct/src/plugin/load_plugin.cxx @@ -140,7 +140,7 @@ load_plugin(const string &p3d_plugin_filename, const string &log_directory, const string &log_basename, bool trusted_environment, bool console_environment, const string &root_dir, const string &host_dir, - ostream &logfile) { + const string &start_dir, ostream &logfile) { if (plugin_loaded) { return true; } @@ -259,7 +259,7 @@ load_plugin(const string &p3d_plugin_filename, verify_contents, platform, log_directory, log_basename, trusted_environment, console_environment, - root_dir, host_dir, logfile)) { + root_dir, host_dir, start_dir, logfile)) { unload_dso(); return false; } @@ -283,7 +283,7 @@ init_plugin(const string &contents_filename, const string &host_url, const string &log_directory, const string &log_basename, bool trusted_environment, bool console_environment, const string &root_dir, const string &host_dir, - ostream &logfile) { + const string &start_dir, ostream &logfile) { // Ensure that all of the function pointers have been found. if (P3D_initialize_ptr == NULL || @@ -371,15 +371,26 @@ init_plugin(const string &contents_filename, const string &host_url, return false; } - if (!P3D_initialize_ptr(P3D_API_VERSION, contents_filename.c_str(), + // A bit of extra hand-hacked compatibility for using newer plug-ins + // with an older version of the core API. + int api_version = P3D_API_VERSION; + if (api_version == 17 && start_dir.empty()) { + api_version = 16; + if (host_dir.empty()) { + api_version = 15; + } + } + + if (!P3D_initialize_ptr(api_version, contents_filename.c_str(), host_url.c_str(), verify_contents, platform.c_str(), log_directory.c_str(), log_basename.c_str(), trusted_environment, console_environment, - root_dir.c_str(), host_dir.c_str())) { + root_dir.c_str(), host_dir.c_str(), + start_dir.c_str())) { // Oops, failure to initialize. logfile << "Failed to initialize plugin (passed API version " - << P3D_API_VERSION << ")\n"; + << api_version << ")\n"; return false; } diff --git a/direct/src/plugin/load_plugin.h b/direct/src/plugin/load_plugin.h index 985eef7261..f9f89565e5 100644 --- a/direct/src/plugin/load_plugin.h +++ b/direct/src/plugin/load_plugin.h @@ -67,13 +67,15 @@ load_plugin(const string &p3d_plugin_filename, P3D_verify_contents verify_contents, const string &platform, const string &log_directory, const string &log_basename, bool trusted_environment, bool console_environment, - const string &root_dir, const string &host_dir, ostream &logfile); + const string &root_dir, const string &host_dir, + const string &start_dir, ostream &logfile); bool init_plugin(const string &contents_filename, const string &host_url, P3D_verify_contents verify_contents, const string &platform, const string &log_directory, const string &log_basename, bool trusted_environment, bool console_environment, - const string &root_dir, const string &host_dir, ostream &logfile); + const string &root_dir, const string &host_dir, + const string &start_dir, ostream &logfile); void unload_plugin(ostream &logfile); bool is_plugin_loaded(); diff --git a/direct/src/plugin/p3dAuthSession.cxx b/direct/src/plugin/p3dAuthSession.cxx index 6130119223..103c372f0a 100644 --- a/direct/src/plugin/p3dAuthSession.cxx +++ b/direct/src/plugin/p3dAuthSession.cxx @@ -163,7 +163,7 @@ start_p3dcert() { P3DInstanceManager *inst_mgr = P3DInstanceManager::get_global_ptr(); - _start_dir = inst_mgr->get_root_dir() + "/start"; + _start_dir = inst_mgr->get_start_dir(); string root_dir = _inst->_p3dcert_package->get_package_dir(); mkdir_complete(_start_dir, nout); diff --git a/direct/src/plugin/p3dInstance.cxx b/direct/src/plugin/p3dInstance.cxx index d81a271d1e..3f84bb441e 100644 --- a/direct/src/plugin/p3dInstance.cxx +++ b/direct/src/plugin/p3dInstance.cxx @@ -1564,7 +1564,7 @@ uninstall_packages() { if (inst_mgr->get_verify_contents() != P3D_VC_never) { string start_dir_suffix = get_start_dir_suffix(); if (!start_dir_suffix.empty()) { - string start_dir = inst_mgr->get_root_dir() + "/start" + start_dir_suffix; + string start_dir = inst_mgr->get_start_dir() + start_dir_suffix; nout << "Cleaning up start directory " << start_dir << "\n"; inst_mgr->delete_directory_recursively(start_dir); } diff --git a/direct/src/plugin/p3dInstanceManager.I b/direct/src/plugin/p3dInstanceManager.I index caadc083b3..af5b6de16c 100644 --- a/direct/src/plugin/p3dInstanceManager.I +++ b/direct/src/plugin/p3dInstanceManager.I @@ -111,6 +111,18 @@ get_root_dir() const { return _root_dir; } +//////////////////////////////////////////////////////////////////// +// Function: P3DInstanceManager::get_start_dir +// Access: Public +// Description: Returns the directory that the .p3d file should be +// mounted to and run from. This is usually the +// "start" subdirectory of the root_dir. +//////////////////////////////////////////////////////////////////// +inline const string &P3DInstanceManager:: +get_start_dir() const { + return _start_dir; +} + //////////////////////////////////////////////////////////////////// // Function: P3DInstanceManager::get_platform // Access: Public diff --git a/direct/src/plugin/p3dInstanceManager.cxx b/direct/src/plugin/p3dInstanceManager.cxx index 793e6cf36e..fa8c70def2 100644 --- a/direct/src/plugin/p3dInstanceManager.cxx +++ b/direct/src/plugin/p3dInstanceManager.cxx @@ -201,7 +201,8 @@ initialize(int api_version, const string &contents_filename, const string &platform, const string &log_directory, const string &log_basename, bool trusted_environment, bool console_environment, - const string &root_dir, const string &host_dir) { + const string &root_dir, const string &host_dir, + const string &start_dir) { _api_version = api_version; _host_url = host_url; _verify_contents = verify_contents; @@ -298,12 +299,18 @@ initialize(int api_version, const string &contents_filename, } else { _root_dir = root_dir; } - + _host_dir = host_dir; + if (start_dir.empty()) { + _start_dir = _root_dir + "/start"; + } else { + _start_dir = start_dir; + } + // Allow the caller (e.g. panda3d.exe) to specify a log directory. // Or, allow the developer to compile one in. - + // // Failing that, we write logfiles to Panda3D/log. if (_log_directory.empty()) { _log_directory = _root_dir + "/log"; @@ -1515,8 +1522,10 @@ create_runtime_environment() { // Make the certificate directory. _certs_dir = _root_dir + "/certs"; - if (!mkdir_complete(_certs_dir, nout)) { - nout << "Couldn't mkdir " << _certs_dir << "\n"; + if (!get_trusted_environment()) { + if (!mkdir_complete(_certs_dir, nout)) { + nout << "Couldn't mkdir " << _certs_dir << "\n"; + } } _created_runtime_environment = true; diff --git a/direct/src/plugin/p3dInstanceManager.h b/direct/src/plugin/p3dInstanceManager.h index 78cfcfbdce..b051c01310 100644 --- a/direct/src/plugin/p3dInstanceManager.h +++ b/direct/src/plugin/p3dInstanceManager.h @@ -59,7 +59,8 @@ public: bool trusted_environment, bool console_environment, const string &root_dir = "", - const string &host_dir = ""); + const string &host_dir = "", + const string &start_dir = ""); inline bool is_initialized() const; inline void reconsider_runtime_environment(); @@ -69,6 +70,7 @@ public: inline int get_api_version() const; inline const string &get_host_url() const; inline const string &get_root_dir() const; + inline const string &get_start_dir() const; inline const string &get_platform() const; inline const string &get_temp_directory() const; inline const string &get_log_directory() const; @@ -173,6 +175,7 @@ private: string _host_url; string _root_dir; string _host_dir; + string _start_dir; string _certs_dir; P3D_verify_contents _verify_contents; string _platform; diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index e0b9c73f08..3e6189ce4d 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -717,7 +717,7 @@ start_p3dpython(P3DInstance *inst) { _keep_user_env = true; } if (!_keep_user_env) { - _start_dir = inst_mgr->get_root_dir() + "/start" + inst->get_start_dir_suffix(); + _start_dir = inst_mgr->get_start_dir() + inst->get_start_dir_suffix(); mkdir_complete(_start_dir, nout); } replace_slashes(_start_dir); diff --git a/direct/src/plugin/p3d_plugin.cxx b/direct/src/plugin/p3d_plugin.cxx index 8641a72121..241a59d253 100644 --- a/direct/src/plugin/p3d_plugin.cxx +++ b/direct/src/plugin/p3d_plugin.cxx @@ -39,7 +39,8 @@ P3D_initialize(int api_version, const char *contents_filename, const char *platform, const char *log_directory, const char *log_basename, bool trusted_environment, bool console_environment, - const char *root_dir, const char *host_dir) { + const char *root_dir, const char *host_dir, + const char *start_dir) { if (api_version < 10 || api_version > P3D_API_VERSION) { // Can't accept an incompatible version. return false; @@ -89,12 +90,16 @@ P3D_initialize(int api_version, const char *contents_filename, host_dir = ""; } + if (api_version < 17 || start_dir == NULL) { + start_dir = ""; + } + P3DInstanceManager *inst_mgr = P3DInstanceManager::get_global_ptr(); bool result = inst_mgr->initialize(api_version, contents_filename, host_url, verify_contents, platform, log_directory, log_basename, trusted_environment, console_environment, - root_dir, host_dir); + root_dir, host_dir, start_dir); RELEASE_LOCK(_api_lock); return result; } diff --git a/direct/src/plugin/p3d_plugin.h b/direct/src/plugin/p3d_plugin.h index e053e6e21b..916763c036 100644 --- a/direct/src/plugin/p3d_plugin.h +++ b/direct/src/plugin/p3d_plugin.h @@ -79,7 +79,7 @@ extern "C" { (below). This number will be incremented whenever there are changes to any of the interface specifications defined in this header file. */ -#define P3D_API_VERSION 16 +#define P3D_API_VERSION 17 /************************ GLOBAL FUNCTIONS **************************/ @@ -161,7 +161,8 @@ P3D_initialize_func(int api_version, const char *contents_filename, const char *platform, const char *log_directory, const char *log_basename, bool trusted_environment, bool console_environment, - const char *root_dir, const char *host_dir); + const char *root_dir, const char *host_dir, + const char *start_dir); /* This function should be called to unload the core API. It will release all internally-allocated memory and return the core API to diff --git a/direct/src/plugin_activex/PPInstance.cpp b/direct/src/plugin_activex/PPInstance.cpp index a0984a27f6..2151fc63f1 100644 --- a/direct/src/plugin_activex/PPInstance.cpp +++ b/direct/src/plugin_activex/PPInstance.cpp @@ -581,12 +581,12 @@ int PPInstance::LoadPlugin( const std::string& dllFilename ) pathname = override_filename; } #endif // P3D_PLUGIN_P3D_PLUGIN - + nout << "Attempting to load core API from " << pathname << "\n"; string contents_filename = m_rootDir + "/contents.xml"; if (!load_plugin(pathname, contents_filename, PANDA_PACKAGE_HOST_URL, - P3D_VC_normal, "", "", "", false, false, - m_rootDir, "", nout)) { + P3D_VC_normal, "", "", "", false, false, + m_rootDir, "", "", nout)) { nout << "Unable to launch core API in " << pathname << "\n"; error = 1; } else { diff --git a/direct/src/plugin_npapi/ppInstance.cxx b/direct/src/plugin_npapi/ppInstance.cxx index 55b9757a04..209204652d 100644 --- a/direct/src/plugin_npapi/ppInstance.cxx +++ b/direct/src/plugin_npapi/ppInstance.cxx @@ -1738,8 +1738,8 @@ do_load_plugin() { nout << "Attempting to load core API from " << pathname << "\n"; string contents_filename = _root_dir + "/contents.xml"; if (!load_plugin(pathname, contents_filename, PANDA_PACKAGE_HOST_URL, - P3D_VC_normal, "", "", "", false, false, - _root_dir, "", nout)) { + P3D_VC_normal, "", "", "", false, false, + _root_dir, "", "", nout)) { nout << "Unable to launch core API in " << pathname << "\n"; set_failed(); return; diff --git a/direct/src/plugin_standalone/p3dEmbed.cxx b/direct/src/plugin_standalone/p3dEmbed.cxx index 4ee1ff31ca..a09c13423b 100644 --- a/direct/src/plugin_standalone/p3dEmbed.cxx +++ b/direct/src/plugin_standalone/p3dEmbed.cxx @@ -53,7 +53,8 @@ run_embedded(streampos read_offset, int argc, char *argv[]) { // the + 1 from the test. _read_offset_check = read_offset + (streampos)1; if (_read_offset_check == (streampos)0xFF3D3D01) { - cerr << "This program is not intended to be run directly.\nIt is used by pdeploy to construct an embedded Panda3D application.\n"; + cerr << "This program is not intended to be run directly.\nIt is used " + "by pdeploy to construct an embedded Panda3D application.\n"; return 1; } @@ -86,22 +87,30 @@ run_embedded(streampos read_offset, int argc, char *argv[]) { string value; string root_dir; string host_dir; + string start_dir; + while (true) { if (curchr == EOF) { cerr << "Truncated stream\n"; - return(1); + return 1; } else if (curchr == 0) { // Two null bytes in a row means we've reached the end of the data. if (havenull) { break; } - + // This means we haven't seen an '=' character yet. if (keyword == "") { if (curstr != "") { cerr << "Ignoring token '" << curstr << "' without value\n"; } + + } else if (keyword == "start_dir") { + // Don't pass this on as a token, since it has slightly different + // semantics when used as an HTML token. + start_dir = curstr; + } else { value.assign(curstr); P3D_token token; @@ -118,6 +127,8 @@ run_embedded(streampos read_offset, int argc, char *argv[]) { _got_win_size = true; } else if (keyword == "log_basename") { _log_basename = value; + } else if (keyword == "log_directory") { + _log_dirname = value; } else if (keyword == "root_dir") { root_dir = value; } else if (keyword == "host_dir") { @@ -168,6 +179,13 @@ run_embedded(streampos read_offset, int argc, char *argv[]) { _host_dir = host_dir_f.to_os_specific(); } + // Make the start directory absolute + if (!start_dir.empty()) { + Filename start_dir_f(start_dir); + start_dir_f.make_absolute(f.get_dirname()); + _start_dir = start_dir_f.to_os_specific(); + } + // Initialize the core API by directly assigning all of the function // pointers. P3D_initialize_ptr = &P3D_initialize; @@ -229,18 +247,17 @@ run_embedded(streampos read_offset, int argc, char *argv[]) { // function pointers. This will also call P3D_initialize(). if (!init_plugin("", _host_url, _verify_contents, _this_platform, _log_dirname, _log_basename, true, _console_environment, - _root_dir, _host_dir, cerr)) { + _root_dir, _host_dir, _start_dir, cerr)) { cerr << "Unable to launch core API\n"; return 1; } - + // Create a plugin instance and run the program P3D_instance *inst = create_instance(f, true, argv, argc, read_offset); _instances.insert(inst); run_main_loop(); - unload_plugin(cerr); return 0; } diff --git a/direct/src/plugin_standalone/panda3d.cxx b/direct/src/plugin_standalone/panda3d.cxx index ab0219f7cf..fd0d2f44b7 100644 --- a/direct/src/plugin_standalone/panda3d.cxx +++ b/direct/src/plugin_standalone/panda3d.cxx @@ -690,7 +690,6 @@ choose_random_mirrors(vector_string &result, int num_mirrors) { } } - //////////////////////////////////////////////////////////////////// // Function: Panda3D::get_core_api // Access: Protected @@ -700,78 +699,12 @@ choose_random_mirrors(vector_string &result, int num_mirrors) { //////////////////////////////////////////////////////////////////// bool Panda3D:: get_core_api() { + bool is_fresh = false; if (!_coreapi_dll.quick_verify(_root_dir)) { - // The DLL file needs to be downloaded. Build up our list of - // URL's to attempt to download it from, in reverse order. - string url; - vector_string core_urls; - - // Our last act of desperation: hit the original host, with a - // query uniquifier, to break through any caches. - ostringstream strm; - strm << _download_url_prefix << _coreapi_dll.get_filename() - << "?" << time(NULL); - url = strm.str(); - core_urls.push_back(url); - - // Before we try that, we'll hit the original host, without a - // uniquifier. - url = _download_url_prefix; - url += _coreapi_dll.get_filename(); - core_urls.push_back(url); - - // And before we try that, we'll try two mirrors, at random. - vector_string mirrors; - choose_random_mirrors(mirrors, 2); - for (vector_string::iterator si = mirrors.begin(); - si != mirrors.end(); - ++si) { - url = (*si) + _coreapi_dll.get_filename(); - core_urls.push_back(url); - } - - // The very first thing we'll try is the super_mirror, if we have - // one. - if (!_super_mirror_url_prefix.empty()) { - url = _super_mirror_url_prefix + _coreapi_dll.get_filename(); - core_urls.push_back(url); - } - - // Now pick URL's off the list, and try them, until we have - // success. - Filename pathname = Filename::from_os_specific(_coreapi_dll.get_pathname(_root_dir)); - pathname.make_dir(); - HTTPClient *http = HTTPClient::get_global_ptr(); - - bool success = false; - while (!core_urls.empty()) { - url = core_urls.back(); - core_urls.pop_back(); - - PT(HTTPChannel) channel = http->get_document(url); - if (!channel->download_to_file(pathname)) { - cerr << "Unable to download " << url << "\n"; - - } else if (!_coreapi_dll.full_verify(_root_dir)) { - cerr << "Mismatched download for " << url << "\n"; - - } else { - // successfully downloaded! - success = true; - break; - } - } - - if (!success) { - cerr << "Couldn't download core API.\n"; + if (!download_core_api()) { return false; } - - // Since we had to download some of it, might as well ask the core - // API to check all of it. - if (_verify_contents == P3D_VC_none) { - _verify_contents = P3D_VC_normal; - } + is_fresh = true; } // Now we've got the DLL. Load it. @@ -795,9 +728,19 @@ get_core_api() { if (!load_plugin(pathname, contents_filename.to_os_specific(), _host_url, _verify_contents, _this_platform, _log_dirname, _log_basename, trusted_environment, _console_environment, - _root_dir, "", cerr)) { - cerr << "Unable to launch core API in " << pathname << "\n"; - return false; + _root_dir, _host_dir, _start_dir, cerr)) { + + // If we're not sure this is the latest version, make sure it is + // up-to-date, and then try again. + if (is_fresh || !download_core_api() || + !load_plugin(pathname, contents_filename.to_os_specific(), + _host_url, _verify_contents, _this_platform, _log_dirname, + _log_basename, trusted_environment, _console_environment, + _root_dir, _host_dir, _start_dir, cerr)) { + + cerr << "Unable to launch core API in " << pathname << "\n"; + return false; + } } // Successfully loaded. @@ -822,6 +765,88 @@ get_core_api() { return true; } +//////////////////////////////////////////////////////////////////// +// Function: Panda3D::download_core_api +// Access: Protected +// Description: Downloads the latest version of the core API from +// the plug-in server. +//////////////////////////////////////////////////////////////////// +bool Panda3D:: +download_core_api() { + // The DLL file needs to be downloaded. Build up our list of + // URL's to attempt to download it from, in reverse order. + string url; + vector_string core_urls; + + // Our last act of desperation: hit the original host, with a + // query uniquifier, to break through any caches. + ostringstream strm; + strm << _download_url_prefix << _coreapi_dll.get_filename() + << "?" << time(NULL); + url = strm.str(); + core_urls.push_back(url); + + // Before we try that, we'll hit the original host, without a + // uniquifier. + url = _download_url_prefix; + url += _coreapi_dll.get_filename(); + core_urls.push_back(url); + + // And before we try that, we'll try two mirrors, at random. + vector_string mirrors; + choose_random_mirrors(mirrors, 2); + for (vector_string::iterator si = mirrors.begin(); + si != mirrors.end(); + ++si) { + url = (*si) + _coreapi_dll.get_filename(); + core_urls.push_back(url); + } + + // The very first thing we'll try is the super_mirror, if we have + // one. + if (!_super_mirror_url_prefix.empty()) { + url = _super_mirror_url_prefix + _coreapi_dll.get_filename(); + core_urls.push_back(url); + } + + // Now pick URL's off the list, and try them, until we have + // success. + Filename pathname = Filename::from_os_specific(_coreapi_dll.get_pathname(_root_dir)); + pathname.make_dir(); + HTTPClient *http = HTTPClient::get_global_ptr(); + + bool success = false; + while (!core_urls.empty()) { + url = core_urls.back(); + core_urls.pop_back(); + + PT(HTTPChannel) channel = http->get_document(url); + if (!channel->download_to_file(pathname)) { + cerr << "Unable to download " << url << "\n"; + + } else if (!_coreapi_dll.full_verify(_root_dir)) { + cerr << "Mismatched download for " << url << "\n"; + + } else { + // successfully downloaded! + success = true; + break; + } + } + + if (!success) { + cerr << "Couldn't download core API.\n"; + return false; + } + + // Since we had to download some of it, might as well ask the core + // API to check all of it. + if (_verify_contents == P3D_VC_none) { + _verify_contents = P3D_VC_normal; + } + return true; +} + //////////////////////////////////////////////////////////////////// // Function: Panda3D::usage // Access: Protected diff --git a/direct/src/plugin_standalone/panda3d.h b/direct/src/plugin_standalone/panda3d.h index 36603b93e6..94efc0c41f 100644 --- a/direct/src/plugin_standalone/panda3d.h +++ b/direct/src/plugin_standalone/panda3d.h @@ -48,6 +48,7 @@ protected: void add_mirror(string mirror_url); void choose_random_mirrors(vector_string &result, int num_mirrors); bool get_core_api(); + bool download_core_api(); void usage(); diff --git a/direct/src/plugin_standalone/panda3dBase.h b/direct/src/plugin_standalone/panda3dBase.h index 0f577f39fe..f53e59b14c 100644 --- a/direct/src/plugin_standalone/panda3dBase.h +++ b/direct/src/plugin_standalone/panda3dBase.h @@ -74,6 +74,7 @@ protected: string _host_url; string _root_dir; string _host_dir; + string _start_dir; string _log_dirname; string _log_basename; string _this_platform; From 6b7cbc5f2fe746a2600c3f1c9f819b4d52a6b12c Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 16 Aug 2015 13:51:25 +0200 Subject: [PATCH 134/203] Fix issue running makepanda on German computers --- makepanda/makepandacore.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 3d45411016..7b1770fe77 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -2290,6 +2290,9 @@ def SetupBuildEnvironment(compiler): print("Target OS: %s" % GetTarget()) print("Target arch: %s" % GetTargetArch()) + # Set to English so we can safely parse the result of gcc commands. + os.environ["LC_ALL"] = "C" + if compiler == "MSVC": # Add the visual studio tools to PATH et al. SetupVisualStudioEnviron() From e178ca4c9bed35a026d8a64b735d7abe25f4bce3 Mon Sep 17 00:00:00 2001 From: tobspr Date: Sun, 16 Aug 2015 10:45:59 +0200 Subject: [PATCH 135/203] Fix missing imports in showbase when using sticky keys (was broken with commit 0aa0f34c7498131ab67077be83be3c93a0e9ca83) --- direct/src/showbase/ShowBase.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 9ab3184d6a..e6c0f623e4 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -9,6 +9,8 @@ __all__ = ['ShowBase', 'WindowControls'] from panda3d.core import * from panda3d.direct import get_config_showbase, throw_new_frame, init_app_for_gui +from panda3d.direct import storeAccessibilityShortcutKeys, allowAccessibilityShortcutKeys + # This needs to be available early for DirectGUI imports import __builtin__ as builtins From 1c1efa7f17981ee559f150effbc444878e1077f4 Mon Sep 17 00:00:00 2001 From: tobspr Date: Sat, 15 Aug 2015 21:35:18 +0200 Subject: [PATCH 136/203] Fix Texture:estimate_texture_memory() --- panda/src/gobj/texture.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index e2cd069a75..4131da068c 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -502,11 +502,14 @@ estimate_texture_memory() const { case Texture::F_green: case Texture::F_blue: case Texture::F_luminance: + case Texture::F_sluminance: + bpp = 1; + break; + case Texture::F_luminance_alpha: case Texture::F_luminance_alphamask: - case Texture::F_sluminance: case Texture::F_sluminance_alpha: - bpp = 4; + bpp = 2; break; case Texture::F_rgba: @@ -529,13 +532,16 @@ estimate_texture_memory() const { break; case Texture::F_depth_stencil: + bpp = 4; + break; + case Texture::F_depth_component: - bpp = 32; + bpp = 2; break; case Texture::F_rgba12: case Texture::F_rgb12: - bpp = 6; + bpp = 8; break; case Texture::F_rgba16: @@ -554,7 +560,7 @@ estimate_texture_memory() const { bpp = 4; break; case Texture::F_rgb16: - bpp = 6; + bpp = 8; break; case Texture::F_r32i: From 2ea3e3f65a6454f003cae25f441df451a185be63 Mon Sep 17 00:00:00 2001 From: tobspr Date: Sun, 16 Aug 2015 08:29:14 +0200 Subject: [PATCH 137/203] Fix occasional crash when connecting to pstats --- panda/src/display/graphicsStateGuardian.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index ee69ed5fba..9fbe8b9606 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1960,7 +1960,7 @@ flush_timer_queries() { if (_pending_timer_queries[i]->is_answer_ready()) { first = count; - while (i < count) { + while (i < count - 1) { if (!_pending_timer_queries[++i]->is_answer_ready()) { first = i; break; From 9868d8719696b49646a5ff8d667ae25baf465f2e Mon Sep 17 00:00:00 2001 From: tobspr Date: Sat, 15 Aug 2015 21:09:53 +0200 Subject: [PATCH 138/203] Add Texture::F_r11_g11_b10 --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 15 +++++++++++++++ panda/src/gobj/texture.cxx | 12 ++++++++++++ panda/src/gobj/texture.h | 3 +++ 3 files changed, 30 insertions(+) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index b552d1dec7..f1fafe212a 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -7763,6 +7763,7 @@ get_external_image_format(Texture *tex) const { case Texture::F_depth_component24: case Texture::F_depth_component32: case Texture::F_depth_stencil: + case Texture::F_r11_g11_b10: // This shouldn't be possible. nassertr(false, GL_RGB); break; @@ -7946,6 +7947,7 @@ get_external_image_format(Texture *tex) const { case Texture::F_rgb16: case Texture::F_rgb32: case Texture::F_srgb: + case Texture::F_r11_g11_b10: #ifdef OPENGLES return GL_RGB; #else @@ -8044,6 +8046,7 @@ get_internal_image_format(Texture *tex, bool force_sized) const { case Texture::F_rgb8i: case Texture::F_rgba8i: case Texture::F_r32i: + case Texture::F_r11_g11_b10: // Unsupported; fall through to below. break; @@ -8536,6 +8539,11 @@ get_internal_image_format(Texture *tex, bool force_sized) const { return GL_R32I; #endif +#ifndef OPENGLES + case Texture::F_r11_g11_b10: + return GL_R11F_G11F_B10F; +#endif + default: GLCAT.error() << "Invalid image format in get_internal_image_format(): " @@ -12105,6 +12113,13 @@ do_extract_texture_data(CLP(TextureContext) *gtc) { break; #endif +#ifndef OPENGLES + case GL_R11F_G11F_B10F: + type = Texture::T_float; + format = Texture::F_r11_g11_b10; + break; +#endif + #ifdef OPENGLES_2 case GL_RED_EXT: case GL_R8_EXT: diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 37bdce45c9..5ae858a926 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -577,6 +577,10 @@ estimate_texture_memory() const { bpp = 12; break; + case Texture::F_r11_g11_b10: + bpp = 4; + break; + default: break; } @@ -1701,6 +1705,9 @@ write(ostream &out, int indent_level) const { case F_rgba8i: out << "rgba8i"; break; + case F_r11_g11_b10: + out << "r11_g11_b10"; + break; } if (cdata->_compression != CM_default) { @@ -2115,6 +2122,8 @@ format_format(Format format) { return "rgb8i"; case F_rgba8i: return "rgba8i"; + case F_r11_g11_b10: + return "r11g11b10"; } return "**invalid**"; } @@ -2201,6 +2210,8 @@ string_format(const string &str) { return F_rg32; } else if (cmp_nocase(str, "rgb32") == 0 || cmp_nocase(str, "r32g32b32") == 0) { return F_rgb32; + } else if (cmp_nocase(str, "r11g11b10") == 0) { + return F_r11_g11_b10; } gobj_cat->error() @@ -5181,6 +5192,7 @@ do_set_format(CData *cdata, Texture::Format format) { case F_srgb: case F_rgb32: case F_rgb8i: + case F_r11_g11_b10: cdata->_num_components = 3; break; diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index 729f3671ec..adfc8258bd 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -156,6 +156,9 @@ PUBLISHED: F_rg8i, // 8 integer bits per R,G channel F_rgb8i, // 8 integer bits per R,G,B channel F_rgba8i, // 8 integer bits per R,G,B,A channel + + F_r11_g11_b10, // unsigned floating-point, 11 Red, 11 Green, 10 Blue Bits + }; // Deprecated. See SamplerState.FilterType. From 7ed146a4bf1d8c291e5d23866fdbcc76b33805b0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 17 Aug 2015 21:34:10 +0200 Subject: [PATCH 139/203] Check environment var names case-insensitively on Windows to avoid PATH vs Path variable conflict --- direct/src/plugin/p3dSession.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index 3e6189ce4d..2d6f8b8e94 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -928,7 +928,11 @@ start_p3dpython(P3DInstance *inst) { const char *varc = var.c_str(); bool found = false; for (int i = 0; dont_keep[i] != NULL && !found; ++i) { +#ifdef _WIN32 + found = (_stricmp(dont_keep[i], varc) == 0); +#else found = (strcmp(dont_keep[i], varc) == 0); +#endif } if (!found) { // This variable is OK, keep it. From f14f7d19136db15c4a27ebcfab53daa48c46c75a Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 18 Aug 2015 17:46:38 +0200 Subject: [PATCH 140/203] Add missing 'os' module import --- direct/src/stdpy/file.py | 1 + 1 file changed, 1 insertion(+) diff --git a/direct/src/stdpy/file.py b/direct/src/stdpy/file.py index 25f5b6e1a1..a3e114738c 100644 --- a/direct/src/stdpy/file.py +++ b/direct/src/stdpy/file.py @@ -13,6 +13,7 @@ __all__ = [ from panda3d import core import sys import types +import os _vfs = core.VirtualFileSystem.getGlobalPtr() From 7fa0d3c60aa853adc67a5c8574030ee3595a8236 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 20 Aug 2015 18:58:13 +0200 Subject: [PATCH 141/203] Fix bug #1457688: libRocket elements show solid white in tinydisplay --- panda/src/pgraph/renderState.cxx | 25 ++++++++++++++++++++++ panda/src/pgraph/renderState.h | 5 +++++ panda/src/rocket/rocketRenderInterface.cxx | 4 +++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/panda/src/pgraph/renderState.cxx b/panda/src/pgraph/renderState.cxx index a7cf3ecddc..f41ad4c4ef 100644 --- a/panda/src/pgraph/renderState.cxx +++ b/panda/src/pgraph/renderState.cxx @@ -352,6 +352,31 @@ make(const RenderAttrib *attrib1, return return_new(state); } +//////////////////////////////////////////////////////////////////// +// Function: RenderState::make +// Access: Published, Static +// Description: Returns a RenderState with five attributes set. +//////////////////////////////////////////////////////////////////// +CPT(RenderState) RenderState:: +make(const RenderAttrib *attrib1, + const RenderAttrib *attrib2, + const RenderAttrib *attrib3, + const RenderAttrib *attrib4, + const RenderAttrib *attrib5, int override) { + RenderState *state = new RenderState; + state->_attributes[attrib1->get_slot()].set(attrib1, override); + state->_attributes[attrib2->get_slot()].set(attrib2, override); + state->_attributes[attrib3->get_slot()].set(attrib3, override); + state->_attributes[attrib4->get_slot()].set(attrib4, override); + state->_attributes[attrib5->get_slot()].set(attrib5, override); + state->_filled_slots.set_bit(attrib1->get_slot()); + state->_filled_slots.set_bit(attrib2->get_slot()); + state->_filled_slots.set_bit(attrib3->get_slot()); + state->_filled_slots.set_bit(attrib4->get_slot()); + state->_filled_slots.set_bit(attrib5->get_slot()); + return return_new(state); +} + //////////////////////////////////////////////////////////////////// // Function: RenderState::make // Access: Published, Static diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index e1bc57d632..d3738849a7 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -87,6 +87,11 @@ PUBLISHED: const RenderAttrib *attrib2, const RenderAttrib *attrib3, const RenderAttrib *attrib4, int override = 0); + static CPT(RenderState) make(const RenderAttrib *attrib1, + const RenderAttrib *attrib2, + const RenderAttrib *attrib3, + const RenderAttrib *attrib4, + const RenderAttrib *attrib5, int override = 0); static CPT(RenderState) make(const RenderAttrib * const *attrib, int num_attribs, int override = 0); diff --git a/panda/src/rocket/rocketRenderInterface.cxx b/panda/src/rocket/rocketRenderInterface.cxx index c3d7af2ffa..90304cda3b 100644 --- a/panda/src/rocket/rocketRenderInterface.cxx +++ b/panda/src/rocket/rocketRenderInterface.cxx @@ -20,6 +20,7 @@ #include "internalName.h" #include "geomVertexWriter.h" #include "geomTriangles.h" +#include "colorAttrib.h" #include "colorBlendAttrib.h" #include "cullBinAttrib.h" #include "depthTestAttrib.h" @@ -49,7 +50,8 @@ render(Rocket::Core::Context* context, CullTraverser *trav) { ColorBlendAttrib::make(ColorBlendAttrib::M_add, ColorBlendAttrib::O_incoming_alpha, ColorBlendAttrib::O_one_minus_incoming_alpha - ) + ), + ColorAttrib::make_vertex() ); _dimensions = context->GetDimensions(); From a359ef8a0b8875dcf3c26ead010aad381ae91774 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 20 Aug 2015 21:04:32 +0200 Subject: [PATCH 142/203] Clamp colors to 0-1 range in tinydisplay --- panda/src/tinydisplay/clip.cxx | 18 ++++++++--------- .../tinydisplay/tinyGraphicsStateGuardian.cxx | 20 +++++++++++-------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/panda/src/tinydisplay/clip.cxx b/panda/src/tinydisplay/clip.cxx index ca1f7930d7..da20a86adc 100644 --- a/panda/src/tinydisplay/clip.cxx +++ b/panda/src/tinydisplay/clip.cxx @@ -42,15 +42,15 @@ void gl_transform_to_viewport(GLContext *c,GLVertex *v) } /* color */ - v->zp.r=(int)(v->color.v[0] * (ZB_POINT_RED_MAX - ZB_POINT_RED_MIN) - + ZB_POINT_RED_MIN); - v->zp.g=(int)(v->color.v[1] * (ZB_POINT_GREEN_MAX - ZB_POINT_GREEN_MIN) - + ZB_POINT_GREEN_MIN); - v->zp.b=(int)(v->color.v[2] * (ZB_POINT_BLUE_MAX - ZB_POINT_BLUE_MIN) - + ZB_POINT_BLUE_MIN); - v->zp.a=(int)(v->color.v[3] * (ZB_POINT_ALPHA_MAX - ZB_POINT_ALPHA_MIN) - + ZB_POINT_ALPHA_MIN); - + v->zp.r=min((int)(v->color.v[0] * (ZB_POINT_RED_MAX - ZB_POINT_RED_MIN)) + + ZB_POINT_RED_MIN, ZB_POINT_RED_MAX); + v->zp.g=min((int)(v->color.v[1] * (ZB_POINT_GREEN_MAX - ZB_POINT_GREEN_MIN)) + + ZB_POINT_GREEN_MIN, ZB_POINT_GREEN_MAX); + v->zp.b=min((int)(v->color.v[2] * (ZB_POINT_BLUE_MAX - ZB_POINT_BLUE_MIN)) + + ZB_POINT_BLUE_MIN, ZB_POINT_BLUE_MAX); + v->zp.a=min((int)(v->color.v[3] * (ZB_POINT_ALPHA_MAX - ZB_POINT_ALPHA_MIN)) + + ZB_POINT_ALPHA_MIN, ZB_POINT_ALPHA_MAX); + /* texture */ if (c->num_textures_enabled >= 1) { static const int si = 0; diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx index e477deae9c..b9efe215c5 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx @@ -234,6 +234,7 @@ clear(DrawableRegion *clearable) { PIXEL color = 0; if (clearable->get_clear_color_active()) { LColor v = clearable->get_clear_color(); + v = v.fmin(LColor(1, 1, 1, 1)).fmax(LColor::zero()); if (_current_properties->get_srgb_color()) { color = SRGBA_TO_PIXEL( @@ -697,10 +698,10 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, if (!needs_color) { const LColor &d = _scene_graph_color; const LColor &s = _current_color_scale; - _c->current_color.v[0] = d[0] * s[0]; - _c->current_color.v[1] = d[1] * s[1]; - _c->current_color.v[2] = d[2] * s[2]; - _c->current_color.v[3] = d[3] * s[3]; + _c->current_color.v[0] = max(d[0] * s[0], (PN_stdfloat)0); + _c->current_color.v[1] = max(d[1] * s[1], (PN_stdfloat)0); + _c->current_color.v[2] = max(d[2] * s[2], (PN_stdfloat)0); + _c->current_color.v[3] = max(d[3] * s[3], (PN_stdfloat)0); } bool needs_normal = false; @@ -756,10 +757,10 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, if (needs_color) { const LColor &d = rcolor.get_data4(); const LColor &s = _current_color_scale; - _c->current_color.v[0] = d[0] * s[0]; - _c->current_color.v[1] = d[1] * s[1]; - _c->current_color.v[2] = d[2] * s[2]; - _c->current_color.v[3] = d[3] * s[3]; + _c->current_color.v[0] = max(d[0] * s[0], (PN_stdfloat)0); + _c->current_color.v[1] = max(d[1] * s[1], (PN_stdfloat)0); + _c->current_color.v[2] = max(d[2] * s[2], (PN_stdfloat)0); + _c->current_color.v[3] = max(d[3] * s[3], (PN_stdfloat)0); if (_color_material_flags) { if (_color_material_flags & CMF_ambient) { @@ -1414,6 +1415,7 @@ framebuffer_copy_to_texture(Texture *tex, int view, int z, return false; } LColor border_color = tex->get_border_color(); + border_color = border_color.fmin(LColor(1, 1, 1, 1)).fmax(LColor::zero()); gltex->border_color.v[0] = border_color[0]; gltex->border_color.v[1] = border_color[1]; gltex->border_color.v[2] = border_color[2]; @@ -2565,6 +2567,7 @@ upload_texture(TinyTextureContext *gtc, bool force, bool uses_mipmaps) { return false; } LColor border_color = tex->get_border_color(); + border_color = border_color.fmin(LColor(1, 1, 1, 1)).fmax(LColor::zero()); gltex->border_color.v[0] = border_color[0]; gltex->border_color.v[1] = border_color[1]; gltex->border_color.v[2] = border_color[2]; @@ -2681,6 +2684,7 @@ upload_simple_texture(TinyTextureContext *gtc) { return false; } LColor border_color = tex->get_border_color(); + border_color = border_color.fmin(LColor(1, 1, 1, 1)).fmax(LColor::zero()); gltex->border_color.v[0] = border_color[0]; gltex->border_color.v[1] = border_color[1]; gltex->border_color.v[2] = border_color[2]; From 82f78139274d71e93acab2b8172896df7eef8bd7 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 20 Aug 2015 21:12:28 +0200 Subject: [PATCH 143/203] Fix assertion when resizing tinydisplay window to fullscreen on X11 --- panda/src/x11display/x11GraphicsWindow.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 709911479e..019ab05f05 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -514,8 +514,8 @@ set_properties_now(WindowProperties &properties) { XRRScreenSize *xrrs; xrrs = XRRSizes(_display, 0, &num_sizes); for (int i = 0; i < num_sizes; ++i) { - if (xrrs[i].width == properties.get_x_size() && - xrrs[i].height == properties.get_y_size()) { + if (xrrs[i].width == reqsizex && + xrrs[i].height == reqsizey) { new_size_id = i; } } From 4342ff741bacf11a595d1aa8e59d33a2efd8620e Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 20 Aug 2015 21:26:39 +0200 Subject: [PATCH 144/203] Pass exit status of panda process on to panda3d process (non-Windows only so far) --- direct/src/p3d/AppRunner.py | 4 +- direct/src/plugin/p3dPythonMain.cxx | 8 ++-- direct/src/plugin/p3dPythonRun.cxx | 64 ++++++++++++++++++----------- direct/src/plugin/p3dPythonRun.h | 2 +- direct/src/plugin/p3dSession.cxx | 44 ++++++++++++++------ direct/src/plugin/run_p3dpython.cxx | 13 +++--- direct/src/plugin/run_p3dpython.h | 8 ++-- 7 files changed, 89 insertions(+), 54 deletions(-) diff --git a/direct/src/p3d/AppRunner.py b/direct/src/p3d/AppRunner.py index ff63e5aa8d..7c080ad8e2 100644 --- a/direct/src/p3d/AppRunner.py +++ b/direct/src/p3d/AppRunner.py @@ -634,13 +634,13 @@ class AppRunner(DirectObject): try: taskMgr.run() - except SystemExit: + except SystemExit as err: # Presumably the window has already been shut down here, but shut # it down again for good measure. if hasattr(__builtin__, "base"): base.destroy() - self.notify.info("Normal exit.") + self.notify.info("Normal exit with status %d." % err.code) raise except: diff --git a/direct/src/plugin/p3dPythonMain.cxx b/direct/src/plugin/p3dPythonMain.cxx index bf218a8cb9..ef5b83e282 100644 --- a/direct/src/plugin/p3dPythonMain.cxx +++ b/direct/src/plugin/p3dPythonMain.cxx @@ -150,10 +150,10 @@ main(int argc, char *argv[]) { } } - if (!run_p3dpython(program_name, archive_file, input_handle, output_handle, - NULL, interactive_console)) { + int status = run_p3dpython(program_name, archive_file, input_handle, + output_handle, NULL, interactive_console); + if (status != 0) { cerr << "Failure on startup.\n"; - return 1; } - return 0; + return status; } diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 667f34e7dc..6ef80cd224 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -137,8 +137,10 @@ P3DPythonRun:: // Access: Public // Description: Runs the embedded Python process. This method does // not return until the plugin is ready to exit. +// +// Returns the exit status, which will be 0 on success. //////////////////////////////////////////////////////////////////// -bool P3DPythonRun:: +int P3DPythonRun:: run_python() { #if defined(_WIN32) && defined(USE_DEBUG_PYTHON) // On Windows, in a debug build, we have to preload sys.dll_suffix = @@ -156,7 +158,7 @@ run_python() { if (panda3d_module == NULL) { nout << "Failed to create panda3d module:\n"; PyErr_Print(); - return false; + return 1; } // Set the __path__ such that it can find panda3d/core.pyd, etc. @@ -174,7 +176,7 @@ run_python() { if (vfsimporter == NULL) { nout << "Failed to import _vfsimporter:\n"; PyErr_Print(); - return false; + return 1; } Py_DECREF(vfsimporter); @@ -183,7 +185,7 @@ run_python() { if (vfsimporter_module == NULL) { nout << "Failed to import VFSImporter:\n"; PyErr_Print(); - return false; + return 1; } // And register the VFSImporter. @@ -191,7 +193,7 @@ run_python() { if (result == NULL) { nout << "Failed to call VFSImporter.register():\n"; PyErr_Print(); - return false; + return 1; } Py_DECREF(result); Py_DECREF(vfsimporter_module); @@ -203,12 +205,12 @@ run_python() { PT(Multifile) mf = new Multifile; if (!mf->open_read(_archive_file)) { nout << "Could not read " << _archive_file << "\n"; - return false; + return 1; } VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr(); if (!vfs->mount(mf, dir, VirtualFileSystem::MF_read_only)) { nout << "Could not mount " << _archive_file << "\n"; - return false; + return 1; } // And finally, we can import the startup module. @@ -216,7 +218,7 @@ run_python() { if (app_runner_module == NULL) { nout << "Failed to import direct.p3d.AppRunner\n"; PyErr_Print(); - return false; + return 1; } // Get the pointers to the objects needed within the module. @@ -224,7 +226,7 @@ run_python() { if (app_runner_class == NULL) { nout << "Failed to get AppRunner class\n"; PyErr_Print(); - return false; + return 1; } // Construct an instance of AppRunner. @@ -232,7 +234,7 @@ run_python() { if (_runner == NULL) { nout << "Failed to construct AppRunner instance\n"; PyErr_Print(); - return false; + return 1; } Py_DECREF(app_runner_class); @@ -240,35 +242,35 @@ run_python() { _undefined_object_class = PyObject_GetAttrString(app_runner_module, "UndefinedObject"); if (_undefined_object_class == NULL) { PyErr_Print(); - return false; + return 1; } // And the "Undefined" instance. _undefined = PyObject_GetAttrString(app_runner_module, "Undefined"); if (_undefined == NULL) { PyErr_Print(); - return false; + return 1; } // Get the ConcreteStruct class. _concrete_struct_class = PyObject_GetAttrString(app_runner_module, "ConcreteStruct"); if (_concrete_struct_class == NULL) { PyErr_Print(); - return false; + return 1; } // Get the BrowserObject class. _browser_object_class = PyObject_GetAttrString(app_runner_module, "BrowserObject"); if (_browser_object_class == NULL) { PyErr_Print(); - return false; + return 1; } // Get the global TaskManager. _taskMgr = PyObject_GetAttrString(app_runner_module, "taskMgr"); if (_taskMgr == NULL) { PyErr_Print(); - return false; + return 1; } Py_DECREF(app_runner_module); @@ -285,12 +287,12 @@ run_python() { PyObject *p3dpython = Py_InitModule("p3dpython", p3dpython_methods); if (p3dpython == NULL) { PyErr_Print(); - return false; + return 1; } PyObject *request_func = PyObject_GetAttrString(p3dpython, "request_func"); if (request_func == NULL) { PyErr_Print(); - return false; + return 1; } // Now pass that func pointer back to our AppRunner instance, so it @@ -298,7 +300,7 @@ run_python() { result = PyObject_CallMethod(_runner, (char *)"setRequestFunc", (char *)"N", request_func); if (result == NULL) { PyErr_Print(); - return false; + return 1; } Py_DECREF(result); @@ -318,7 +320,7 @@ run_python() { PyObject *check_comm = PyObject_GetAttrString(p3dpython, "check_comm"); if (check_comm == NULL) { PyErr_Print(); - return false; + return 1; } // Add it to the task manager. We do this instead of constructing a @@ -326,7 +328,7 @@ run_python() { result = PyObject_CallMethod(_taskMgr, (char *)"add", (char *)"Ns", check_comm, "check_comm"); if (result == NULL) { PyErr_Print(); - return false; + return 1; } Py_DECREF(result); @@ -334,18 +336,30 @@ run_python() { // taskMgr.run()). PyObject *done = PyObject_CallMethod(_runner, (char *)"run", (char *)""); if (done == NULL) { + int status = 1; + // An uncaught application exception, and not handled by - // appRunner.exceptionHandler. - PyErr_Print(); + // appRunner.exceptionHandler. If it is a SystemExit, extract + // the exit status that we should return. + if (PyErr_Occurred() == PyExc_SystemExit) { + PyObject *ptype, *ptraceback; + PySystemExitObject *value = NULL; + PyErr_Fetch(&ptype, (PyObject **)&value, &ptraceback); + if (value != NULL) { + status = (int)PyInt_AsLong(value->code); + } + } else { + PyErr_Print(); + } if (_interactive_console) { // Give an interactive user a chance to explore the exception. run_interactive_console(); - return true; + return 0; } // We're done. - return false; + return status; } // A normal exit from the taskManager. We're presumably done. @@ -355,7 +369,7 @@ run_python() { run_interactive_console(); } - return true; + return 0; } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/plugin/p3dPythonRun.h b/direct/src/plugin/p3dPythonRun.h index 1f52c5eeb1..824def1cfe 100644 --- a/direct/src/plugin/p3dPythonRun.h +++ b/direct/src/plugin/p3dPythonRun.h @@ -71,7 +71,7 @@ public: const char *log_pathname, bool interactive_console); ~P3DPythonRun(); - bool run_python(); + int run_python(); void set_window_open(P3DCInstance *inst, bool is_open); void request_keyboard_focus(P3DCInstance *inst); diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index 2d6f8b8e94..da9b30874f 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -179,18 +179,27 @@ shutdown() { result = waitpid(_p3dpython_pid, &status, WNOHANG); } _p3dpython_pid = -1; - + nout << "Python process has successfully stopped.\n"; if (WIFEXITED(status)) { - nout << " exited normally, status = " - << WEXITSTATUS(status) << "\n"; + int code = WEXITSTATUS(status); + + nout << " exited normally, status = " << code << "\n"; + if (code != 0) { + _exit(code); + } + } else if (WIFSIGNALED(status)) { - nout << " signalled by " << WTERMSIG(status) << ", core = " + nout << " signalled by " << WTERMSIG(status) << ", core = " << WCOREDUMP(status) << "\n"; + + // This seems to be a popular shell convention. + _exit(128 + WTERMSIG(status)); + } else if (WIFSTOPPED(status)) { nout << " stopped by " << WSTOPSIG(status) << "\n"; } - + #endif // _WIN32 } @@ -1708,15 +1717,24 @@ posix_create_process() { // its process. Report an error condition. nout << "Python process stopped immediately.\n"; if (WIFEXITED(status)) { - nout << " exited normally, status = " - << WEXITSTATUS(status) << "\n"; + int code = WEXITSTATUS(status); + + nout << " exited normally, status = " << code << "\n"; + if (code != 0) { + _exit(code); + } + } else if (WIFSIGNALED(status)) { - nout << " signalled by " << WTERMSIG(status) << ", core = " + nout << " signalled by " << WTERMSIG(status) << ", core = " << WCOREDUMP(status) << "\n"; + + // This seems to be a popular shell convention. + _exit(128 + WTERMSIG(status)); + } else if (WIFSTOPPED(status)) { nout << " stopped by " << WSTOPSIG(status) << "\n"; } - + return -1; } #endif // _WIN32 @@ -1798,10 +1816,12 @@ p3dpython_thread_run() { return; } - if (!run_p3dpython(libp3dpython.c_str(), _mf_filename.c_str(), - _input_handle, _output_handle, _log_pathname.c_str(), - _interactive_console)) { + int status = run_p3dpython(libp3dpython.c_str(), _mf_filename.c_str(), + _input_handle, _output_handle, _log_pathname.c_str(), + _interactive_console); + if (status != 0) { nout << "Failure on startup.\n"; + _exit(status); } } diff --git a/direct/src/plugin/run_p3dpython.cxx b/direct/src/plugin/run_p3dpython.cxx index e5db32d10e..5a7dc4c742 100644 --- a/direct/src/plugin/run_p3dpython.cxx +++ b/direct/src/plugin/run_p3dpython.cxx @@ -19,16 +19,17 @@ // Function: run_p3dpython // Description: This externally-visible function is the main entry // point to this DLL, and it starts the whole thing -// running. Returns true on success, false on failure. +// running. Returns the exit status, which will be +// 0 on success, 1 or otherwise on failure. //////////////////////////////////////////////////////////////////// -bool +int run_p3dpython(const char *program_name, const char *archive_file, - FHandle input_handle, FHandle output_handle, + FHandle input_handle, FHandle output_handle, const char *log_pathname, bool interactive_console) { - P3DPythonRun::_global_ptr = - new P3DPythonRun(program_name, archive_file, input_handle, output_handle, + P3DPythonRun::_global_ptr = + new P3DPythonRun(program_name, archive_file, input_handle, output_handle, log_pathname, interactive_console); - bool result = P3DPythonRun::_global_ptr->run_python(); + int result = P3DPythonRun::_global_ptr->run_python(); delete P3DPythonRun::_global_ptr; P3DPythonRun::_global_ptr = NULL; return result; diff --git a/direct/src/plugin/run_p3dpython.h b/direct/src/plugin/run_p3dpython.h index 21d5430f54..6b358b742b 100644 --- a/direct/src/plugin/run_p3dpython.h +++ b/direct/src/plugin/run_p3dpython.h @@ -26,14 +26,14 @@ #define EXPCL_P3DPYTHON #endif -typedef bool +typedef int run_p3dpython_func(const char *program_name, const char *archive_file, - FHandle input_handle, FHandle output_handle, + FHandle input_handle, FHandle output_handle, const char *log_pathname, bool interactive_console); -extern "C" EXPCL_P3DPYTHON bool +extern "C" EXPCL_P3DPYTHON int run_p3dpython(const char *program_name, const char *archive_file, - FHandle input_handle, FHandle output_handle, + FHandle input_handle, FHandle output_handle, const char *log_pathname, bool interactive_console); #endif From eecded05bdd04cafe93793efdc97742b58903e83 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 20 Aug 2015 21:59:12 +0200 Subject: [PATCH 145/203] Fix broken imports in ParticleTest --- direct/src/particles/ParticleTest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direct/src/particles/ParticleTest.py b/direct/src/particles/ParticleTest.py index 786e6f90dc..7937bfec2b 100644 --- a/direct/src/particles/ParticleTest.py +++ b/direct/src/particles/ParticleTest.py @@ -2,8 +2,8 @@ if __name__ == "__main__": from direct.directbase.TestStart import * - from pandac.LinearVectorForce import LinearVectorForce - from pandac.Vec3 import Vec3 + from panda3d.physics import LinearVectorForce + from panda3d.core import Vec3 import ParticleEffect from direct.tkpanels import ParticlePanel import Particles From 902bce01e972b20abd7172503078ef93be066ed9 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 22 Aug 2015 19:16:21 +0200 Subject: [PATCH 146/203] Fix various window sizing issues on X11 --- panda/src/x11display/x11GraphicsWindow.cxx | 136 ++++++++++++--------- panda/src/x11display/x11GraphicsWindow.h | 2 + 2 files changed, 80 insertions(+), 58 deletions(-) diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 019ab05f05..82a1180cf3 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -429,6 +429,7 @@ process_events() { // inner corner, anyway, but that means we need to fix // XConfigureWindow too.) properties.set_origin(configure_event.x, configure_event.y); + properties.set_size(configure_event.width, configure_event.height); if (_properties.get_fixed_size()) { // If the window properties indicate a fixed size only, undo @@ -436,21 +437,15 @@ process_events() { // doesn't appear to be a way to universally disallow this // directly (although we do set the min_size and max_size to // the same value, which seems to work for most window - // managers.) Incidentally, this also works to force my - // tiling window manager into 'floating' mode. - WindowProperties current_props = get_properties(); - if (configure_event.width != current_props.get_x_size() || - configure_event.height != current_props.get_y_size()) { + // managers.) + if (configure_event.width != _fixed_size.get_x() || + configure_event.height != _fixed_size.get_y()) { XWindowChanges changes; - changes.width = current_props.get_x_size(); - changes.height = current_props.get_y_size(); + changes.width = _fixed_size.get_x(); + changes.height = _fixed_size.get_y(); int value_mask = (CWWidth | CWHeight); XConfigureWindow(_display, _xwindow, value_mask, &changes); } - - } else { - // A normal window may be resized by the user at will. - properties.set_size(configure_event.width, configure_event.height); } changed_properties = true; } @@ -494,16 +489,19 @@ set_properties_now(WindowProperties &properties) { x11GraphicsPipe *x11_pipe; DCAST_INTO_V(x11_pipe, _pipe); - // Handle fullscreen mode. - if (properties.has_fullscreen()) { - if (properties.get_fullscreen()) { + // We're either going into or out of fullscreen, or are in fullscreen + // and are changing the resolution. + bool is_fullscreen = _properties.has_fullscreen() && _properties.get_fullscreen(); + bool want_fullscreen = properties.has_fullscreen() ? properties.get_fullscreen() : is_fullscreen; + + if (is_fullscreen != want_fullscreen || (is_fullscreen && properties.has_size())) { + if (want_fullscreen) { if (_have_xrandr) { #ifdef HAVE_XRANDR XRRScreenConfiguration* conf = XRRGetScreenInfo(_display, x11_pipe->get_root()); - if (_orig_size_id == (SizeID) -1) { - _orig_size_id = XRRConfigCurrentConfiguration(conf, &_orig_rotation); - } - int num_sizes, reqsizex, reqsizey, new_size_id = -1; + SizeID old_size_id = XRRConfigCurrentConfiguration(conf, &_orig_rotation); + SizeID new_size_id = (SizeID) -1; + int num_sizes = 0, reqsizex, reqsizey; if (properties.has_size()) { reqsizex = properties.get_x_size(); reqsizey = properties.get_y_size(); @@ -519,16 +517,18 @@ set_properties_now(WindowProperties &properties) { new_size_id = i; } } - if (new_size_id == -1) { + if (new_size_id == (SizeID) -1) { x11display_cat.error() << "Videocard has no supported display resolutions at specified res (" - << reqsizex << " x " << reqsizey <<")\n"; - _orig_size_id = -1; + << reqsizex << " x " << reqsizey << ")\n"; } else { - if (new_size_id != _orig_size_id) { + if (new_size_id != old_size_id) { + XRRSetScreenConfig(_display, conf, x11_pipe->get_root(), new_size_id, _orig_rotation, CurrentTime); - } else { - _orig_size_id = -1; + if (_orig_size_id == (SizeID) -1) { + // Remember the original resolution so we can switch back to it. + _orig_size_id = old_size_id; + } } } #endif @@ -545,7 +545,7 @@ set_properties_now(WindowProperties &properties) { if (_have_xrandr && _orig_size_id != (SizeID) -1) { XRRScreenConfiguration* conf = XRRGetScreenInfo(_display, x11_pipe->get_root()); XRRSetScreenConfig(_display, conf, x11_pipe->get_root(), _orig_size_id, _orig_rotation, CurrentTime); - _orig_size_id = -1; + _orig_size_id = (SizeID) -1; } #endif // Set the origin back to what it was @@ -589,8 +589,7 @@ set_properties_now(WindowProperties &properties) { // on the fly. // We'll pass some property requests on as a window manager hint. - WindowProperties wm_properties = _properties; - wm_properties.add_properties(properties); + set_wm_properties(properties, true); // The window title may be changed by issuing another hint request. // Assume this will be honored. @@ -617,6 +616,7 @@ set_properties_now(WindowProperties &properties) { changes.y = 0; value_mask |= CWX | CWY; properties.clear_origin(); + } else if (properties.has_origin()) { changes.x = properties.get_x_origin(); changes.y = properties.get_y_origin(); @@ -625,10 +625,21 @@ set_properties_now(WindowProperties &properties) { properties.clear_origin(); } + // This, too. But we can't currently change out of fixed_size mode. + if (properties.has_fixed_size() && properties.get_fixed_size()) { + _properties.set_fixed_size(properties.get_fixed_size()); + properties.clear_fixed_size(); + _fixed_size = _properties.get_size(); + } + if (properties.has_size()) { changes.width = properties.get_x_size(); changes.height = properties.get_y_size(); value_mask |= (CWWidth | CWHeight); + + if (_properties.get_fixed_size()) { + _fixed_size = properties.get_size(); + } properties.clear_size(); } @@ -656,13 +667,6 @@ set_properties_now(WindowProperties &properties) { properties.clear_z_order(); } - if (value_mask != 0) { - XReconfigureWMWindow(_display, _xwindow, _screen, value_mask, &changes); - - // Don't draw anything until this is done reconfiguring. - _awaiting_configure = true; - } - // We hide the cursor by setting it to an invisible pixmap. // We can also load a custom cursor from a file. if (properties.has_cursor_hidden() || properties.has_cursor_filename()) { @@ -783,7 +787,14 @@ set_properties_now(WindowProperties &properties) { } } - set_wm_properties(wm_properties, true); + if (value_mask != 0) { + // We must call this after changing the WM properties, otherwise + // we may get misleading ConfigureNotify events in the wrong order. + XReconfigureWMWindow(_display, _xwindow, _screen, value_mask, &changes); + + // Don't draw anything until this is done reconfiguring. + _awaiting_configure = true; + } } //////////////////////////////////////////////////////////////////// @@ -962,6 +973,11 @@ open_window() { << "failed to create X window.\n"; return false; } + + if (_properties.get_fixed_size()) { + _fixed_size = _properties.get_size(); + } + set_wm_properties(_properties, false); // We don't specify any fancy properties of the XIC. It would be @@ -1034,8 +1050,8 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) { XTextProperty window_name; XTextProperty *window_name_p = (XTextProperty *)NULL; if (properties.has_title()) { - char *name = (char *)properties.get_title().c_str(); - if (XStringListToTextProperty(&name, 1, &window_name) != 0) { + const char *name = properties.get_title().c_str(); + if (XStringListToTextProperty((char **)&name, 1, &window_name) != 0) { window_name_p = &window_name; } } @@ -1056,18 +1072,19 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) { } size_hints_p->flags |= USPosition; } + LVecBase2i size = _properties.get_size(); if (properties.has_size()) { - size_hints_p->width = properties.get_x_size(); - size_hints_p->height = properties.get_y_size(); + size = properties.get_size(); + size_hints_p->width = size.get_x(); + size_hints_p->height = size.get_y(); size_hints_p->flags |= USSize; - - if (properties.get_fixed_size()) { - size_hints_p->min_width = properties.get_x_size(); - size_hints_p->min_height = properties.get_y_size(); - size_hints_p->max_width = properties.get_x_size(); - size_hints_p->max_height = properties.get_y_size(); - size_hints_p->flags |= (PMinSize | PMaxSize); - } + } + if (properties.get_fixed_size()) { + size_hints_p->min_width = size.get_x(); + size_hints_p->min_height = size.get_y(); + size_hints_p->max_width = size.get_x(); + size_hints_p->max_height = size.get_y(); + size_hints_p->flags |= (PMinSize | PMaxSize); } } } @@ -1107,18 +1124,21 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) { SetAction set_data[max_set_data]; int next_set_data = 0; - if (properties.get_fullscreen()) { - // For a "fullscreen" request, we pass this through, hoping the - // window manager will support EWMH. - type_data[next_type_data++] = x11_pipe->_net_wm_window_type_fullscreen; + if (properties.has_fullscreen()) { + if (properties.get_fullscreen()) { + // For a "fullscreen" request, we pass this through, hoping the + // window manager will support EWMH. + type_data[next_type_data++] = x11_pipe->_net_wm_window_type_fullscreen; - // We also request it as a state. - state_data[next_state_data++] = x11_pipe->_net_wm_state_fullscreen; - // Don't ask me why this has to be 1/0 and not _net_wm_state_add. - // It doesn't seem to work otherwise. - set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 1); - } else { - set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 0); + // We also request it as a state. + state_data[next_state_data++] = x11_pipe->_net_wm_state_fullscreen; + // Don't ask me why this has to be 1/0 and not _net_wm_state_add. + // It doesn't seem to work otherwise. + set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 1); + + } else { + set_data[next_set_data++] = SetAction(x11_pipe->_net_wm_state_fullscreen, 0); + } } // If we asked for a window without a border, there's no excellent diff --git a/panda/src/x11display/x11GraphicsWindow.h b/panda/src/x11display/x11GraphicsWindow.h index 9fc7210f60..b8c79c8a86 100644 --- a/panda/src/x11display/x11GraphicsWindow.h +++ b/panda/src/x11display/x11GraphicsWindow.h @@ -96,6 +96,8 @@ protected: SizeID _orig_size_id; #endif + LVecBase2i _fixed_size; + long _event_mask; bool _awaiting_configure; bool _dga_mouse_enabled; From 9f85086c10c7721f4bb9146badb56e0459f33316 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 22 Aug 2015 20:27:51 +0200 Subject: [PATCH 147/203] Apparently Python supports non-int status codes. Handle this correctly in the plug-in. --- direct/src/p3d/AppRunner.py | 2 +- direct/src/plugin/p3dPythonRun.cxx | 28 +++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/direct/src/p3d/AppRunner.py b/direct/src/p3d/AppRunner.py index 7c080ad8e2..76c979c465 100644 --- a/direct/src/p3d/AppRunner.py +++ b/direct/src/p3d/AppRunner.py @@ -640,7 +640,7 @@ class AppRunner(DirectObject): if hasattr(__builtin__, "base"): base.destroy() - self.notify.info("Normal exit with status %d." % err.code) + self.notify.info("Normal exit with status %s." % repr(err.code)) raise except: diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 6ef80cd224..c42cf9263e 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -341,12 +341,30 @@ run_python() { // An uncaught application exception, and not handled by // appRunner.exceptionHandler. If it is a SystemExit, extract // the exit status that we should return. - if (PyErr_Occurred() == PyExc_SystemExit) { + if (PyErr_ExceptionMatches(PyExc_SystemExit)) { PyObject *ptype, *ptraceback; - PySystemExitObject *value = NULL; - PyErr_Fetch(&ptype, (PyObject **)&value, &ptraceback); - if (value != NULL) { - status = (int)PyInt_AsLong(value->code); + PyObject *value = NULL; + PyErr_Fetch(&ptype, &value, &ptraceback); + + if (value != NULL && PyExceptionInstance_Check(value)) { + PyObject *code = PyObject_GetAttrString(value, "code"); + if (code) { + Py_DECREF(value); + value = code; + } + } + + if (value == NULL || value == Py_None) { + status = 0; +#if PY_MAJOR_VERSION >= 3 + } else if (PyLong_Check(value)) { + status = (int)PyLong_AsLong(value); +#else + } else if (PyInt_Check(value)) { + status = (int)PyInt_AsLong(value); +#endif + } else { + status = 1; } } else { PyErr_Print(); From d8f655479a943f6cb8a9a15cf28756bffa9722c5 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 23 Aug 2015 14:10:02 +0200 Subject: [PATCH 148/203] Remove references to SourceForge CVS repository --- direct/src/directscripts/cleancvstree | 44 ------- direct/src/directscripts/make-panda3d-tgz.py | 124 ------------------- makepanda/expandimports.bat | 2 +- makepanda/makechm.bat | 2 +- makepanda/makedocs.bat | 2 +- makepanda/makepanda.bat | 2 +- panda/src/doc/howto.install_vc7 | 95 -------------- 7 files changed, 4 insertions(+), 267 deletions(-) delete mode 100644 direct/src/directscripts/cleancvstree delete mode 100755 direct/src/directscripts/make-panda3d-tgz.py delete mode 100644 panda/src/doc/howto.install_vc7 diff --git a/direct/src/directscripts/cleancvstree b/direct/src/directscripts/cleancvstree deleted file mode 100644 index 92749714b7..0000000000 --- a/direct/src/directscripts/cleancvstree +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################## -# -# cleancvstree -# -# Cleancvstree searches a CVS tree for files that are not in CVS, and -# deletes them. Be careful using it --- it's very aggressive. -# -############################################################################## - -import sys,os - -def cleanCvsTree(dir): - try: - sub = os.listdir(dir) - except: - print "Could not read directory: "+dir - return - valid = {} - try: - readentries = 0 - cvsent = open(dir + "/CVS/Entries") - for line in cvsent: - words = line.split("/") - if (len(words) > 1): - valid[words[1]] = 1 - cvsent.close() - readentries = 1 - except: - print "Could not read "+dir+"/CVS/Entries" - if (readentries): - for file in sub: - if (os.path.isfile(dir+"/"+file)): - if (valid.has_key(file)==0): - os.unlink(dir+"/"+file) - for file in sub: - if (file != "CVS"): - if (os.path.isdir(dir+"/"+file)): - cleanCvsTree(dir+"/"+file) - -if (os.path.isdir(sys.argv[1])==0): - print "Not a directory: "+sys.argv[1] - os.exit(1) - -cleanCvsTree(sys.argv[1]) diff --git a/direct/src/directscripts/make-panda3d-tgz.py b/direct/src/directscripts/make-panda3d-tgz.py deleted file mode 100755 index 33615bb0e3..0000000000 --- a/direct/src/directscripts/make-panda3d-tgz.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python - -"""This script generates the panda3d-date.tar.gz tarball for a file -release of panda3d onto the SourceForge download site. - -Options: - - -d cvsroot - Specifies the CVSROOT string to use to tag and export the - tree. The default is $SFROOT if it is defined, or $CVSROOT - otherwise. - - -r tag - Specifies the tag to export from. If this parameter is - specified, the tree is not tagged again; otherwise, the - current head of the CVS tree is tagged with the file version - name. - - -m module - Specifies the module to check out and build. The default is - panda3d. -""" - -import sys -import os -import os.path -import getopt -import time -import glob -import shutil - -CVSROOT = os.getenv('SFROOT') or os.getenv('CVSROOT') -ORIGTAG = '' -MODULE = 'panda3d' - -def usage(code, msg = ''): - print >> sys.stderr, __doc__ - print >> sys.stderr, msg - sys.exit(code) - -try: - opts, args = getopt.getopt(sys.argv[1:], 'd:r:m:h') -except getopt.error, msg: - usage(1, msg) - -for opt, arg in opts: - if opt == '-d': - CVSROOT = arg - elif opt == '-r': - ORIGTAG = arg - elif opt == '-m': - MODULE = arg - elif opt == '-h': - usage(0) - -if not CVSROOT: - usage(1, 'CVSROOT must have a value.') - -if not MODULE: - usage(1, 'MODULE must have a value.') - -basename = MODULE + '-' + time.strftime("%Y-%m-%d") -tarfile = basename + '.tar.gz' -zipfile = basename + '.zip' - -if os.path.exists(basename): - print basename, 'already exists in the local directory!' - sys.exit(1) - -if not ORIGTAG: - # If we weren't given a starting tag, make one. - tag = basename - - print 'Tagging sources.' - cmd = 'cvs -f -d "%s" rtag -F -r HEAD "%s" "%s"' % (CVSROOT, tag, MODULE) - if os.system(cmd) != 0: - sys.exit(1) -else: - # Otherwise, we were given a starting tag, so use it. - tag = ORIGTAG - -print 'Checking out "%s" as "%s".' % (MODULE, basename) -cmd = 'cvs -z3 -f -d "%s" export -r "%s" -d "%s" "%s"' % (CVSROOT, tag, - basename, MODULE) -if os.system(cmd) != 0: - sys.exit(1) - -# Move the contents of the doc module into the root directory where people -# will expect to see it. -docdir = basename + os.sep + 'doc' -if os.path.exists(docdir): - files = glob.glob(docdir + os.sep + '*') - for file in files: - shutil.copy(file, basename) - os.remove(file) - os.rmdir(docdir) - -# Generate the autoconf scripts for ppremake. -if MODULE == 'ppremake': - ppremakedir = basename -else: - ppremakedir = basename + os.sep + 'ppremake' -if os.path.exists(ppremakedir): - cmd = 'cd "./%s" && aclocal && autoheader && automake --foreign -a && autoconf' % (ppremakedir) - if os.system(cmd) != 0: - sys.exit(1) - -# Generate the tarball. -print 'Generating %s' % (tarfile) -if os.path.exists(tarfile): - os.remove(tarfile) -cmd = 'tar cf - "%s" | gzip -9 > "%s"' % (basename, tarfile) -if os.system(cmd) != 0: - sys.exit(1) - -# Also generate a zip file. -print 'Generating %s' % (zipfile) -if os.path.exists(zipfile): - os.remove(zipfile) -cmd = 'zip -9rq "%s" "%s"' % (zipfile, basename) -if os.system(cmd) != 0: - sys.exit(1) - -shutil.rmtree(basename) diff --git a/makepanda/expandimports.bat b/makepanda/expandimports.bat index ee2dcc6c3e..9f70fab96a 100644 --- a/makepanda/expandimports.bat +++ b/makepanda/expandimports.bat @@ -21,7 +21,7 @@ goto done :missing2 echo You seem to be missing the 'thirdparty' directory. You probably checked - echo the source code out from sourceforge. The sourceforge repository is + echo the source code out from GitHub. The GitHub repository is echo missing the 'thirdparty' directory. You will need to supplement the echo code by downloading the 'thirdparty' directory from www.panda3d.org goto done diff --git a/makepanda/makechm.bat b/makepanda/makechm.bat index 5a4b1b38e1..c644330344 100755 --- a/makepanda/makechm.bat +++ b/makepanda/makechm.bat @@ -21,7 +21,7 @@ goto done :missing2 echo You seem to be missing the 'thirdparty' directory. You probably checked - echo the source code out from sourceforge. The sourceforge repository is + echo the source code out from GitHub. The GitHub repository is echo missing the 'thirdparty' directory. You will need to supplement the echo code by downloading the 'thirdparty' directory from www.panda3d.org goto done diff --git a/makepanda/makedocs.bat b/makepanda/makedocs.bat index c628e2ec81..f1be388a10 100644 --- a/makepanda/makedocs.bat +++ b/makepanda/makedocs.bat @@ -21,7 +21,7 @@ goto done :missing2 echo You seem to be missing the 'thirdparty' directory. You probably checked - echo the source code out from sourceforge. The sourceforge repository is + echo the source code out from GitHub. The GitHub repository is echo missing the 'thirdparty' directory. You will need to supplement the echo code by downloading the 'thirdparty' directory from www.panda3d.org goto done diff --git a/makepanda/makepanda.bat b/makepanda/makepanda.bat index d8d3a25e8e..3908b4f69a 100755 --- a/makepanda/makepanda.bat +++ b/makepanda/makepanda.bat @@ -31,7 +31,7 @@ goto done :missing2 echo %thirdparty% echo You seem to be missing the 'thirdparty' directory. You probably checked - echo the source code out from sourceforge. The sourceforge repository is + echo the source code out from GitHub. The GitHub repository is echo missing the 'thirdparty' directory. You will need to supplement the echo code by downloading the 'thirdparty' directory from www.panda3d.org goto done diff --git a/panda/src/doc/howto.install_vc7 b/panda/src/doc/howto.install_vc7 deleted file mode 100644 index ec0caf2f2b..0000000000 --- a/panda/src/doc/howto.install_vc7 +++ /dev/null @@ -1,95 +0,0 @@ -VC7 upgrade instructions in 2 easy steps ------------------------- -Step 1. cvs update wintools & dtool - -Step 2. Run v:\msvc7\vc_setup\setup.exe, or install from the MSDN -'Visual Studio.NET' CD. Click on 'Windows Component Update' (if it is -highlighted, else click '2'). Click 'Continue' (Selecting 'Do not use -this machine to host web projects') You will install IE6, which will -requires a reboot. Give your pw if you want it to happen -automatically. - -After rebooting, setup should start again. If it does not, go back and -rerun it, it should remember where it left off. - -After installing components, you are ready to install VC7 in Step 2. -Enter this step and enter the product-key, which is stored in -V:\msvc7\vc7-prodkey.txt - -On the 'select items to install page', you need uncheck things to -avoid wasting gigs of extra space and install time. Uncheck -everything except for Language Tools->Visual C++, Server -Components->Remote Debugger->Native Remote Debugger, and if you want, -Documentation (this is a gig, and is only a slight update if you -already have MSDN installed locally though. You will want to -uninstall the separately-installed MSDN docs if you get this.) - -Unlike VC 6.0, there is no option to add the required compiler bin -directories to the environment path automatically. To do this, if you -are running from the NT command line, run -"C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\vcvars32.bat" - -If you are using tcsh.exe under cygwin, enable VC7 using -'source $WINTOOLS/etc/setup_msvc7.csh' - -You will want to copy the top portion of setup_msvc7.csh to your -.cshrc, so you can do 'set_msvc7' to set up the PATH properly in the -future, or you can add the required dirs to the front of your path -explicitly as well as 'setenv USE_COMPILER MSVC7' to always use VC7. -The easiest thing to do is just put the 'set_msvc7' at the end of your -.cshrc. - -IMPORTANT: - -After finishing this process, make sure you are using VC7 in your -shell by typing 'cl' at the prompt. If you see: - -> Microsoft (R)32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86 -> Copyright (C) Microsoft Corporation 1984-2001. - -then you have VC7. If you have still VC6, you will see -> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86 -> Copyright (C) Microsoft Corp 1984-1998. - -If you try to build with this broken setup, the build process -will get confused and compile with VC6 but try to link with -the VC7 libraries and you will get link errors. - -To correct this problem, check your tcsh path to make sure it has the -.NET dirs in it, and make sure the cygwin softlink mount point /msvc7 -exists, and is not empty but points to the proper VC7 directory. Doing -'ls /msvc7' should give you something like - -Common7/ Visual Studio .NET Enterprise Architect - English/ -Crystal Reports/ Visual Studio SDKs/ -EnterpriseFrameworks/ contents.htm -FrameworkSDK/ readme.htm -Msdn/ redist.txt -Setup/ sqlserver/ -Vb7/ toc.htm -Vc7/ vdt70vcs.dll* - -If it does not, try running 'source ~/player/wintools/etc/setup_env.csh' -again to get it to do the -'mount -s C:/Program\ Files/Microsoft\ Visual\ Studio\ .NET /msvc7' -cmd to create the softlink, or run the cmd yourself. - ---- -Notes: -The debug C runtime seems significantly slower than the vc6 one, which has -slowed Opt2 install builds considerably. ---------- -To distribute toontown, -We need to rebuild the python and nspr DLLs to link to the new -VC7 C and C++ runtime DLLs, which are -msvcp70.dll -msvcr70.dll - -and these must replace -msvcp60.dll -msvcrt.dll -in the Toontown download. - - - - From 563f6843a2a34bac6ec0421936b2d6146a63f68f Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 23 Aug 2015 14:56:03 +0200 Subject: [PATCH 149/203] Add -x option to packp3d, include 'cur' as an extractable extension by default --- direct/src/p3d/Packager.py | 4 ++-- direct/src/p3d/packp3d.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index b0a44d7fa2..2ab09422f0 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -2371,7 +2371,7 @@ class Packager: # Binary files that are copied (and compressed) without # processing. - self.binaryExtensions = [ 'ttf', 'TTF', 'mid', 'ico' ] + self.binaryExtensions = [ 'ttf', 'TTF', 'mid', 'ico', 'cur' ] # Files that can have an existence in multiple different # packages simultaneously without conflict. @@ -2411,7 +2411,7 @@ class Packager: } # Files that should be extracted to disk. - self.extractExtensions = self.executableExtensions[:] + self.manifestExtensions[:] + [ 'ico' ] + self.extractExtensions = self.executableExtensions[:] + self.manifestExtensions[:] + [ 'ico', 'cur' ] # Files that indicate a platform dependency. self.platformSpecificExtensions = self.executableExtensions[:] diff --git a/direct/src/p3d/packp3d.py b/direct/src/p3d/packp3d.py index b26c6d5b22..53a703b5eb 100755 --- a/direct/src/p3d/packp3d.py +++ b/direct/src/p3d/packp3d.py @@ -111,7 +111,7 @@ class ArgumentError(StandardError): pass def makePackedApp(args): - opts, args = getopt.getopt(args, 'o:d:m:S:e:n:p:c:r:s:Dh') + opts, args = getopt.getopt(args, 'o:d:m:S:e:n:x:p:c:r:s:Dh') packager = Packager.Packager() From 09f2bea96f96351f627a2b56259fc9f5ad86efd9 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 23 Aug 2015 14:56:53 +0200 Subject: [PATCH 150/203] Fix typo in error message --- direct/src/showbase/Loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/showbase/Loader.py b/direct/src/showbase/Loader.py index 52f253d717..adee7fbe2b 100644 --- a/direct/src/showbase/Loader.py +++ b/direct/src/showbase/Loader.py @@ -855,7 +855,7 @@ class Loader(DirectObject): def loadShader (self, shaderPath, okMissing = False): shader = ShaderPool.loadShader (shaderPath) if not shader and not okMissing: - message = 'Could not shader file: %s' % (shaderPath) + message = 'Could not load shader file: %s' % (shaderPath) raise IOError, message return shader From 3ece15bba014d88ee89a517740edafa1e2688ef0 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 23 Aug 2015 17:13:12 +0200 Subject: [PATCH 151/203] Implement texture clears for buffer textures --- .../glstuff/glGraphicsStateGuardian_src.cxx | 41 +++++++++++++++---- .../src/glstuff/glGraphicsStateGuardian_src.h | 5 +++ 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index f1fafe212a..1eda94595b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -818,13 +818,28 @@ reset() { if (_glClearTexImage == NULL) { GLCAT.warning() - << "GL_ARB_clear_texture advertised as supported by OpenGL runtime, but could not get pointers to extension functions.\n"; + << "GL_ARB_clear_texture advertised as supported by OpenGL runtime, but could not get pointers to extension function.\n"; } else { _supports_clear_texture = true; } } #endif + _supports_clear_buffer = false; +#ifndef OPENGLES + if (is_at_least_gl_version(4, 3) || has_extension("GL_ARB_clear_buffer_object")) { + _glClearBufferData = (PFNGLCLEARBUFFERDATAPROC) + get_extension_func("glClearBufferData"); + + if (_glClearBufferData == NULL) { + GLCAT.warning() + << "GL_ARB_clear_buffer_object advertised as supported by OpenGL runtime, but could not get pointers to extension function.\n"; + } else { + _supports_clear_buffer = true; + } + } +#endif + _supports_2d_texture_array = false; #ifndef OPENGLES if (is_at_least_gl_version(3, 0)) { @@ -11303,13 +11318,25 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, // The texture has a clear color, so we should fill this mipmap // level to a solid color. #ifndef OPENGLES - if (_supports_clear_texture) { - // We can do that with the convenient glClearTexImage function. - string clear_data = tex->get_clear_data(); + if (texture_target != GL_TEXTURE_BUFFER) { + if (_supports_clear_texture) { + // We can do that with the convenient glClearTexImage function. + string clear_data = tex->get_clear_data(); - _glClearTexImage(gtc->_index, n - mipmap_bias, external_format, - component_type, (void *)clear_data.data()); - continue; + _glClearTexImage(gtc->_index, n - mipmap_bias, external_format, + component_type, (void *)clear_data.data()); + continue; + } + } else { + if (_supports_clear_buffer) { + // For buffer textures we need to clear the underlying storage. + string clear_data = tex->get_clear_data(); + cerr << "clearing buffer data\n"; + + _glClearBufferData(GL_TEXTURE_BUFFER, internal_format, external_format, + component_type, (const void *)clear_data.data()); + continue; + } } #endif // OPENGLES // Ask the Texture class to create the mipmap level in RAM. diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index a2a519d109..43ba33bdfd 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -695,6 +695,11 @@ public: PFNGLCLEARTEXIMAGEPROC _glClearTexImage; #endif + bool _supports_clear_buffer; +#ifndef OPENGLES + PFNGLCLEARBUFFERDATAPROC _glClearBufferData; +#endif + PFNGLCOMPRESSEDTEXIMAGE1DPROC _glCompressedTexImage1D; PFNGLCOMPRESSEDTEXIMAGE2DPROC _glCompressedTexImage2D; PFNGLCOMPRESSEDTEXIMAGE3DPROC _glCompressedTexImage3D; From d68bbae5b46b246f27d3796ac59dd48f302de7a9 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 26 Aug 2015 14:57:30 +0200 Subject: [PATCH 152/203] Don't add "(not used)" to config decls when writing them, it makes it harder to write out a config.prc file --- dtool/src/prc/configDeclaration.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dtool/src/prc/configDeclaration.cxx b/dtool/src/prc/configDeclaration.cxx index 65cc4360d2..141c8d8adf 100644 --- a/dtool/src/prc/configDeclaration.cxx +++ b/dtool/src/prc/configDeclaration.cxx @@ -163,9 +163,9 @@ output(ostream &out) const { void ConfigDeclaration:: write(ostream &out) const { out << get_variable()->get_name() << " " << get_string_value(); - if (!get_variable()->is_used()) { - out << " (not used)"; - } + //if (!get_variable()->is_used()) { + // out << " (not used)"; + //} out << "\n"; } From 56b94eb8153984f2fbbe50e95ad5490ab458e26c Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 28 Aug 2015 16:28:03 +0200 Subject: [PATCH 153/203] Don't raise exception in tp_traverse, instead silently passing case where object is already destructed --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index cf6434508b..1078582d53 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -2237,8 +2237,7 @@ write_module_class(ostream &out, Object *obj) { out << " " << cClassName << " *local_this = NULL;\n"; out << " DTOOL_Call_ExtractThisPointerForType(self, &Dtool_" << ClassName << ", (void **) &local_this);\n"; out << " if (local_this == NULL) {\n"; - out << " PyErr_SetString(PyExc_AttributeError, \"C++ object is not yet constructed, or already destructed.\");\n"; - out << " return -1;\n"; + out << " return 0;\n"; out << " }\n\n"; // Find the remap. There should be only one. From 838589ef0ffb5b835ee731b304902c5aeef0faeb Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 28 Aug 2015 20:14:05 +0200 Subject: [PATCH 154/203] Fix bug: excluded modules in one package would be implicitly excluded from packages that depend on it This fixes the lack of 'xml' package in the 'morepy' package. --- direct/src/p3d/Packager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 2ab09422f0..ef0ee784b9 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -2196,8 +2196,10 @@ class Packager: ext = Filename(lowerName).getExtension() if ext not in self.packager.nonuniqueExtensions: self.skipFilenames[lowerName] = True + for moduleName, mdef in package.moduleNames.items(): - self.skipModules[moduleName] = mdef + if not mdef.exclude: + self.skipModules[moduleName] = mdef # Packager constructor def __init__(self, platform = None): From 9053999889d1deb6d3ab9dc3751fa5539c496b82 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 28 Aug 2015 21:40:08 +0200 Subject: [PATCH 155/203] Don't put important code in an assert - fixes media player sample in runtime environment --- samples/media-player/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/media-player/main.py b/samples/media-player/main.py index 838cb54961..4fc487544e 100755 --- a/samples/media-player/main.py +++ b/samples/media-player/main.py @@ -38,7 +38,8 @@ class MediaPlayer(ShowBase): # but we want to make sure we get a MovieTexture, since it # implements synchronizeTo. self.tex = MovieTexture("name") - assert self.tex.read(media_file), "Failed to load video!" + success = self.tex.read(media_file) + assert success, "Failed to load video!" # Set up a fullscreen card to set the video texture on. cm = CardMaker("My Fullscreen Card") From dbb83409e041675f0c72864cc38e4a1cc09c6b3c Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 1 Sep 2015 01:09:47 +0200 Subject: [PATCH 156/203] More panda3d.exe robustness: make sure contents.xml is fresh if core API fails hash check --- direct/src/plugin_standalone/panda3d.cxx | 151 +++++++++++++---------- direct/src/plugin_standalone/panda3d.h | 1 + 2 files changed, 89 insertions(+), 63 deletions(-) diff --git a/direct/src/plugin_standalone/panda3d.cxx b/direct/src/plugin_standalone/panda3d.cxx index fd0d2f44b7..065a2afe31 100644 --- a/direct/src/plugin_standalone/panda3d.cxx +++ b/direct/src/plugin_standalone/panda3d.cxx @@ -356,6 +356,7 @@ bool Panda3D:: get_plugin() { // First, look for the existing contents.xml file. bool success = false; + bool is_fresh = false; Filename contents_filename = Filename(Filename::from_os_specific(_root_dir), "contents.xml"); if (_verify_contents != P3D_VC_force) { @@ -370,75 +371,100 @@ get_plugin() { if (!success) { // Couldn't read it (or it wasn't current enough), so go get a new // one. - HTTPClient *http = HTTPClient::get_global_ptr(); - - // Try the super_mirror first. - if (!_super_mirror_url_prefix.empty()) { - // We don't bother putting a uniquifying query string when we're - // downloading this file from the super_mirror. The super_mirror - // is by definition a cache, so it doesn't make sense to bust - // caches here. - string url = _super_mirror_url_prefix + "contents.xml"; - PT(HTTPChannel) channel = http->make_channel(false); - channel->get_document(url); - - Filename tempfile = Filename::temporary("", "p3d_"); - if (!channel->download_to_file(tempfile)) { - cerr << "Unable to download " << url << "\n"; - tempfile.unlink(); - } else { - // Successfully downloaded from the super_mirror; try to read it. - success = read_contents_file(tempfile, true); - tempfile.unlink(); - } + if (!download_contents_file(contents_filename)) { + // We don't have a usable contents.xml file. + return false; } + is_fresh = true; + } - if (!success) { - // Go download contents.xml from the actual host. - ostringstream strm; - strm << _host_url_prefix << "contents.xml"; - // Append a uniquifying query string to the URL to force the - // download to go all the way through any caches. We use the time - // in seconds; that's unique enough. - strm << "?" << time(NULL); - string url = strm.str(); - - // We might as well explicitly request the cache to be disabled too, - // since we have an interface for that via HTTPChannel. - DocumentSpec request(url); - request.set_cache_control(DocumentSpec::CC_no_cache); - - PT(HTTPChannel) channel = http->make_channel(false); - channel->get_document(request); - - // Since we have to download some of it, might as well ask the core - // API to check all of it. - if (_verify_contents == P3D_VC_none) { - _verify_contents = P3D_VC_normal; - } - - // First, download it to a temporary file. - Filename tempfile = Filename::temporary("", "p3d_"); - if (!channel->download_to_file(tempfile)) { - cerr << "Unable to download " << url << "\n"; - - // Couldn't download, but try to read the existing contents.xml - // file anyway. Maybe it's good enough. - success = read_contents_file(contents_filename, false); - - } else { - // Successfully downloaded; read it and move it into place. - success = read_contents_file(tempfile, true); - } + // Now that we've downloaded the contents file successfully, start + // the Core API. + if (!get_core_api()) { + // We failed. Make sure contents.xml is up-to-date and try again. + if (!is_fresh && download_contents_file(contents_filename) && get_core_api()) { + return true; + } else { + return false; + } + } + return true; +} + +//////////////////////////////////////////////////////////////////// +// Function: Panda3D::download_contents_file +// Access: Protected +// Description: Redownloads the contents.xml file from the named +// URL without first checking if it is up to date. +// Returns true if we have a contents.xml file that +// might be usable, false otherwise. +//////////////////////////////////////////////////////////////////// +bool Panda3D:: +download_contents_file(const Filename &contents_filename) { + bool success = false; + HTTPClient *http = HTTPClient::get_global_ptr(); + + // Try the super_mirror first. + if (!_super_mirror_url_prefix.empty()) { + // We don't bother putting a uniquifying query string when we're + // downloading this file from the super_mirror. The super_mirror + // is by definition a cache, so it doesn't make sense to bust + // caches here. + string url = _super_mirror_url_prefix + "contents.xml"; + PT(HTTPChannel) channel = http->make_channel(false); + channel->get_document(url); + + Filename tempfile = Filename::temporary("", "p3d_"); + if (!channel->download_to_file(tempfile)) { + cerr << "Unable to download " << url << "\n"; + tempfile.unlink(); + } else { + // Successfully downloaded from the super_mirror; try to read it. + success = read_contents_file(tempfile, true); tempfile.unlink(); } } - if (success) { - // Now that we've downloaded the contents file successfully, start - // the Core API. - success = get_core_api(); + if (!success) { + // Go download contents.xml from the actual host. + ostringstream strm; + strm << _host_url_prefix << "contents.xml"; + // Append a uniquifying query string to the URL to force the + // download to go all the way through any caches. We use the time + // in seconds; that's unique enough. + strm << "?" << time(NULL); + string url = strm.str(); + + // We might as well explicitly request the cache to be disabled too, + // since we have an interface for that via HTTPChannel. + DocumentSpec request(url); + request.set_cache_control(DocumentSpec::CC_no_cache); + + PT(HTTPChannel) channel = http->make_channel(false); + channel->get_document(request); + + // Since we have to download some of it, might as well ask the core + // API to check all of it. + if (_verify_contents == P3D_VC_none) { + _verify_contents = P3D_VC_normal; + } + + // First, download it to a temporary file. + Filename tempfile = Filename::temporary("", "p3d_"); + if (!channel->download_to_file(tempfile)) { + cerr << "Unable to download " << url << "\n"; + + // Couldn't download, but try to read the existing contents.xml + // file anyway. Maybe it's good enough. + success = read_contents_file(contents_filename, false); + + } else { + // Successfully downloaded; read it and move it into place. + success = read_contents_file(tempfile, true); + } + + tempfile.unlink(); } return success; @@ -835,7 +861,6 @@ download_core_api() { } if (!success) { - cerr << "Couldn't download core API.\n"; return false; } diff --git a/direct/src/plugin_standalone/panda3d.h b/direct/src/plugin_standalone/panda3d.h index 94efc0c41f..2f902bac6e 100644 --- a/direct/src/plugin_standalone/panda3d.h +++ b/direct/src/plugin_standalone/panda3d.h @@ -42,6 +42,7 @@ public: protected: bool post_arg_processing(); bool get_plugin(); + bool download_contents_file(const Filename &contents_filename); bool read_contents_file(const Filename &contents_filename, bool fresh_download); void find_host(TiXmlElement *xcontents); void read_xhost(TiXmlElement *xhost); From 0bba09fc96f8f4f1d8b681798fce6eacea715d2a Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 1 Sep 2015 01:12:28 +0200 Subject: [PATCH 157/203] Add more customization options for splash screen, use proper Helvetica font for splash window on X11, change dimensioning rules to be more consistent with HTML/CSS rules --- direct/src/plugin/p3dInstance.cxx | 52 ++++++++- direct/src/plugin/p3dSplashWindow.cxx | 131 +++++++++++++++++++++-- direct/src/plugin/p3dSplashWindow.h | 19 +++- direct/src/plugin/p3dX11SplashWindow.cxx | 95 +++++++++++++--- direct/src/plugin/p3dX11SplashWindow.h | 9 +- 5 files changed, 277 insertions(+), 29 deletions(-) diff --git a/direct/src/plugin/p3dInstance.cxx b/direct/src/plugin/p3dInstance.cxx index 3f84bb441e..87db3f1edc 100644 --- a/direct/src/plugin/p3dInstance.cxx +++ b/direct/src/plugin/p3dInstance.cxx @@ -2769,6 +2769,7 @@ make_splash_window() { int r, g, b; if (parse_color(r, g, b, _fparams.lookup_token("bgcolor"))) { _splash_window->set_bgcolor(r, g, b); + _splash_window->set_bar_bgcolor(r, g, b); } else { nout << "parse failure on bgcolor " << _fparams.lookup_token("bgcolor") << "\n"; } @@ -2781,11 +2782,58 @@ make_splash_window() { nout << "parse failure on barcolor " << _fparams.lookup_token("barcolor") << "\n"; } } + if (_fparams.has_token("bar_bgcolor")) { + int r, g, b; + if (parse_color(r, g, b, _fparams.lookup_token("bar_bgcolor"))) { + _splash_window->set_bar_bgcolor(r, g, b); + } else { + nout << "parse failure on bar_bgcolor " << _fparams.lookup_token("bar_bgcolor") << "\n"; + } + } + if (_fparams.has_token("bar_border")) { + int border = _fparams.lookup_token_int("bar_border"); + _splash_window->set_bar_border(border); + } + if (_fparams.has_token("bar_bottom")) { + int bottom = _fparams.lookup_token_int("bar_bottom"); + _splash_window->set_bar_bottom(bottom); + } + if (_fparams.has_token("bar_width")) { + string bar_width = _fparams.lookup_token("bar_width"); + char *endptr; + long width = strtol(bar_width.c_str(), &endptr, 10); + bool percent = false; + + if (*endptr == '%') { + percent = true; + ++endptr; + } + if (*endptr == '\0' && width >= 0 && width < 65536) { + _splash_window->set_bar_width((int)width, percent); + } else { + nout << "parse failure on bar_width " << bar_width << "\n"; + } + } + if (_fparams.has_token("bar_height")) { + string bar_height = _fparams.lookup_token("bar_height"); + char *endptr; + long height = strtol(bar_height.c_str(), &endptr, 10); + bool percent = false; + + if (*endptr == '%') { + percent = true; + ++endptr; + } + if (*endptr == '\0' && height >= 0 && height < 65536) { + _splash_window->set_bar_height((int)height, percent); + } else { + nout << "parse failure on bar_height " << bar_height << "\n"; + } + } _splash_window->set_wparams(_wparams); _splash_window->set_install_label(_install_label); - - + P3DInstanceManager *inst_mgr = P3DInstanceManager::get_global_ptr(); // Go get the required images. diff --git a/direct/src/plugin/p3dSplashWindow.cxx b/direct/src/plugin/p3dSplashWindow.cxx index cbe58a50e2..d9dcd802dd 100644 --- a/direct/src/plugin/p3dSplashWindow.cxx +++ b/direct/src/plugin/p3dSplashWindow.cxx @@ -48,6 +48,15 @@ P3DSplashWindow(P3DInstance *inst, bool make_visible) : _barcolor_r = 0x6c; _barcolor_g = 0xa5; _barcolor_b = 0xe0; + _bar_bgcolor_r = _bgcolor_r; + _bar_bgcolor_g = _bgcolor_g; + _bar_bgcolor_b = _bgcolor_b; + _bar_border = 1; + _bar_bottom = 24; + _bar_width = 398; + _bar_height = 22; + _bar_width_ratio = 0.6; + _bar_height_ratio = 0.1; _button_width = 0; _button_height = 0; _button_x = 0; @@ -113,7 +122,7 @@ set_image_filename(const string &image_filename, ImagePlacement image_placement) //////////////////////////////////////////////////////////////////// // Function: P3DSplashWindow::set_fgcolor -// Access: Public, Virtual +// Access: Public // Description: Specifies the color that is used to display the text // above the loading bar. // @@ -129,7 +138,7 @@ set_fgcolor(int r, int g, int b) { //////////////////////////////////////////////////////////////////// // Function: P3DSplashWindow::set_bgcolor -// Access: Public, Virtual +// Access: Public // Description: Specifies the solid color that is displayed behind // the splash image, if any, or before the splash image // is loaded. @@ -146,7 +155,7 @@ set_bgcolor(int r, int g, int b) { //////////////////////////////////////////////////////////////////// // Function: P3DSplashWindow::set_barcolor -// Access: Public, Virtual +// Access: Public // Description: Specifies the color that is used to fill the // loading bar. // @@ -160,6 +169,105 @@ set_barcolor(int r, int g, int b) { _barcolor_b = b; } +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_bar_bgcolor +// Access: Public +// Description: Specifies the solid color that is displayed behind +// the loading bar. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_bar_bgcolor(int r, int g, int b) { + nout << "bar_bgcolor " << r << ", " << g << ", " << b << "\n"; + _bar_bgcolor_r = r; + _bar_bgcolor_g = g; + _bar_bgcolor_b = b; +} + +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_bar_border +// Access: Public +// Description: Sets the width in pixels of the border around the +// loading bar, or 0 not to draw a bar at all. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_bar_border(int border) { + nout << "bar_border " << border << "\n"; + _bar_border = border; +} + +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_bar_bottom +// Access: Public +// Description: Sets the amount of background pixels between the +// bottom edge of the window and the bottom edge of +// the loading bar border. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_bar_bottom(int bottom) { + nout << "bar_bottom " << bottom << "\n"; + _bar_bottom = bottom; +} + +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_bar_width +// Access: Public +// Description: Sets the width of the loading bar. If percent is +// true, it is interpreted as a percentage of the +// window width. If false, it is interpreted as an +// absolute width in pixels. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_bar_width(int width, bool percent) { + nout << "bar_width " << width; + if (percent) { + nout << '%'; + } + nout << '\n'; + + if (percent) { + _bar_width = -1; + _bar_width_ratio = abs(width) / 100.0; + } else { + _bar_width = abs(width); + _bar_width_ratio = 1.0; + } +} + +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_bar_height +// Access: Public +// Description: Sets the height of the loading bar. If percent is +// true, it is interpreted as a percentage of the +// window height. If false, it is interpreted as an +// absolute height in pixels. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_bar_height(int height, bool percent) { + nout << "bar_height " << height; + if (percent) { + nout << '%'; + } + nout << '\n'; + + if (percent) { + _bar_height = -1; + _bar_height_ratio = abs(height) / 100.0; + } else { + _bar_height = abs(height); + _bar_height_ratio = 1.0; + } +} + //////////////////////////////////////////////////////////////////// // Function: P3DSplashWindow::set_install_label // Access: Public, Virtual @@ -271,10 +379,21 @@ read_image_data(ImageData &image, string &data, void P3DSplashWindow:: get_bar_placement(int &bar_x, int &bar_y, int &bar_width, int &bar_height) { - bar_width = min((int)(_win_width * 0.6), 400); - bar_height = min((int)(_win_height * 0.1), 24); + + bar_width = (int)(_win_width * _bar_width_ratio); + bar_height = (int)(_win_height * _bar_height_ratio); + + if (_bar_width >= 0) { + bar_width = min(bar_width, _bar_width); + } + if (_bar_height >= 0) { + bar_height = min(bar_height, _bar_height); + } + + // Horizontally center the bar, and set it at a fixed distance + // from the bottom edge of the splash window. bar_x = (_win_width - bar_width) / 2; - bar_y = (_win_height - bar_height * 2); + bar_y = _win_height - _bar_bottom - _bar_border - bar_height; } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/plugin/p3dSplashWindow.h b/direct/src/plugin/p3dSplashWindow.h index 33feccead5..edbc02c448 100644 --- a/direct/src/plugin/p3dSplashWindow.h +++ b/direct/src/plugin/p3dSplashWindow.h @@ -54,9 +54,14 @@ public: virtual void set_image_filename(const string &image_filename, ImagePlacement image_placement); - virtual void set_fgcolor(int r, int g, int b); - virtual void set_bgcolor(int r, int g, int b); - virtual void set_barcolor(int r, int g, int b); + void set_fgcolor(int r, int g, int b); + void set_bgcolor(int r, int g, int b); + void set_barcolor(int r, int g, int b); + void set_bar_bgcolor(int r, int g, int b); + void set_bar_border(int border); + void set_bar_bottom(int bottom); + void set_bar_width(int width, bool percent=false); + void set_bar_height(int height, bool percent=false); virtual void set_install_label(const string &install_label); virtual void set_install_progress(double install_progress, bool is_progress_known, size_t received_data); @@ -105,7 +110,15 @@ protected: int _fgcolor_r, _fgcolor_g, _fgcolor_b; int _bgcolor_r, _bgcolor_g, _bgcolor_b; int _barcolor_r, _barcolor_g, _barcolor_b; + int _bar_bgcolor_r, _bar_bgcolor_g, _bar_bgcolor_b; + int _bar_border; +private: + int _bar_bottom; + int _bar_width, _bar_height; + double _bar_width_ratio, _bar_height_ratio; + +protected: // The region of the window for accepting button clicks. int _button_width, _button_height; int _button_x, _button_y; diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index 76c0175a18..6d3d2919a7 100644 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -25,6 +25,8 @@ #include #include +static const char *xfont_name = "-*-helvetica-medium-r-normal--12-120-*-*-p-*-iso8859-1"; + //////////////////////////////////////////////////////////////////// // Function: P3DX11SplashWindow::Constructor // Access: Public @@ -47,11 +49,14 @@ P3DX11SplashWindow(P3DInstance *inst, bool make_visible) : _display = None; _window = None; _screen = 0; + _font = NULL; _graphics_context = None; _bar_context = None; + _bar_bg_context = None; _fg_pixel = -1; _bg_pixel = -1; _bar_pixel = -1; + _bar_bg_pixel = -1; _own_display = false; _install_progress = 0.0; _progress_known = true; @@ -609,10 +614,15 @@ subprocess_run() { get_bar_placement(bar_x, bar_y, bar_width, bar_height); if (needs_draw_label) { - int text_width = _install_label.size() * 6; - int text_height = 10; + int direction, ascent, descent; + XCharStruct extents; + XTextExtents(_font, _install_label.c_str(), _install_label.size(), + &direction, &ascent, &descent, &extents); + + int text_width = extents.width; + int text_height = extents.ascent + extents.descent; int text_x = (_win_width - text_width) / 2; - int text_y = bar_y - 4; + int text_y = bar_y - descent - _bar_border - 4; XClearArea(_display, _window, text_x - 2, text_y - text_height - 2, @@ -624,25 +634,44 @@ subprocess_run() { } if (needs_redraw_progress) { - XClearArea(_display, _window, - bar_x, bar_y, bar_width, bar_height, false); - XDrawRectangle(_display, _window, _graphics_context, - bar_x, bar_y, bar_width, bar_height); + // Draw the bar background. + if (_bar_bg_context != None) { + XFillRectangle(_display, _window, _bar_bg_context, + bar_x, bar_y, bar_width, bar_height); + } else { + XClearArea(_display, _window, + bar_x, bar_y, bar_width, bar_height, false); + } + + // Draw the border around the bar. + int border_x = bar_x - 1; + int border_y = bar_y - 1; + int border_width = bar_width + 1; + int border_height = bar_height + 1; + + for (int i = 0; i < _bar_border; ++i) { + XDrawRectangle(_display, _window, _graphics_context, + border_x, border_y, border_width, border_height); + border_x -= 1; + border_y -= 1; + border_width += 2; + border_height += 2; + } needs_update_progress = true; needs_redraw_progress = false; } if (needs_update_progress) { if (_progress_known) { - int progress_width = (int)((bar_width - 2) * _install_progress + 0.5); + int progress_width = (int)((bar_width - 1) * _install_progress + 0.5); XFillRectangle(_display, _window, _bar_context, - bar_x + 1, bar_y + 1, - progress_width + 1, bar_height - 1); + bar_x, bar_y, + progress_width + 1, bar_height); } else { // Progress is unknown. Draw a moving block, not a progress bar // filling up. int block_width = (int)(bar_width * 0.1 + 0.5); - int block_travel = (bar_width - 2) - block_width; + int block_travel = (bar_width - 1) - block_width; int progress = (int)(_received_data * _unknown_progress_rate); progress = progress % (block_travel * 2); if (progress > block_travel) { @@ -650,8 +679,8 @@ subprocess_run() { } XFillRectangle(_display, _window, _bar_context, - bar_x + 1 + progress, bar_y + 1, - block_width + 1, bar_height - 1); + bar_x + progress, bar_y, + block_width + 1, bar_height); } needs_update_progress = false; } @@ -958,10 +987,17 @@ setup_gc() { return; } - XFontStruct* fs = XLoadQueryFont(_display, "6x13"); + _font = XLoadQueryFont(_display, xfont_name); + + if (_font != NULL) { + nout << "Loaded font " << xfont_name << "\n"; + } else { + nout << "Font " << xfont_name << " unavailable.\n"; + _font = XLoadQueryFont(_display, "6x13"); + } XGCValues gcval; - gcval.font = fs->fid; + gcval.font = _font->fid; gcval.function = GXcopy; gcval.plane_mask = AllPlanes; gcval.foreground = BlackPixel(_display, _screen); @@ -991,6 +1027,24 @@ setup_gc() { _bar_context = XCreateGC(_display, _window, GCFont | GCFunction | GCPlaneMask | GCForeground | GCBackground, &gcval); + + // And another for the background color of the bar. + if (_bar_bgcolor_r != _bgcolor_r || _bar_bgcolor_g != _bgcolor_g || + _bar_bgcolor_b != _bgcolor_b) { + XColor bar_bg; + bar_bg.red = _bar_bgcolor_r * 0x101; + bar_bg.green = _bar_bgcolor_g * 0x101; + bar_bg.blue = _bar_bgcolor_b * 0x101; + bar_bg.flags = DoRed | DoGreen | DoBlue; + + if (XAllocColor(_display, colormap, &bar_bg)) { + _bar_bg_pixel = bar_bg.pixel; + gcval.foreground = bar_bg.pixel; + } + + _bar_bg_context = XCreateGC(_display, _window, + GCFont | GCFunction | GCPlaneMask | GCForeground | GCBackground, &gcval); + } } //////////////////////////////////////////////////////////////////// @@ -1016,6 +1070,17 @@ close_window() { XFreeColors(_display, colormap, &_bar_pixel, 1, 0); } + if (_bar_bg_context != None) { + if (_bar_bg_context != _graphics_context) { + XFreeGC(_display, _bar_bg_context); + } + _bar_bg_context = None; + + // Also free the color we allocated. + Colormap colormap = DefaultColormap(_display, _screen); + XFreeColors(_display, colormap, &_bar_bg_pixel, 1, 0); + } + if (_fg_pixel != -1) { Colormap colormap = DefaultColormap(_display, _screen); XFreeColors(_display, colormap, &_fg_pixel, 1, 0); diff --git a/direct/src/plugin/p3dX11SplashWindow.h b/direct/src/plugin/p3dX11SplashWindow.h index b26e4dbc81..2622a31fa3 100644 --- a/direct/src/plugin/p3dX11SplashWindow.h +++ b/direct/src/plugin/p3dX11SplashWindow.h @@ -86,7 +86,7 @@ private: void setup_gc(); void close_window(); - void update_image(X11ImageData &image); + void update_image(X11ImageData &image); void compose_image(); bool scale_image(vector &image0, int &image0_width, int &image0_height, X11ImageData &image); @@ -123,17 +123,20 @@ private: double _install_progress; bool _progress_known; size_t _received_data; - + string _label_text; X11_Display *_display; int _screen; + XFontStruct *_font; GC _graphics_context; GC _bar_context; + GC _bar_bg_context; unsigned long _fg_pixel; unsigned long _bg_pixel; unsigned long _bar_pixel; - + unsigned long _bar_bg_pixel; + X11_Window _window; }; From 965ed034b20bed6b2f7382ac682586f13a7c78a3 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 1 Sep 2015 04:02:52 +0200 Subject: [PATCH 158/203] Implement border width and bar bgcolor in Windows splash window --- direct/src/plugin/p3dWinSplashWindow.cxx | 26 +++++++++++++++++++----- direct/src/plugin/p3dWinSplashWindow.h | 5 +++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/direct/src/plugin/p3dWinSplashWindow.cxx b/direct/src/plugin/p3dWinSplashWindow.cxx index dd3f79662a..eb071711db 100644 --- a/direct/src/plugin/p3dWinSplashWindow.cxx +++ b/direct/src/plugin/p3dWinSplashWindow.cxx @@ -37,6 +37,7 @@ P3DWinSplashWindow(P3DInstance *inst, bool make_visible) : _fg_brush = NULL; _bg_brush = NULL; _bar_brush = NULL; + _bar_bg_brush = NULL; _thread_running = false; _install_progress = 0.0; _progress_known = true; @@ -500,6 +501,7 @@ make_window() { _fg_brush = CreateSolidBrush(RGB(_fgcolor_r, _fgcolor_g, _fgcolor_b)); _bg_brush = CreateSolidBrush(RGB(_bgcolor_r, _bgcolor_g, _bgcolor_b)); _bar_brush = CreateSolidBrush(RGB(_barcolor_r, _barcolor_g, _barcolor_b)); + _bar_bg_brush = CreateSolidBrush(RGB(_bar_bgcolor_r, _bar_bgcolor_g, _bar_bgcolor_b)); } //////////////////////////////////////////////////////////////////// @@ -635,6 +637,10 @@ close_window() { DeleteObject(_bar_brush); _bar_brush = NULL; } + if (_bar_bg_brush != NULL) { + DeleteObject(_bar_bg_brush); + _bar_bg_brush = NULL; + } _background_image.dump_image(); _button_ready_image.dump_image(); @@ -794,7 +800,7 @@ paint_progress_bar(HDC dc) { RECT bar_rect = { bar_x, bar_y, bar_x + bar_width, bar_y + bar_height }; // Clear the entire progress bar to white (or the background color). - FillRect(dc, &bar_rect, _bg_brush); + FillRect(dc, &bar_rect, _bar_bg_brush); // Draw the interior of the progress bar in blue (or the bar color). if (_drawn_progress_known) { @@ -820,7 +826,17 @@ paint_progress_bar(HDC dc) { } // Now draw a black (or foreground) border around the progress bar. - FrameRect(dc, &bar_rect, _fg_brush); + if (_bar_border >= 0) { + RECT border_rect = bar_rect; + + for (int i = 0; i < _bar_border; ++i) { + --border_rect.left; + --border_rect.top; + ++border_rect.right; + ++border_rect.bottom; + FrameRect(dc, &border_rect, _fg_brush); + } + } if (!_drawn_label.empty()) { // Now draw the install_label right above it. @@ -836,7 +852,7 @@ paint_progress_bar(HDC dc) { int text_width = text_size.cx; int text_height = text_size.cy; int text_x = (_win_width - text_width) / 2; - int text_y = bar_y - (int)(text_height * 1.5); + int text_y = bar_y - (int)(text_height * 1.5) - _bar_border; // Clear the rectangle behind the text to white. RECT text_rect = { text_x - 2, text_y - 2, text_x + text_width + 4, text_y + text_height + 4 }; @@ -856,7 +872,7 @@ paint_progress_bar(HDC dc) { // Access: Private // Description: The windows event-processing handler. //////////////////////////////////////////////////////////////////// -LONG P3DWinSplashWindow:: +LRESULT P3DWinSplashWindow:: window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { case WM_DESTROY: @@ -937,7 +953,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { // Access: Private, Static // Description: The windows event-processing handler, static version. //////////////////////////////////////////////////////////////////// -LONG P3DWinSplashWindow:: +LRESULT P3DWinSplashWindow:: st_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { LONG_PTR self = GetWindowLongPtr(hwnd, GWLP_USERDATA); if (self == NULL) { diff --git a/direct/src/plugin/p3dWinSplashWindow.h b/direct/src/plugin/p3dWinSplashWindow.h index ca7e04b1cf..9c27f4578e 100644 --- a/direct/src/plugin/p3dWinSplashWindow.h +++ b/direct/src/plugin/p3dWinSplashWindow.h @@ -68,8 +68,8 @@ private: void paint_window(HDC dc); bool paint_image(HDC dc, const WinImageData &image, bool use_alpha); void paint_progress_bar(HDC dc); - LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); - static LONG WINAPI st_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); + LRESULT window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); + static LRESULT WINAPI st_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); private: class WinImageData : public ImageData { @@ -112,6 +112,7 @@ private: HBRUSH _fg_brush; HBRUSH _bg_brush; HBRUSH _bar_brush; + HBRUSH _bar_bg_brush; static bool _registered_window_class; }; From 8fd166e63f74bc51a64073f67d0ed34498642ef9 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 1 Sep 2015 04:06:29 +0200 Subject: [PATCH 159/203] panda3d.exe on Windows now respects child process exit codes --- direct/src/plugin/p3dSession.cxx | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index da9b30874f..27361a8d85 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -100,6 +100,8 @@ void P3DSession:: shutdown() { set_failed(); + int exit_code = 0; + if (_p3dpython_started) { // Tell the process we're going away. TiXmlDocument doc; @@ -139,7 +141,14 @@ shutdown() { nout << "Force-killing python process.\n"; TerminateProcess(_p3dpython_handle, 2); } - + + DWORD dw_exit_code = 0; + if (!GetExitCodeProcess(_p3dpython_handle, &dw_exit_code)) { + nout << "GetExitCodeProcess failed, error: " << GetLastError() << "\n"; + } else { + exit_code = (int)dw_exit_code; + } + CloseHandle(_p3dpython_handle); _p3dpython_handle = INVALID_HANDLE_VALUE; @@ -182,19 +191,15 @@ shutdown() { nout << "Python process has successfully stopped.\n"; if (WIFEXITED(status)) { - int code = WEXITSTATUS(status); - - nout << " exited normally, status = " << code << "\n"; - if (code != 0) { - _exit(code); - } + exit_code = WEXITSTATUS(status); + nout << " exited normally, status = " << exit_code << "\n"; } else if (WIFSIGNALED(status)) { nout << " signalled by " << WTERMSIG(status) << ", core = " << WCOREDUMP(status) << "\n"; // This seems to be a popular shell convention. - _exit(128 + WTERMSIG(status)); + exit_code = 128 + WTERMSIG(status); } else if (WIFSTOPPED(status)) { nout << " stopped by " << WSTOPSIG(status) << "\n"; @@ -220,6 +225,11 @@ shutdown() { // Close the pipe now. _pipe_read.close(); + + // If we had an exit status, pass it on to the runtime process. + if (exit_code != 0) { + _exit(exit_code); + } } //////////////////////////////////////////////////////////////////// From 7cae04027847dad5d5b243274c940b9ee454d033 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 2 Sep 2015 03:31:28 +0200 Subject: [PATCH 160/203] Support custom font settings in splash window + X11 impl --- direct/src/plugin/p3dInstance.cxx | 40 +++++++++++++ direct/src/plugin/p3dOsxSplashWindow.cxx | 2 +- direct/src/plugin/p3dSplashWindow.cxx | 61 ++++++++++++++++++++ direct/src/plugin/p3dSplashWindow.h | 20 +++++++ direct/src/plugin/p3dX11SplashWindow.cxx | 73 ++++++++++++++++++++++-- 5 files changed, 190 insertions(+), 6 deletions(-) diff --git a/direct/src/plugin/p3dInstance.cxx b/direct/src/plugin/p3dInstance.cxx index 87db3f1edc..87fbf64dee 100644 --- a/direct/src/plugin/p3dInstance.cxx +++ b/direct/src/plugin/p3dInstance.cxx @@ -2830,6 +2830,46 @@ make_splash_window() { nout << "parse failure on bar_height " << bar_height << "\n"; } } + if (_fparams.has_token("font_family")) { + string family = _fparams.lookup_token("font_family"); + _splash_window->set_font_family(family); + } + if (_fparams.has_token("font_size")) { + int size = _fparams.lookup_token_int("font_size"); + _splash_window->set_font_size(size); + } + if (_fparams.has_token("font_style")) { + string style = _fparams.lookup_token("font_style"); + + if (style == "normal") { + _splash_window->set_font_style(P3DSplashWindow::FS_normal); + } else if (style == "oblique") { + _splash_window->set_font_style(P3DSplashWindow::FS_oblique); + } else if (style == "italic") { + _splash_window->set_font_style(P3DSplashWindow::FS_italic); + } else { + nout << "parse_failure on font_style " << style << "\n"; + } + } + if (_fparams.has_token("font_weight")) { + string weight = _fparams.lookup_token("font_weight"); + + if (weight == "normal") { + _splash_window->set_font_weight(400); + } else if (weight == "bold") { + _splash_window->set_font_weight(700); + } else if (weight == "bolder") { + _splash_window->set_font_weight(700); + } else if (weight == "lighter") { + _splash_window->set_font_weight(100); + } else if (weight.size() == 3 && + weight[0] >= '1' && weight[0] <= '9' && + weight[1] == '0' && weight[2] == '0') { + _splash_window->set_font_weight(((int)weight[0] - 48) * 100); + } else { + nout << "parse_failure on font_weight " << weight << "\n"; + } + } _splash_window->set_wparams(_wparams); _splash_window->set_install_label(_install_label); diff --git a/direct/src/plugin/p3dOsxSplashWindow.cxx b/direct/src/plugin/p3dOsxSplashWindow.cxx index 979b35160d..6b979b2a7b 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.cxx +++ b/direct/src/plugin/p3dOsxSplashWindow.cxx @@ -683,7 +683,7 @@ paint_progress_bar(CGContextRef context) { // Choose a suitable font. float text_height = 15.0; - CGContextSelectFont(context, "Helvetica", text_height, kCGEncodingMacRoman); + CGContextSelectFont(context, _font_family.c_str(), text_height, kCGEncodingMacRoman); // Measure the text, for centering. CGContextSetTextPosition(context, 0, 0); diff --git a/direct/src/plugin/p3dSplashWindow.cxx b/direct/src/plugin/p3dSplashWindow.cxx index d9dcd802dd..37960d4499 100644 --- a/direct/src/plugin/p3dSplashWindow.cxx +++ b/direct/src/plugin/p3dSplashWindow.cxx @@ -57,6 +57,10 @@ P3DSplashWindow(P3DInstance *inst, bool make_visible) : _bar_height = 22; _bar_width_ratio = 0.6; _bar_height_ratio = 0.1; + _font_family = "Helvetica"; + _font_size = 12; + _font_style = FS_normal; + _font_weight = FW_normal; _button_width = 0; _button_height = 0; _button_x = 0; @@ -268,6 +272,63 @@ set_bar_height(int height, bool percent) { } } +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_font_family +// Access: Public +// Description: Sets the font family of the text above the loading +// bar. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_font_family(const string &family) { + nout << "font_family " << family << "\n"; + _font_family = family; +} + +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_font_size +// Access: Public +// Description: Sets the font size in pixels of the text above the +// loading bar. The default value is 12. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_font_size(int size) { + nout << "font_size " << size << "\n"; + _font_size = size; +} + +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_font_style +// Access: Public +// Description: Sets the font style of the text above the loading +// bar. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_font_style(FontStyle style) { + nout << "font_style " << style << "\n"; + _font_style = style; +} + +//////////////////////////////////////////////////////////////////// +// Function: P3DSplashWindow::set_font_weight +// Access: Public +// Description: Sets the font weight of the text above the loading +// bar. The default is FW_normal. It should be +// a multiple of 100 in the range 100-900. +// +// This may only be set before wparams is set. +//////////////////////////////////////////////////////////////////// +void P3DSplashWindow:: +set_font_weight(int weight) { + nout << "font_weight " << weight << "\n"; + _font_weight = weight; +} + //////////////////////////////////////////////////////////////////// // Function: P3DSplashWindow::set_install_label // Access: Public, Virtual diff --git a/direct/src/plugin/p3dSplashWindow.h b/direct/src/plugin/p3dSplashWindow.h index edbc02c448..3b98b2cfa1 100644 --- a/direct/src/plugin/p3dSplashWindow.h +++ b/direct/src/plugin/p3dSplashWindow.h @@ -51,6 +51,17 @@ public: IP_button_click, IP_none }; + enum FontStyle { + FS_normal, + FS_italic, + FS_oblique + }; + enum FontWeight { + FW_normal = 400, + FW_medium = 500, + FW_bold = 700, + FW_black = 900 + }; virtual void set_image_filename(const string &image_filename, ImagePlacement image_placement); @@ -62,6 +73,10 @@ public: void set_bar_bottom(int bottom); void set_bar_width(int width, bool percent=false); void set_bar_height(int height, bool percent=false); + void set_font_family(const string &family); + void set_font_size(int size); + void set_font_style(FontStyle style); + void set_font_weight(int weight); virtual void set_install_label(const string &install_label); virtual void set_install_progress(double install_progress, bool is_progress_known, size_t received_data); @@ -119,6 +134,11 @@ private: double _bar_width_ratio, _bar_height_ratio; protected: + string _font_family; + int _font_size; + FontStyle _font_style; + int _font_weight; + // The region of the window for accepting button clicks. int _button_width, _button_height; int _button_x, _button_y; diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index 6d3d2919a7..4c41b3ca4c 100644 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -25,8 +25,6 @@ #include #include -static const char *xfont_name = "-*-helvetica-medium-r-normal--12-120-*-*-p-*-iso8859-1"; - //////////////////////////////////////////////////////////////////// // Function: P3DX11SplashWindow::Constructor // Access: Public @@ -987,12 +985,77 @@ setup_gc() { return; } - _font = XLoadQueryFont(_display, xfont_name); + char style = 'r'; + if (_font_style == FS_oblique) { + style = 'o'; + } else if (_font_style == FS_italic) { + style = 'i'; + } + + // Determine the order at which to try the various weights. From: + // https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight + const char *const *try_weights; + const int num_weights = 7; + + if (_font_weight > 700) { + static const char *const weights[] = {"black", "bold", "demibold", "semibold", "medium", "regular", "extralight"}; + try_weights = weights; + + } else if (_font_weight > 600) { + static const char *const weights[] = {"bold", "black", "demibold", "semibold", "medium", "regular", "extralight"}; + try_weights = weights; + + } else if (_font_weight > 500) { + static const char *const weights[] = {"demibold", "semibold", "bold", "black", "medium", "regular", "extralight"}; + try_weights = weights; + + } else if (_font_weight == 500) { + static const char *const weights[] = {"medium", "regular", "extralight", "demibold", "semibold", "bold", "black"}; + try_weights = weights; + + } else if (_font_weight >= 400) { + static const char *const weights[] = {"regular", "medium", "extralight", "demibold", "semibold", "bold", "black"}; + try_weights = weights; + + } else { + static const char *const weights[] = {"extralight", "regular", "medium", "demibold", "semibold", "bold", "black"}; + try_weights = weights; + } + + char font_name[1024]; + + // Go through the weights array to find the best matching font. + for (int i = 0; i < num_weights; ++i) { + const char *weight_name = try_weights[i]; + + // Compose the proper pattern for finding the desired font face. + snprintf(font_name, 1024, "-*-%s-%s-%c-normal--%d-*-*-*-*-*-iso8859-1", + _font_family.c_str(), weight_name, style, _font_size); + + _font = XLoadQueryFont(_display, font_name); + if (_font != NULL) { + break; + } + nout << "Font " << font_name << " unavailable.\n"; + + if (style == 'i' || style == 'o') { + // If oblique is not found, try italic, and vice versa. + char style2 = 216 - style; + snprintf(font_name, 1024, "-*-%s-%s-%c-normal--%d-*-*-*-*-*-iso8859-1", + _font_family.c_str(), weight_name, style2, _font_size); + + _font = XLoadQueryFont(_display, font_name); + if (_font != NULL) { + break; + } + nout << "Font " << font_name << " unavailable.\n"; + } + } if (_font != NULL) { - nout << "Loaded font " << xfont_name << "\n"; + nout << "Loaded font " << font_name << "\n"; } else { - nout << "Font " << xfont_name << " unavailable.\n"; + nout << "Using fallback font 6x13.\n"; _font = XLoadQueryFont(_display, "6x13"); } From be58900723e99145fbef6ff9bf1f634566fa259e Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 2 Sep 2015 03:52:30 +0200 Subject: [PATCH 161/203] Implement custom font settings for splash window on Windows --- direct/src/plugin/p3dWinSplashWindow.cxx | 16 +++++++++++++--- direct/src/plugin/p3dWinSplashWindow.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/direct/src/plugin/p3dWinSplashWindow.cxx b/direct/src/plugin/p3dWinSplashWindow.cxx index eb071711db..999abdb86f 100644 --- a/direct/src/plugin/p3dWinSplashWindow.cxx +++ b/direct/src/plugin/p3dWinSplashWindow.cxx @@ -34,6 +34,7 @@ P3DWinSplashWindow(P3DInstance *inst, bool make_visible) : _thread = NULL; _thread_id = 0; _hwnd = NULL; + _font = NULL; _fg_brush = NULL; _bg_brush = NULL; _bar_brush = NULL; @@ -498,6 +499,17 @@ make_window() { ShowWindow(_hwnd, SW_HIDE); } + // Load the requested font. + _font = CreateFontA(-_font_size, 0, 0, 0, _font_weight, + (_font_style != FS_normal), FALSE, FALSE, + ANSI_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, + CLEARTYPE_QUALITY, VARIABLE_PITCH, _font_family.c_str()); + + if (_font == NULL) { + nout << "CreateFont failed: " << GetLastError() << "\n"; + _font = (HFONT)GetStockObject(ANSI_VAR_FONT); + } + _fg_brush = CreateSolidBrush(RGB(_fgcolor_r, _fgcolor_g, _fgcolor_b)); _bg_brush = CreateSolidBrush(RGB(_bgcolor_r, _bgcolor_g, _bgcolor_b)); _bar_brush = CreateSolidBrush(RGB(_barcolor_r, _barcolor_g, _barcolor_b)); @@ -840,12 +852,10 @@ paint_progress_bar(HDC dc) { if (!_drawn_label.empty()) { // Now draw the install_label right above it. - const char *text = _drawn_label.c_str(); - HFONT font = (HFONT)GetStockObject(ANSI_VAR_FONT); // Measure the text, for centering. - SelectObject(dc, font); + SelectObject(dc, _font); SIZE text_size; GetTextExtentPoint32(dc, text, strlen(text), &text_size); diff --git a/direct/src/plugin/p3dWinSplashWindow.h b/direct/src/plugin/p3dWinSplashWindow.h index 9c27f4578e..33c9f9d584 100644 --- a/direct/src/plugin/p3dWinSplashWindow.h +++ b/direct/src/plugin/p3dWinSplashWindow.h @@ -109,6 +109,7 @@ private: HANDLE _thread; DWORD _thread_id; HWND _hwnd; + HFONT _font; HBRUSH _fg_brush; HBRUSH _bg_brush; HBRUSH _bar_brush; From f9f62f17f1feb808fde79af5b3a6a535f6121855 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 2 Sep 2015 22:27:03 +0200 Subject: [PATCH 162/203] Implement font customization options in MacOSX splash window Also, switch to non-deprecated CoreText API --- direct/src/plugin/p3dOsxSplashWindow.cxx | 168 +++++++++++++---------- direct/src/plugin/p3dOsxSplashWindow.h | 2 + 2 files changed, 100 insertions(+), 70 deletions(-) diff --git a/direct/src/plugin/p3dOsxSplashWindow.cxx b/direct/src/plugin/p3dOsxSplashWindow.cxx index 6b979b2a7b..53f9976d4c 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.cxx +++ b/direct/src/plugin/p3dOsxSplashWindow.cxx @@ -36,6 +36,7 @@ P3DOsxSplashWindow:: P3DOsxSplashWindow(P3DInstance *inst, bool make_visible) : P3DSplashWindow(inst, make_visible) { + _font_attribs = NULL; _install_progress = 0; _progress_known = true; _received_data = 0; @@ -59,6 +60,9 @@ P3DOsxSplashWindow:: DisposeWindow(_toplevel_window); _toplevel_window = NULL; } + if (_font_attribs != NULL) { + CFRelease(_font_attribs); + } } //////////////////////////////////////////////////////////////////// @@ -123,6 +127,41 @@ set_wparams(const P3DWindowParams &wparams) { } } } + + // Determine the attributes of the font we're going to use. + int symbolic = 0; + if (_font_style != FS_normal) { + symbolic |= kCTFontItalicTrait; + } + if (_font_weight > 500) { + symbolic |= kCTFontBoldTrait; + } + CFNumberRef symbolic_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &symbolic); + + CFStringRef traits_keys[1] = { kCTFontSymbolicTrait }; + CFTypeRef traits_values[1] = { symbolic_ref }; + CFDictionaryRef traits = CFDictionaryCreate(kCFAllocatorDefault, (const void **)&traits_keys, (const void **)&traits_values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + + CFStringRef family = CFStringCreateWithCString(NULL, _font_family.c_str(), kCFStringEncodingUTF8); + + CFStringRef attribs_keys[2] = { kCTFontFamilyNameAttribute, kCTFontTraitsAttribute }; + CFTypeRef attribs_values[2] = { family, traits }; + CFDictionaryRef attribs = CFDictionaryCreate(kCFAllocatorDefault, (const void **)&attribs_keys, (const void **)&attribs_values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + + // Create the font object. + CTFontDescriptorRef font_desc = CTFontDescriptorCreateWithAttributes(attribs); + CTFontRef font = CTFontCreateWithFontDescriptor(font_desc, _font_size, NULL); + + CFStringRef keys[1] = { kCTFontAttributeName }; + CFTypeRef values[1] = { font }; + _font_attribs = CFDictionaryCreate(kCFAllocatorDefault, (const void **)&keys, (const void **)&values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + + CFRelease(font); + CFRelease(font_desc); + CFRelease(attribs); + CFRelease(traits); + CFRelease(family); + CFRelease(symbolic_ref); } //////////////////////////////////////////////////////////////////// @@ -171,6 +210,9 @@ set_image_filename(const string &image_filename, ImagePlacement image_placement) case IP_button_click: load_image(_button_click_image, image_filename); break; + + default: + return; } refresh(); @@ -333,10 +375,8 @@ paint_window_osx_cgcontext(CGContextRef context) { CGColorRef bg = CGColorCreate(rgb_space, bg_components); CGRect region = { { 0, 0 }, { _win_width, _win_height } }; - CGContextBeginPath(context); CGContextSetFillColorWithColor(context, bg); - CGContextAddRect(context, region); - CGContextFillPath(context); + CGContextFillRect(context, region); CGColorRelease(bg); CGColorSpaceRelease(rgb_space); @@ -445,8 +485,6 @@ handle_event_osx_event_record(const P3D_event_data &event) { //////////////////////////////////////////////////////////////////// bool P3DOsxSplashWindow:: handle_event_osx_cocoa(const P3D_event_data &event) { - bool retval = false; - assert(event._event_type == P3D_ET_osx_cocoa); const P3DCocoaEvent &ce = event._event._osx_cocoa._event; @@ -455,33 +493,31 @@ handle_event_osx_cocoa(const P3D_event_data &event) { if (_visible) { CGContextRef context = ce.data.draw.context; paint_window_osx_cgcontext(context); - retval = true; + return true; + } else { + return false; } - break; case P3DCocoaEventMouseDown: set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, true); - retval = true; - break; + return true; case P3DCocoaEventMouseUp: set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, false); - retval = true; - break; + return true; case P3DCocoaEventMouseMoved: case P3DCocoaEventMouseDragged: set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, _mouse_down); - retval = true; - break; + return true; case P3DCocoaEventFocusChanged: _mouse_active = (ce.data.focus.hasFocus != 0); - retval = true; - break; - } + return true; - return retval; + default: + return false; + } } //////////////////////////////////////////////////////////////////// @@ -612,42 +648,33 @@ paint_image(CGContextRef context, const OsxImageData &image) { //////////////////////////////////////////////////////////////////// void P3DOsxSplashWindow:: paint_progress_bar(CGContextRef context) { - // Get some colors we'll need. We can't just use - // CGColorGetConstantColor(), since that requires 10.5. CGFloat fg_components[] = { _fgcolor_r / 255.0f, _fgcolor_g / 255.0f, _fgcolor_b / 255.0f, 1 }; CGFloat bg_components[] = { _bgcolor_r / 255.0f, _bgcolor_g / 255.0f, _bgcolor_b / 255.0f, 1 }; CGFloat bar_components[] = { _barcolor_r / 255.0f, _barcolor_g / 255.0f, _barcolor_b / 255.0f, 1 }; + CGFloat bar_bg_components[] = { _bar_bgcolor_r / 255.0f, _bar_bgcolor_g / 255.0f, _bar_bgcolor_b / 255.0f, 1 }; CGColorSpaceRef rgb_space = CGColorSpaceCreateDeviceRGB(); CGColorRef fg = CGColorCreate(rgb_space, fg_components); CGColorRef bg = CGColorCreate(rgb_space, bg_components); CGColorRef bar = CGColorCreate(rgb_space, bar_components); + CGColorRef bar_bg = CGColorCreate(rgb_space, bar_bg_components); + // Get the proper placement for the progress bar. int bar_x, bar_y, bar_width, bar_height; get_bar_placement(bar_x, bar_y, bar_width, bar_height); - // We offset the bar by half a pixel, so we'll be drawing the - // one-pixel line through the middle of a pixel, and it won't try to - // antialias itself into a half-black two-pixel line. - float bar_xf = bar_x + 0.5; - float bar_yf = bar_y - 0.5; - - CGRect bar_rect = { { bar_xf, bar_yf }, { bar_width, bar_height } }; + CGRect bar_rect = { { bar_x, bar_y }, { bar_width, bar_height } }; // Clear the entire progress bar to white (or the background color). - CGContextBeginPath(context); - CGContextSetFillColorWithColor(context, bg); - CGContextAddRect(context, bar_rect); - CGContextFillPath(context); + CGContextSetFillColorWithColor(context, bar_bg); + CGContextFillRect(context, bar_rect); // Draw the interior of the progress bar in blue (or the bar color). if (_progress_known) { int progress_width = (int)(bar_width * _install_progress + 0.5); if (progress_width != 0) { - CGRect prog = { { bar_xf, bar_yf }, { progress_width, bar_height } }; - CGContextBeginPath(context); + CGRect prog = { { bar_x, bar_y }, { progress_width, bar_height } }; CGContextSetFillColorWithColor(context, bar); - CGContextAddRect(context, prog); - CGContextFillPath(context); + CGContextFillRect(context, prog); } } else { // Progress is unknown. Draw a moving block, not a progress bar @@ -660,57 +687,58 @@ paint_progress_bar(CGContextRef context) { progress = block_travel * 2 - progress; } - CGRect prog = { { bar_xf + progress, bar_yf }, { block_width, bar_height } }; - CGContextBeginPath(context); + CGRect prog = { { bar_x + progress, bar_y }, { block_width, bar_height } }; CGContextSetFillColorWithColor(context, bar); - CGContextAddRect(context, prog); - CGContextFillPath(context); + CGContextFillRect(context, prog); } - + // Draw the black stroke around the progress bar. - CGContextBeginPath(context); - CGContextSetLineWidth(context, 1); - CGContextSetStrokeColorWithColor(context, fg); - CGContextAddRect(context, bar_rect); - CGContextStrokePath(context); + if (_bar_border > 0) { + // We offset the border by half a pixel, so we'll be drawing the + // one-pixel line through the middle of a pixel, and it won't try to + // antialias itself into a half-black two-pixel line. + CGRect border_rect = { { bar_x - 0.5, bar_y - 0.5 }, + { bar_width + 1, bar_height + 1 } }; + + CGContextBeginPath(context); + CGContextSetLineWidth(context, 1); + CGContextSetStrokeColorWithColor(context, fg); + + for (int i = 0; i < _bar_border; ++i) { + CGContextAddRect(context, border_rect); + border_rect.origin.x -= 1; + border_rect.origin.y -= 1; + border_rect.size.width += 2; + border_rect.size.height += 2; + } + CGContextStrokePath(context); + } if (!_install_label.empty()) { - // Now draw the install_label right above it. - // Need to invert the text so it won't be upside-down. CGAffineTransform text_xform = CGAffineTransformMakeScale(1, -1); CGContextSetTextMatrix(context, text_xform); - // Choose a suitable font. - float text_height = 15.0; - CGContextSelectFont(context, _font_family.c_str(), text_height, kCGEncodingMacRoman); + // Now draw the install_label right above it. + CFStringRef string = CFStringCreateWithCString(NULL, _install_label.c_str(), kCFStringEncodingUTF8); + CFAttributedStringRef attr_string = CFAttributedStringCreate(NULL, string, _font_attribs); + CTLineRef line = CTLineCreateWithAttributedString(attr_string); - // Measure the text, for centering. - CGContextSetTextPosition(context, 0, 0); - CGContextSetTextDrawingMode(context, kCGTextInvisible); - CGContextShowText(context, _install_label.data(), _install_label.length()); - CGPoint end_point = CGContextGetTextPosition(context); - float text_width = end_point.x; - - int text_x = (int)(_win_width - text_width) / 2; - int text_y = (int)(bar_y - text_height * 1.5); - - // Clear the rectangle behind the text to bg. - CGRect text_rect = { { text_x - 2, text_y - 2 }, { text_width + 4, text_height + 4 } }; - - CGContextBeginPath(context); - CGContextAddRect(context, text_rect); - CGContextSetFillColorWithColor(context, bg); - CGContextFillPath(context); + // Determine the placement based on the size of the text. + CGRect bounds = CTLineGetImageBounds(line, context); + float text_x = (_win_width - bounds.size.width) / 2.0f - bounds.origin.x; + float text_y = bar_y + bounds.origin.y - 4 - _bar_border; // And finally, draw the text. - CGContextSetTextDrawingMode(context, kCGTextFill); - CGContextSetFillColorWithColor(context, fg); + CGContextSetTextPosition(context, text_x, text_y); + CTLineDraw(line, context); - CGContextShowTextAtPoint(context, text_x, text_y + text_height, - _install_label.data(), _install_label.length()); + CFRelease(line); + CFRelease(attr_string); + CFRelease(string); } + CGColorRelease(bar_bg); CGColorRelease(bar); CGColorRelease(bg); CGColorRelease(fg); diff --git a/direct/src/plugin/p3dOsxSplashWindow.h b/direct/src/plugin/p3dOsxSplashWindow.h index 03149bfc98..8c4cab382b 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.h +++ b/direct/src/plugin/p3dOsxSplashWindow.h @@ -83,6 +83,8 @@ private: OsxImageData _button_rollover_image; OsxImageData _button_click_image; + CFDictionaryRef _font_attribs; + string _install_label; double _install_progress; bool _progress_known; From e1d7c737cf16cbc46f1b22f89205c146c88999bc Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Sep 2015 03:29:42 +0200 Subject: [PATCH 163/203] Fix "... is not a Multifile" error in pdeployed executables --- direct/src/plugin_standalone/panda3dBase.cxx | 10 +++++----- direct/src/plugin_standalone/panda3dBase.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/direct/src/plugin_standalone/panda3dBase.cxx b/direct/src/plugin_standalone/panda3dBase.cxx index 6b38e221f2..707eddedd2 100644 --- a/direct/src/plugin_standalone/panda3dBase.cxx +++ b/direct/src/plugin_standalone/panda3dBase.cxx @@ -342,7 +342,7 @@ make_parent_window() { //////////////////////////////////////////////////////////////////// P3D_instance *Panda3DBase:: create_instance(const string &p3d, bool start_instance, - char **args, int num_args, const int &p3d_offset) { + char **args, int num_args, int p3d_offset) { // Check to see if the p3d filename we were given is a URL, or a // local file. Filename p3d_filename = Filename::from_os_specific(p3d); @@ -356,9 +356,9 @@ create_instance(const string &p3d, bool start_instance, p3d_filename.make_absolute(); os_p3d_filename = p3d_filename.to_os_specific(); - } + } if (is_local) { - read_p3d_info(p3d_filename); + read_p3d_info(p3d_filename, p3d_offset); } // Build up the token list. @@ -454,9 +454,9 @@ delete_instance(P3D_instance *inst) { // parameters (like width and height). //////////////////////////////////////////////////////////////////// bool Panda3DBase:: -read_p3d_info(const Filename &p3d_filename) { +read_p3d_info(const Filename &p3d_filename, int p3d_offset) { PT(Multifile) mf = new Multifile; - if (!mf->open_read(p3d_filename)) { + if (!mf->open_read(p3d_filename, p3d_offset)) { return false; } int si = mf->find_subfile("p3d_info.xml"); diff --git a/direct/src/plugin_standalone/panda3dBase.h b/direct/src/plugin_standalone/panda3dBase.h index f53e59b14c..b3ace6256f 100644 --- a/direct/src/plugin_standalone/panda3dBase.h +++ b/direct/src/plugin_standalone/panda3dBase.h @@ -49,10 +49,10 @@ protected: P3D_instance * create_instance(const string &p3d, bool start_instance, - char **args, int num_args, const int &p3d_offset = 0); + char **args, int num_args, int p3d_offset = 0); void delete_instance(P3D_instance *instance); - bool read_p3d_info(const Filename &p3d_filename); + bool read_p3d_info(const Filename &p3d_filename, int p3d_offset = 0); bool parse_token(const char *arg); bool parse_int_pair(const char *arg, int &x, int &y); string lookup_token(const string &keyword) const; From c33f3b3dca1b80c467c002edf6a577430b18e983 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 3 Sep 2015 03:49:01 +0200 Subject: [PATCH 164/203] Force httplib2 and pyglet to be platform-independent packages --- direct/src/p3d/thirdparty.pdef | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/src/p3d/thirdparty.pdef b/direct/src/p3d/thirdparty.pdef index b657aac95b..bc72b39eb7 100644 --- a/direct/src/p3d/thirdparty.pdef +++ b/direct/src/p3d/thirdparty.pdef @@ -137,7 +137,7 @@ class pyopengl(package): module('OpenGL.GLU', 'OpenGL.GLUT', 'OpenGL.GLE', 'OpenGL.GLX') class httplib2(package): - config(display_name = "httplib2") + config(display_name = "httplib2", platform_specific = False) require('panda3d') module('httplib2', required = True) @@ -149,7 +149,7 @@ class box2d(package): module('Box2D', required = True) class pyglet(package): - config(display_name = "pyglet") - require('panda3d') + config(display_name = "pyglet", platform_specific = False) + require('panda3d', 'morepy') module('pyglet', required = True) From 1a0fb8f012ca96359f1f575182c2899c17a285bf Mon Sep 17 00:00:00 2001 From: enn0x Date: Sat, 5 Sep 2015 00:54:20 +0200 Subject: [PATCH 165/203] Panda Nodes returned by raycast or sweep querries are no longer 'const' --- panda/src/bullet/bulletAllHitsRayResult.cxx | 2 +- panda/src/bullet/bulletAllHitsRayResult.h | 2 +- panda/src/bullet/bulletBodyNode.cxx | 2 +- panda/src/bullet/bulletClosestHitRayResult.cxx | 4 ++-- panda/src/bullet/bulletClosestHitRayResult.h | 2 +- panda/src/bullet/bulletClosestHitSweepResult.cxx | 4 ++-- panda/src/bullet/bulletClosestHitSweepResult.h | 2 +- panda/src/bullet/bulletContactResult.cxx | 2 +- panda/src/bullet/bulletPersistentManifold.cxx | 8 ++++---- panda/src/bullet/bulletPersistentManifold.h | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/panda/src/bullet/bulletAllHitsRayResult.cxx b/panda/src/bullet/bulletAllHitsRayResult.cxx index 7d57feb767..953390820e 100644 --- a/panda/src/bullet/bulletAllHitsRayResult.cxx +++ b/panda/src/bullet/bulletAllHitsRayResult.cxx @@ -156,7 +156,7 @@ get_hit_fraction() const { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -const PandaNode *BulletRayHit:: +PandaNode *BulletRayHit:: get_node() const { return (_object) ? (PandaNode *)_object->getUserPointer() : NULL; diff --git a/panda/src/bullet/bulletAllHitsRayResult.h b/panda/src/bullet/bulletAllHitsRayResult.h index 26e04034af..6825e0ff68 100644 --- a/panda/src/bullet/bulletAllHitsRayResult.h +++ b/panda/src/bullet/bulletAllHitsRayResult.h @@ -33,7 +33,7 @@ struct EXPCL_PANDABULLET BulletRayHit { PUBLISHED: INLINE static BulletRayHit empty(); - const PandaNode *get_node() const; + PandaNode *get_node() const; LPoint3 get_hit_pos() const; LVector3 get_hit_normal() const; PN_stdfloat get_hit_fraction() const; diff --git a/panda/src/bullet/bulletBodyNode.cxx b/panda/src/bullet/bulletBodyNode.cxx index c494afe00c..03c24ffaa1 100644 --- a/panda/src/bullet/bulletBodyNode.cxx +++ b/panda/src/bullet/bulletBodyNode.cxx @@ -761,7 +761,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { dg.add_stdfloat(get_ccd_swept_sphere_radius()); dg.add_stdfloat(get_ccd_motion_threshold()); - for (int i = 0; i < _shapes.size(); ++i) { + for (unsigned int i = 0; i < _shapes.size(); ++i) { manager->write_pointer(dg, get_shape(i)); manager->write_pointer(dg, get_shape_transform(i)); } diff --git a/panda/src/bullet/bulletClosestHitRayResult.cxx b/panda/src/bullet/bulletClosestHitRayResult.cxx index a1b2910b65..acde58087b 100644 --- a/panda/src/bullet/bulletClosestHitRayResult.cxx +++ b/panda/src/bullet/bulletClosestHitRayResult.cxx @@ -87,11 +87,11 @@ get_hit_fraction() const { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -const PandaNode *BulletClosestHitRayResult:: +PandaNode *BulletClosestHitRayResult:: get_node() const { const btCollisionObject *objectPtr = m_collisionObject; - return (objectPtr) ? (const PandaNode *)objectPtr->getUserPointer() : NULL; + return (objectPtr) ? (PandaNode *)objectPtr->getUserPointer() : NULL; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/bullet/bulletClosestHitRayResult.h b/panda/src/bullet/bulletClosestHitRayResult.h index 1a3846ab89..dcb9e325b9 100644 --- a/panda/src/bullet/bulletClosestHitRayResult.h +++ b/panda/src/bullet/bulletClosestHitRayResult.h @@ -38,7 +38,7 @@ PUBLISHED: bool has_hit() const; - const PandaNode *get_node() const; + PandaNode *get_node() const; LPoint3 get_hit_pos() const; LVector3 get_hit_normal() const; PN_stdfloat get_hit_fraction() const; diff --git a/panda/src/bullet/bulletClosestHitSweepResult.cxx b/panda/src/bullet/bulletClosestHitSweepResult.cxx index 7c4a12c336..6245495490 100644 --- a/panda/src/bullet/bulletClosestHitSweepResult.cxx +++ b/panda/src/bullet/bulletClosestHitSweepResult.cxx @@ -67,11 +67,11 @@ get_hit_fraction() const { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -const PandaNode *BulletClosestHitSweepResult:: +PandaNode *BulletClosestHitSweepResult:: get_node() const { const btCollisionObject *objectPtr = m_hitCollisionObject; - return (objectPtr) ? (const PandaNode *)objectPtr->getUserPointer() : NULL; + return (objectPtr) ? (PandaNode *)objectPtr->getUserPointer() : NULL; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/bullet/bulletClosestHitSweepResult.h b/panda/src/bullet/bulletClosestHitSweepResult.h index 6d142452b0..7ff7e524b4 100644 --- a/panda/src/bullet/bulletClosestHitSweepResult.h +++ b/panda/src/bullet/bulletClosestHitSweepResult.h @@ -38,7 +38,7 @@ PUBLISHED: bool has_hit() const; - const PandaNode *get_node() const; + PandaNode *get_node() const; LPoint3 get_hit_pos() const; LVector3 get_hit_normal() const; PN_stdfloat get_hit_fraction() const; diff --git a/panda/src/bullet/bulletContactResult.cxx b/panda/src/bullet/bulletContactResult.cxx index b9adc65c75..f65d66928f 100644 --- a/panda/src/bullet/bulletContactResult.cxx +++ b/panda/src/bullet/bulletContactResult.cxx @@ -63,7 +63,7 @@ BulletContactResult() : btCollisionWorld::ContactResultCallback() { #if BT_BULLET_VERSION >= 281 //////////////////////////////////////////////////////////////////// // Function: BulletContactResult::use_filter -// Access: Published +// Access: Protected // Description: //////////////////////////////////////////////////////////////////// void BulletContactResult:: diff --git a/panda/src/bullet/bulletPersistentManifold.cxx b/panda/src/bullet/bulletPersistentManifold.cxx index 4d345294e6..f356f6efe0 100644 --- a/panda/src/bullet/bulletPersistentManifold.cxx +++ b/panda/src/bullet/bulletPersistentManifold.cxx @@ -63,7 +63,7 @@ clear_manifold() { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -const PandaNode *BulletPersistentManifold:: +PandaNode *BulletPersistentManifold:: get_node0() { #if BT_BULLET_VERSION >= 281 @@ -72,7 +72,7 @@ get_node0() { const btCollisionObject *obj = (btCollisionObject *)_manifold->getBody0(); #endif - return (obj) ? (const PandaNode *)obj->getUserPointer(): NULL; + return (obj) ? (PandaNode *)obj->getUserPointer(): NULL; } //////////////////////////////////////////////////////////////////// @@ -80,7 +80,7 @@ get_node0() { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -const PandaNode *BulletPersistentManifold:: +PandaNode *BulletPersistentManifold:: get_node1() { #if BT_BULLET_VERSION >= 281 @@ -89,7 +89,7 @@ get_node1() { const btCollisionObject *obj = (btCollisionObject *)_manifold->getBody1(); #endif - return (obj) ? (const PandaNode *)obj->getUserPointer(): NULL; + return (obj) ? (PandaNode *)obj->getUserPointer(): NULL; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/bullet/bulletPersistentManifold.h b/panda/src/bullet/bulletPersistentManifold.h index 0e63c48c08..ee976739c9 100644 --- a/panda/src/bullet/bulletPersistentManifold.h +++ b/panda/src/bullet/bulletPersistentManifold.h @@ -32,8 +32,8 @@ class EXPCL_PANDABULLET BulletPersistentManifold { PUBLISHED: INLINE ~BulletPersistentManifold(); - const PandaNode *get_node0(); - const PandaNode *get_node1(); + PandaNode *get_node0(); + PandaNode *get_node1(); int get_num_manifold_points() const; BulletManifoldPoint *get_manifold_point(int idx) const; From 03a13993785af90be3d342b83be19c657c13d871 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 5 Sep 2015 13:12:48 +0200 Subject: [PATCH 166/203] Remove accidentally checked in debug message --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 1eda94595b..0a1dc16a0b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -11331,7 +11331,6 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, if (_supports_clear_buffer) { // For buffer textures we need to clear the underlying storage. string clear_data = tex->get_clear_data(); - cerr << "clearing buffer data\n"; _glClearBufferData(GL_TEXTURE_BUFFER, internal_format, external_format, component_type, (const void *)clear_data.data()); From e1c0ae7f1be9e8478778306a0d42acc89a97bfb8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 5 Sep 2015 15:28:12 +0200 Subject: [PATCH 167/203] Add F_hardware_skinning/p3d_TransformTable to GLSL on 1.9 branch, as requested Uses a hack to prevent breaking ABI compat --- panda/src/display/standardMunger.cxx | 40 ++++++--- panda/src/glstuff/glGeomMunger_src.cxx | 2 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 6 +- panda/src/glstuff/glShaderContext_src.cxx | 84 +++++++++++++++++++ panda/src/glstuff/glShaderContext_src.h | 7 ++ panda/src/pgraph/shaderAttrib.h | 1 + 6 files changed, 125 insertions(+), 15 deletions(-) diff --git a/panda/src/display/standardMunger.cxx b/panda/src/display/standardMunger.cxx index 922150a114..c33c95f7e2 100644 --- a/panda/src/display/standardMunger.cxx +++ b/panda/src/display/standardMunger.cxx @@ -37,14 +37,13 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, StateMunger(gsg), _num_components(num_components), _numeric_type(numeric_type), - _contents(contents) + _contents(contents), + _munge_color(false), + _munge_color_scale(false), + _auto_shader(false) { _render_mode = DCAST(RenderModeAttrib, state->get_attrib(RenderModeAttrib::get_class_slot())); - _munge_color = false; - _munge_color_scale = false; - _auto_shader = false; - if (!get_gsg()->get_runtime_color_scale()) { // We might need to munge the colors. const ColorAttrib *color_attrib = (const ColorAttrib *) @@ -98,6 +97,11 @@ StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state, if (shader_attrib->auto_shader()) { _auto_shader = true; } + if (shader_attrib->get_flag(ShaderAttrib::F_hardware_skinning)) { + // Hijack this field, such as not to break ABI compatibility. + // This hack is not present in 1.10. + _num_components |= 0x10000; + } } //////////////////////////////////////////////////////////////////// @@ -120,17 +124,20 @@ munge_data_impl(const GeomVertexData *data) { CPT(GeomVertexData) new_data = data; if (_munge_color) { - new_data = new_data->set_color(_color, _num_components, _numeric_type, - _contents); + new_data = new_data->set_color(_color, _num_components & 0xffff, + _numeric_type, _contents); } else if (_munge_color_scale) { - new_data = new_data->scale_color(_color_scale, _num_components, + new_data = new_data->scale_color(_color_scale, _num_components & 0xffff, _numeric_type, _contents); } GeomVertexAnimationSpec animation = new_data->get_format()->get_animation(); - if (hardware_animated_vertices && - animation.get_animation_type() == AT_panda && - new_data->get_slider_table() == (SliderTable *)NULL) { + if (_num_components & 0x10000) { + animation.set_hardware(4, true); + + } else if (hardware_animated_vertices && + animation.get_animation_type() == AT_panda && + new_data->get_slider_table() == (SliderTable *)NULL) { // Maybe we can animate the vertices with hardware. const TransformBlendTable *table = new_data->get_transform_blend_table(); if (table != (TransformBlendTable *)NULL && @@ -306,7 +313,11 @@ compare_to_impl(const GeomMunger *other) const { return compare; } } - + bool shader_skinning = ((_num_components & 0x10000) != 0); + bool om_shader_skinning = ((om->_num_components & 0x10000) != 0); + if (shader_skinning != om_shader_skinning) { + return (int)shader_skinning - (int)om_shader_skinning; + } if (_auto_shader != om->_auto_shader) { return (int)_auto_shader - (int)om->_auto_shader; } @@ -345,6 +356,11 @@ geom_compare_to_impl(const GeomMunger *other) const { return compare; } } + bool shader_skinning = ((_num_components & 0x10000) != 0); + bool om_shader_skinning = ((om->_num_components & 0x10000) != 0); + if (shader_skinning != om_shader_skinning) { + return (int)shader_skinning - (int)om_shader_skinning; + } return StateMunger::geom_compare_to_impl(other); } diff --git a/panda/src/glstuff/glGeomMunger_src.cxx b/panda/src/glstuff/glGeomMunger_src.cxx index b2deb6e29f..a3b53ac464 100644 --- a/panda/src/glstuff/glGeomMunger_src.cxx +++ b/panda/src/glstuff/glGeomMunger_src.cxx @@ -118,7 +118,7 @@ munge_format_impl(const GeomVertexFormat *orig, if (animation.get_num_transforms() > 1) { PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat; new_array_format->add_column - (InternalName::get_transform_weight(), animation.get_num_transforms() - 1, + (InternalName::get_transform_weight(), animation.get_num_transforms(), NT_stdfloat, C_other); if (animation.get_indexed_transforms()) { diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index a1a2e7e7a9..2d0c82e0b9 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3249,11 +3249,11 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, } } +#ifndef OPENGLES const GeomVertexAnimationSpec &animation = _data_reader->get_format()->get_animation(); bool hardware_animation = (animation.get_animation_type() == Geom::AT_hardware); -#ifndef OPENGLES - if (hardware_animation) { + if (hardware_animation && _current_shader_context == NULL) { // Set up the transform matrices for vertex blending. nassertr(_supports_vertex_blend, false); glEnable(GL_VERTEX_BLEND_ARB); @@ -3335,6 +3335,8 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, GLPf(LoadMatrix)(_internal_transform->get_mat().get_data()); } } +#else + const bool hardware_animation = false; #endif #ifndef OPENGLES_2 diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 5df6c93871..298eda1f9e 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -197,6 +197,8 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext _glsl_program = 0; _uses_standard_vertex_arrays = false; _has_divisor = false; + _transform_table_index = -1; + _slider_table_index = -1; nassertv(s->get_language() == Shader::SL_GLSL); @@ -527,6 +529,26 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext s->_mat_spec.push_back(bind); continue; } + if (noprefix == "TransformTable") { + if (param_type != GL_FLOAT_MAT4) { + GLCAT.error() + << "p3d_TransformTable should be uniform mat4\n"; + continue; + } + _transform_table_index = p; + _transform_table_size = param_size; + continue; + } + if (noprefix == "SliderTable") { + if (param_type != GL_FLOAT) { + GLCAT.error() + << "p3d_SliderTable should be uniform float\n"; + continue; + } + _slider_table_index = p; + _slider_table_size = param_size; + continue; + } GLCAT.error() << "Unrecognized uniform name '" << param_name_cstr << "'!\n"; continue; @@ -1324,6 +1346,58 @@ issue_parameters(int altered) { _glgsg->report_my_gl_errors(); } +//////////////////////////////////////////////////////////////////// +// Function: GLShaderContext::update_transform_table +// Access: Public +// Description: Changes the active transform table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(ShaderContext):: +update_transform_table(const TransformTable *table) { + LMatrix4f *matrices = (LMatrix4f *)alloca(_transform_table_size * 64); + + int i = 0; + if (table != NULL) { + int num_transforms = min(_transform_table_size, table->get_num_transforms()); + for (; i < num_transforms; ++i) { +#ifdef STDFLOAT_DOUBLE + LMatrix4 matrix; + table->get_transform(i)->get_matrix(matrix); + matrices[i] = LCAST(float, matrix); +#else + table->get_transform(i)->get_matrix(matrices[i]); +#endif + } + } + for (; i < _transform_table_size; ++i) { + matrices[i] = LMatrix4f::ident_mat(); + } + + _glgsg->_glUniformMatrix4fv(_transform_table_index, _transform_table_size, + GL_FALSE, (float *)matrices); +} + +//////////////////////////////////////////////////////////////////// +// Function: GLShaderContext::update_slider_table +// Access: Public +// Description: Changes the active slider table, used for hardware +// skinning. +//////////////////////////////////////////////////////////////////// +void CLP(ShaderContext):: +update_slider_table(const SliderTable *table) { + float *sliders = (float *)alloca(_slider_table_size * 4); + memset(sliders, 0, _slider_table_size * 4); + + if (table != NULL) { + int num_sliders = min(_slider_table_size, table->get_num_sliders()); + for (int i = 0; i < num_sliders; ++i) { + sliders[i] = table->get_slider(i)->get_slider(); + } + } + + _glgsg->_glUniform1fv(_slider_table_index, _slider_table_size, sliders); +} + //////////////////////////////////////////////////////////////////// // Function: GLShaderContext::disable_shader_vertex_arrays // Access: Public @@ -1441,6 +1515,16 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { } } + if (_transform_table_index >= 0) { + const TransformTable *table = _glgsg->_data_reader->get_transform_table(); + update_transform_table(table); + } + + if (_slider_table_index >= 0) { + const SliderTable *table = _glgsg->_data_reader->get_slider_table(); + update_slider_table(table); + } + _glgsg->report_my_gl_errors(); return true; diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index e2a9aadc9d..62d54ed675 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -41,6 +41,8 @@ public: void bind(bool reissue_parameters = true); void unbind(); void issue_parameters(int altered); + void update_transform_table(const TransformTable *table); + void update_slider_table(const SliderTable *table); void disable_shader_vertex_arrays(); bool update_shader_vertex_arrays(ShaderContext *prev, bool force); void disable_shader_texture_bindings(); @@ -65,6 +67,11 @@ private: //typedef pvector ParamContexts; //ParamContexts _params; + GLint _transform_table_index; + GLint _slider_table_index; + GLsizei _transform_table_size; + GLsizei _slider_table_size; + pvector _glsl_parameter_map; pmap _glsl_uniform_handles; diff --git a/panda/src/pgraph/shaderAttrib.h b/panda/src/pgraph/shaderAttrib.h index c6bb2eb583..9d677a411e 100644 --- a/panda/src/pgraph/shaderAttrib.h +++ b/panda/src/pgraph/shaderAttrib.h @@ -48,6 +48,7 @@ PUBLISHED: enum { F_disable_alpha_write = 0, // Suppress writes to color buffer alpha channel. F_subsume_alpha_test = 1, // Shader promises to subsume the alpha test using TEXKILL + F_hardware_skinning = 2, // Shader needs pre-animated vertices }; INLINE bool has_shader() const; From d3487eba6b06e6f6af408d08f8a54596eb9e87a0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 7 Sep 2015 23:28:37 +0200 Subject: [PATCH 168/203] Set visibility attributes on all exported bindings --- dtool/src/interrogate/interfaceMakerC.cxx | 19 ++++++++++++++----- .../interfaceMakerPythonNative.cxx | 4 ++++ .../interrogate/interfaceMakerPythonObj.cxx | 2 ++ .../interfaceMakerPythonSimple.cxx | 2 ++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerC.cxx b/dtool/src/interrogate/interfaceMakerC.cxx index c693bf7689..25eeb87023 100644 --- a/dtool/src/interrogate/interfaceMakerC.cxx +++ b/dtool/src/interrogate/interfaceMakerC.cxx @@ -53,6 +53,14 @@ InterfaceMakerC:: //////////////////////////////////////////////////////////////////// void InterfaceMakerC:: write_prototypes(ostream &out,ostream *out_h) { + // The 'used' attribute prevents emscripten from optimizing it out. + out << + "#if __GNUC__ >= 4\n" + "#define EXPORT_FUNC extern \"C\" __attribute__((used, visibility(\"default\")))\n" + "#else\n" + "#define EXPORT_FUNC extern \"C\"\n" + "#endif\n\n"; + FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { Function *func = (*fi).second; @@ -140,8 +148,13 @@ write_prototype_for(ostream &out, InterfaceMaker::Function *func) { for (ri = func->_remaps.begin(); ri != func->_remaps.end(); ++ri) { FunctionRemap *remap = (*ri); + + if (remap->_extension || (remap->_flags & FunctionRemap::F_explicit_self)) { + continue; + } + if (output_function_names) { - out << "extern \"C\" "; + out << "EXPORT_FUNC "; } write_function_header(out, func, remap, false); out << ";\n"; @@ -216,10 +229,6 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func, void InterfaceMakerC:: write_function_header(ostream &out, InterfaceMaker::Function *func, FunctionRemap *remap, bool newline) { - if (remap->_extension || (remap->_flags & FunctionRemap::F_explicit_self)) { - return; - } - if (remap->_void_return) { out << "void"; } else { diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index cd780c01a2..49e7a184ec 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1499,6 +1499,8 @@ write_module(ostream &out, ostream *out_h, InterrogateModuleDef *def) { << "\n" << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) PyObject *PyInit_" << def->module_name << "();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) PyInit_" << def->module_name << "();\n" << "#else\n" << "extern \"C\" PyObject *PyInit_" << def->module_name << "();\n" << "#endif\n" @@ -1512,6 +1514,8 @@ write_module(ostream &out, ostream *out_h, InterrogateModuleDef *def) { << "\n" << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) void init" << def->module_name << "();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) init" << def->module_name << "();\n" << "#else\n" << "extern \"C\" void init" << def->module_name << "();\n" << "#endif\n" diff --git a/dtool/src/interrogate/interfaceMakerPythonObj.cxx b/dtool/src/interrogate/interfaceMakerPythonObj.cxx index 9081c435bd..d88c62e7c7 100644 --- a/dtool/src/interrogate/interfaceMakerPythonObj.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonObj.cxx @@ -136,6 +136,8 @@ write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def) { << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) INIT_FUNC();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) INIT_FUNC();\n" << "#else\n" << "extern \"C\" INIT_FUNC();\n" << "#endif\n\n" diff --git a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx index d6e0684db7..9b04103af2 100644 --- a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx @@ -123,6 +123,8 @@ write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def) { << "#ifdef _WIN32\n" << "extern \"C\" __declspec(dllexport) INIT_FUNC();\n" + << "#elif __GNUC__ >= 4\n" + << "extern \"C\" __attribute__((visibility(\"default\"))) INIT_FUNC();\n" << "#else\n" << "extern \"C\" INIT_FUNC();\n" << "#endif\n\n" From 20f90f35b9ce7f6ff1792d4eb1e270eaa6181c33 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 7 Sep 2015 23:30:02 +0200 Subject: [PATCH 169/203] Regenerate interrogatedb bindings to include interrogate_request --- dtool/metalibs/dtoolconfig/pydtool.cxx | 842 +++++++++++++------------ 1 file changed, 438 insertions(+), 404 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/pydtool.cxx b/dtool/metalibs/dtoolconfig/pydtool.cxx index bde03f4197..77a162c7ec 100644 --- a/dtool/metalibs/dtoolconfig/pydtool.cxx +++ b/dtool/metalibs/dtoolconfig/pydtool.cxx @@ -1,12 +1,13 @@ /* - * This file generated by: - * interrogate -D EXPCL_DTOOLCONFIG= -nodb -python -promiscuous -I~/panda3d-git/built/include -module panda3d.dtoolconfig -library dtoolconfig -string -true-names -do-module -oc pydtool.cxx ../../src/interrogatedb/interrogate_interface.h + * This file was generated by: + * interrogate -D EXPCL_DTOOLCONFIG= -nodb -python -promiscuous -I/home/rdb/panda3d-git/built/include -module panda3d.interrogatedb -library interrogatedb -string -true-names -do-module -oc pydtool.cxx ../../src/interrogatedb/interrogate_interface.h ../../src/interrogatedb/interrogate_request.h * */ #include #include "../../src/interrogatedb/interrogate_interface.h" +#include "../../src/interrogatedb/interrogate_request.h" #include "dtoolbase.h" #undef _POSIX_C_SOURCE @@ -18,137 +19,139 @@ #include "Python.h" #endif -static PyObject *_inPU7VHtbRf(PyObject *self, PyObject *args); -static PyObject *_inPU7VHda_g(PyObject *self, PyObject *args); -static PyObject *_inPU7VH4RgX(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3Gip(PyObject *self, PyObject *args); -static PyObject *_inPU7VHRKDz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHgZ9N(PyObject *self, PyObject *args); -static PyObject *_inPU7VHFnRZ(PyObject *self, PyObject *args); -static PyObject *_inPU7VHg0Qv(PyObject *self, PyObject *args); -static PyObject *_inPU7VHtrqw(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdmpW(PyObject *self, PyObject *args); -static PyObject *_inPU7VHUYgQ(PyObject *self, PyObject *args); -static PyObject *_inPU7VH0k7F(PyObject *self, PyObject *args); -static PyObject *_inPU7VHfIsr(PyObject *self, PyObject *args); -static PyObject *_inPU7VHvysR(PyObject *self, PyObject *args); -static PyObject *_inPU7VHYQ_2(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3kdv(PyObject *self, PyObject *args); -static PyObject *_inPU7VHew01(PyObject *self, PyObject *args); -static PyObject *_inPU7VHQna7(PyObject *self, PyObject *args); -static PyObject *_inPU7VHkg95(PyObject *self, PyObject *args); -static PyObject *_inPU7VHluRc(PyObject *self, PyObject *args); -static PyObject *_inPU7VHtHdM(PyObject *self, PyObject *args); -static PyObject *_inPU7VHDId0(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHuAm(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_xr0(PyObject *self, PyObject *args); -static PyObject *_inPU7VHH5qp(PyObject *self, PyObject *args); -static PyObject *_inPU7VHU2_B(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHFO2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHcfjm(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3Sjw(PyObject *self, PyObject *args); -static PyObject *_inPU7VHgJcX(PyObject *self, PyObject *args); -static PyObject *_inPU7VHYlw6(PyObject *self, PyObject *args); -static PyObject *_inPU7VHsmnz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHxQ10(PyObject *self, PyObject *args); -static PyObject *_inPU7VH6gPB(PyObject *self, PyObject *args); -static PyObject *_inPU7VHISgV(PyObject *self, PyObject *args); -static PyObject *_inPU7VHH3bx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHzeUk(PyObject *self, PyObject *args); -static PyObject *_inPU7VHUeI5(PyObject *self, PyObject *args); -static PyObject *_inPU7VHuSvx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHwpYd(PyObject *self, PyObject *args); -static PyObject *_inPU7VHOfNh(PyObject *self, PyObject *args); -static PyObject *_inPU7VHf5_U(PyObject *self, PyObject *args); -static PyObject *_inPU7VHL3ZB(PyObject *self, PyObject *args); -static PyObject *_inPU7VHXw0I(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3zru(PyObject *self, PyObject *args); -static PyObject *_inPU7VHRrg2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHEJCx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHWAZr(PyObject *self, PyObject *args); -static PyObject *_inPU7VHrD_M(PyObject *self, PyObject *args); -static PyObject *_inPU7VHjolz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHt_JD(PyObject *self, PyObject *args); -static PyObject *_inPU7VHwEts(PyObject *self, PyObject *args); -static PyObject *_inPU7VHrJWs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHpmFD(PyObject *self, PyObject *args); -static PyObject *_inPU7VHyYUX(PyObject *self, PyObject *args); -static PyObject *_inPU7VH54dn(PyObject *self, PyObject *args); -static PyObject *_inPU7VHGMpW(PyObject *self, PyObject *args); -static PyObject *_inPU7VHNuBV(PyObject *self, PyObject *args); -static PyObject *_inPU7VH9UwA(PyObject *self, PyObject *args); -static PyObject *_inPU7VH3FDt(PyObject *self, PyObject *args); -static PyObject *_inPU7VHf513(PyObject *self, PyObject *args); -static PyObject *_inPU7VHsqGH(PyObject *self, PyObject *args); -static PyObject *_inPU7VH7shV(PyObject *self, PyObject *args); -static PyObject *_inPU7VHA1eF(PyObject *self, PyObject *args); -static PyObject *_inPU7VH9tTm(PyObject *self, PyObject *args); -static PyObject *_inPU7VH776V(PyObject *self, PyObject *args); -static PyObject *_inPU7VHfaH0(PyObject *self, PyObject *args); -static PyObject *_inPU7VHGB9D(PyObject *self, PyObject *args); -static PyObject *_inPU7VHsxxs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHMT0z(PyObject *self, PyObject *args); -static PyObject *_inPU7VHiW3v(PyObject *self, PyObject *args); -static PyObject *_inPU7VH4Px8(PyObject *self, PyObject *args); -static PyObject *_inPU7VHNHcs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHqHrb(PyObject *self, PyObject *args); -static PyObject *_inPU7VHaOqq(PyObject *self, PyObject *args); -static PyObject *_inPU7VHqWOw(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHu7x(PyObject *self, PyObject *args); -static PyObject *_inPU7VHwGnA(PyObject *self, PyObject *args); -static PyObject *_inPU7VHXGxx(PyObject *self, PyObject *args); -static PyObject *_inPU7VHj04Z(PyObject *self, PyObject *args); -static PyObject *_inPU7VHEOv4(PyObject *self, PyObject *args); -static PyObject *_inPU7VHpCqJ(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_Pz3(PyObject *self, PyObject *args); -static PyObject *_inPU7VHt_06(PyObject *self, PyObject *args); -static PyObject *_inPU7VHmuPs(PyObject *self, PyObject *args); -static PyObject *_inPU7VHvM8B(PyObject *self, PyObject *args); -static PyObject *_inPU7VHap97(PyObject *self, PyObject *args); -static PyObject *_inPU7VH0o8D(PyObject *self, PyObject *args); -static PyObject *_inPU7VHOoQ2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHKuFh(PyObject *self, PyObject *args); -static PyObject *_inPU7VHo5L6(PyObject *self, PyObject *args); -static PyObject *_inPU7VHzgKK(PyObject *self, PyObject *args); -static PyObject *_inPU7VH0FIF(PyObject *self, PyObject *args); -static PyObject *_inPU7VHZqvD(PyObject *self, PyObject *args); -static PyObject *_inPU7VHDyRd(PyObject *self, PyObject *args); -static PyObject *_inPU7VHMnKa(PyObject *self, PyObject *args); -static PyObject *_inPU7VHRtji(PyObject *self, PyObject *args); -static PyObject *_inPU7VHCnbQ(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdUVN(PyObject *self, PyObject *args); -static PyObject *_inPU7VHihbt(PyObject *self, PyObject *args); -static PyObject *_inPU7VHbyPY(PyObject *self, PyObject *args); -static PyObject *_inPU7VHAaT6(PyObject *self, PyObject *args); -static PyObject *_inPU7VHgL9q(PyObject *self, PyObject *args); -static PyObject *_inPU7VHWB97(PyObject *self, PyObject *args); -static PyObject *_inPU7VHDUAl(PyObject *self, PyObject *args); -static PyObject *_inPU7VH1_Kf(PyObject *self, PyObject *args); -static PyObject *_inPU7VH98lD(PyObject *self, PyObject *args); -static PyObject *_inPU7VH9SHr(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdiZP(PyObject *self, PyObject *args); -static PyObject *_inPU7VHTdER(PyObject *self, PyObject *args); -static PyObject *_inPU7VHYO56(PyObject *self, PyObject *args); -static PyObject *_inPU7VHxtCG(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_EB2(PyObject *self, PyObject *args); -static PyObject *_inPU7VHEG1l(PyObject *self, PyObject *args); -static PyObject *_inPU7VH7tUq(PyObject *self, PyObject *args); -static PyObject *_inPU7VHyStU(PyObject *self, PyObject *args); -static PyObject *_inPU7VHdM85(PyObject *self, PyObject *args); -static PyObject *_inPU7VHk_GN(PyObject *self, PyObject *args); -static PyObject *_inPU7VH8QjG(PyObject *self, PyObject *args); -static PyObject *_inPU7VHyMtj(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHDtN(PyObject *self, PyObject *args); -static PyObject *_inPU7VHHFjA(PyObject *self, PyObject *args); -static PyObject *_inPU7VH_NPR(PyObject *self, PyObject *args); -static PyObject *_inPU7VHcTOH(PyObject *self, PyObject *args); -static PyObject *_inPU7VHhdU7(PyObject *self, PyObject *args); -static PyObject *_inPU7VHQPxU(PyObject *self, PyObject *args); -static PyObject *_inPU7VHO7Pz(PyObject *self, PyObject *args); -static PyObject *_inPU7VHvu_E(PyObject *self, PyObject *args); -static PyObject *_inPU7VHxGUt(PyObject *self, PyObject *args); -static PyObject *_inPU7VHzM1P(PyObject *self, PyObject *args); -static PyObject *_inPU7VHoY5L(PyObject *self, PyObject *args); +static PyObject *_inP07yttbRf(PyObject *self, PyObject *args); +static PyObject *_inP07ytda_g(PyObject *self, PyObject *args); +static PyObject *_inP07yt4RgX(PyObject *self, PyObject *args); +static PyObject *_inP07yt3Gip(PyObject *self, PyObject *args); +static PyObject *_inP07ytRKDz(PyObject *self, PyObject *args); +static PyObject *_inP07ytgZ9N(PyObject *self, PyObject *args); +static PyObject *_inP07ytFnRZ(PyObject *self, PyObject *args); +static PyObject *_inP07ytg0Qv(PyObject *self, PyObject *args); +static PyObject *_inP07yttrqw(PyObject *self, PyObject *args); +static PyObject *_inP07ytdmpW(PyObject *self, PyObject *args); +static PyObject *_inP07ytUYgQ(PyObject *self, PyObject *args); +static PyObject *_inP07yt0k7F(PyObject *self, PyObject *args); +static PyObject *_inP07ytfIsr(PyObject *self, PyObject *args); +static PyObject *_inP07ytvysR(PyObject *self, PyObject *args); +static PyObject *_inP07ytYQ_2(PyObject *self, PyObject *args); +static PyObject *_inP07yt3kdv(PyObject *self, PyObject *args); +static PyObject *_inP07ytew01(PyObject *self, PyObject *args); +static PyObject *_inP07ytQna7(PyObject *self, PyObject *args); +static PyObject *_inP07ytkg95(PyObject *self, PyObject *args); +static PyObject *_inP07ytluRc(PyObject *self, PyObject *args); +static PyObject *_inP07yttHdM(PyObject *self, PyObject *args); +static PyObject *_inP07ytDId0(PyObject *self, PyObject *args); +static PyObject *_inP07ytHuAm(PyObject *self, PyObject *args); +static PyObject *_inP07yt_xr0(PyObject *self, PyObject *args); +static PyObject *_inP07ytH5qp(PyObject *self, PyObject *args); +static PyObject *_inP07ytU2_B(PyObject *self, PyObject *args); +static PyObject *_inP07ytHFO2(PyObject *self, PyObject *args); +static PyObject *_inP07ytcfjm(PyObject *self, PyObject *args); +static PyObject *_inP07yt3Sjw(PyObject *self, PyObject *args); +static PyObject *_inP07ytgJcX(PyObject *self, PyObject *args); +static PyObject *_inP07ytYlw6(PyObject *self, PyObject *args); +static PyObject *_inP07ytsmnz(PyObject *self, PyObject *args); +static PyObject *_inP07ytxQ10(PyObject *self, PyObject *args); +static PyObject *_inP07yt6gPB(PyObject *self, PyObject *args); +static PyObject *_inP07ytISgV(PyObject *self, PyObject *args); +static PyObject *_inP07ytH3bx(PyObject *self, PyObject *args); +static PyObject *_inP07ytzeUk(PyObject *self, PyObject *args); +static PyObject *_inP07ytUeI5(PyObject *self, PyObject *args); +static PyObject *_inP07ytuSvx(PyObject *self, PyObject *args); +static PyObject *_inP07ytwpYd(PyObject *self, PyObject *args); +static PyObject *_inP07ytOfNh(PyObject *self, PyObject *args); +static PyObject *_inP07ytf5_U(PyObject *self, PyObject *args); +static PyObject *_inP07ytL3ZB(PyObject *self, PyObject *args); +static PyObject *_inP07ytXw0I(PyObject *self, PyObject *args); +static PyObject *_inP07yt3zru(PyObject *self, PyObject *args); +static PyObject *_inP07ytRrg2(PyObject *self, PyObject *args); +static PyObject *_inP07ytEJCx(PyObject *self, PyObject *args); +static PyObject *_inP07ytWAZr(PyObject *self, PyObject *args); +static PyObject *_inP07ytrD_M(PyObject *self, PyObject *args); +static PyObject *_inP07ytjolz(PyObject *self, PyObject *args); +static PyObject *_inP07ytt_JD(PyObject *self, PyObject *args); +static PyObject *_inP07ytwEts(PyObject *self, PyObject *args); +static PyObject *_inP07ytrJWs(PyObject *self, PyObject *args); +static PyObject *_inP07ytpmFD(PyObject *self, PyObject *args); +static PyObject *_inP07ytyYUX(PyObject *self, PyObject *args); +static PyObject *_inP07yt54dn(PyObject *self, PyObject *args); +static PyObject *_inP07ytGMpW(PyObject *self, PyObject *args); +static PyObject *_inP07ytNuBV(PyObject *self, PyObject *args); +static PyObject *_inP07yt9UwA(PyObject *self, PyObject *args); +static PyObject *_inP07yt3FDt(PyObject *self, PyObject *args); +static PyObject *_inP07ytf513(PyObject *self, PyObject *args); +static PyObject *_inP07ytsqGH(PyObject *self, PyObject *args); +static PyObject *_inP07yt7shV(PyObject *self, PyObject *args); +static PyObject *_inP07ytA1eF(PyObject *self, PyObject *args); +static PyObject *_inP07yt9tTm(PyObject *self, PyObject *args); +static PyObject *_inP07yt776V(PyObject *self, PyObject *args); +static PyObject *_inP07ytfaH0(PyObject *self, PyObject *args); +static PyObject *_inP07ytGB9D(PyObject *self, PyObject *args); +static PyObject *_inP07ytsxxs(PyObject *self, PyObject *args); +static PyObject *_inP07ytMT0z(PyObject *self, PyObject *args); +static PyObject *_inP07ytiW3v(PyObject *self, PyObject *args); +static PyObject *_inP07yt4Px8(PyObject *self, PyObject *args); +static PyObject *_inP07ytNHcs(PyObject *self, PyObject *args); +static PyObject *_inP07ytqHrb(PyObject *self, PyObject *args); +static PyObject *_inP07ytaOqq(PyObject *self, PyObject *args); +static PyObject *_inP07ytqWOw(PyObject *self, PyObject *args); +static PyObject *_inP07ytHu7x(PyObject *self, PyObject *args); +static PyObject *_inP07ytwGnA(PyObject *self, PyObject *args); +static PyObject *_inP07ytXGxx(PyObject *self, PyObject *args); +static PyObject *_inP07ytj04Z(PyObject *self, PyObject *args); +static PyObject *_inP07ytEOv4(PyObject *self, PyObject *args); +static PyObject *_inP07ytpCqJ(PyObject *self, PyObject *args); +static PyObject *_inP07yt_Pz3(PyObject *self, PyObject *args); +static PyObject *_inP07ytt_06(PyObject *self, PyObject *args); +static PyObject *_inP07ytmuPs(PyObject *self, PyObject *args); +static PyObject *_inP07ytvM8B(PyObject *self, PyObject *args); +static PyObject *_inP07ytap97(PyObject *self, PyObject *args); +static PyObject *_inP07yt0o8D(PyObject *self, PyObject *args); +static PyObject *_inP07ytOoQ2(PyObject *self, PyObject *args); +static PyObject *_inP07ytKuFh(PyObject *self, PyObject *args); +static PyObject *_inP07yto5L6(PyObject *self, PyObject *args); +static PyObject *_inP07ytzgKK(PyObject *self, PyObject *args); +static PyObject *_inP07yt0FIF(PyObject *self, PyObject *args); +static PyObject *_inP07ytZqvD(PyObject *self, PyObject *args); +static PyObject *_inP07ytDyRd(PyObject *self, PyObject *args); +static PyObject *_inP07ytMnKa(PyObject *self, PyObject *args); +static PyObject *_inP07ytRtji(PyObject *self, PyObject *args); +static PyObject *_inP07ytCnbQ(PyObject *self, PyObject *args); +static PyObject *_inP07ytdUVN(PyObject *self, PyObject *args); +static PyObject *_inP07ytihbt(PyObject *self, PyObject *args); +static PyObject *_inP07ytbyPY(PyObject *self, PyObject *args); +static PyObject *_inP07ytAaT6(PyObject *self, PyObject *args); +static PyObject *_inP07ytgL9q(PyObject *self, PyObject *args); +static PyObject *_inP07ytWB97(PyObject *self, PyObject *args); +static PyObject *_inP07ytDUAl(PyObject *self, PyObject *args); +static PyObject *_inP07yt1_Kf(PyObject *self, PyObject *args); +static PyObject *_inP07yt98lD(PyObject *self, PyObject *args); +static PyObject *_inP07yt9SHr(PyObject *self, PyObject *args); +static PyObject *_inP07ytdiZP(PyObject *self, PyObject *args); +static PyObject *_inP07ytTdER(PyObject *self, PyObject *args); +static PyObject *_inP07ytYO56(PyObject *self, PyObject *args); +static PyObject *_inP07ytxtCG(PyObject *self, PyObject *args); +static PyObject *_inP07yt_EB2(PyObject *self, PyObject *args); +static PyObject *_inP07ytEG1l(PyObject *self, PyObject *args); +static PyObject *_inP07yt7tUq(PyObject *self, PyObject *args); +static PyObject *_inP07ytyStU(PyObject *self, PyObject *args); +static PyObject *_inP07ytdM85(PyObject *self, PyObject *args); +static PyObject *_inP07ytk_GN(PyObject *self, PyObject *args); +static PyObject *_inP07yt8QjG(PyObject *self, PyObject *args); +static PyObject *_inP07ytyMtj(PyObject *self, PyObject *args); +static PyObject *_inP07ytHDtN(PyObject *self, PyObject *args); +static PyObject *_inP07ytHFjA(PyObject *self, PyObject *args); +static PyObject *_inP07yt_NPR(PyObject *self, PyObject *args); +static PyObject *_inP07ytcTOH(PyObject *self, PyObject *args); +static PyObject *_inP07ythdU7(PyObject *self, PyObject *args); +static PyObject *_inP07ytQPxU(PyObject *self, PyObject *args); +static PyObject *_inP07ytO7Pz(PyObject *self, PyObject *args); +static PyObject *_inP07ytvu_E(PyObject *self, PyObject *args); +static PyObject *_inP07ytxGUt(PyObject *self, PyObject *args); +static PyObject *_inP07ytzM1P(PyObject *self, PyObject *args); +static PyObject *_inP07ytoY5L(PyObject *self, PyObject *args); +static PyObject *_inP07yte_7S(PyObject *self, PyObject *args); +static PyObject *_inP07ytw_15(PyObject *self, PyObject *args); /* @@ -156,10 +159,10 @@ static PyObject *_inPU7VHoY5L(PyObject *self, PyObject *args); * void interrogate_add_search_directory(char const *dirname) */ static PyObject * -_inPU7VHtbRf(PyObject *, PyObject *args) { +_inP07yttbRf(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - interrogate_add_search_directory((char *)param0); + interrogate_add_search_directory((char const *)param0); return Py_BuildValue(""); } return (PyObject *)NULL; @@ -170,10 +173,10 @@ _inPU7VHtbRf(PyObject *, PyObject *args) { * void interrogate_add_search_path(char const *pathstring) */ static PyObject * -_inPU7VHda_g(PyObject *, PyObject *args) { +_inP07ytda_g(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - interrogate_add_search_path((char *)param0); + interrogate_add_search_path((char const *)param0); return Py_BuildValue(""); } return (PyObject *)NULL; @@ -184,7 +187,7 @@ _inPU7VHda_g(PyObject *, PyObject *args) { * bool interrogate_error_flag(void) */ static PyObject * -_inPU7VH4RgX(PyObject *, PyObject *args) { +_inP07yt4RgX(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { bool return_value = interrogate_error_flag(); return PyBool_FromLong(return_value); @@ -197,7 +200,7 @@ _inPU7VH4RgX(PyObject *, PyObject *args) { * int interrogate_number_of_manifests(void) */ static PyObject * -_inPU7VH3Gip(PyObject *, PyObject *args) { +_inP07yt3Gip(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_manifests(); #if PY_MAJOR_VERSION >= 3 @@ -214,7 +217,7 @@ _inPU7VH3Gip(PyObject *, PyObject *args) { * ManifestIndex interrogate_get_manifest(int n) */ static PyObject * -_inPU7VHRKDz(PyObject *, PyObject *args) { +_inP07ytRKDz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { ManifestIndex return_value = interrogate_get_manifest((int)param0); @@ -232,10 +235,10 @@ _inPU7VHRKDz(PyObject *, PyObject *args) { * ManifestIndex interrogate_get_manifest_by_name(char const *manifest_name) */ static PyObject * -_inPU7VHgZ9N(PyObject *, PyObject *args) { +_inP07ytgZ9N(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - ManifestIndex return_value = interrogate_get_manifest_by_name((char *)param0); + ManifestIndex return_value = interrogate_get_manifest_by_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -250,7 +253,7 @@ _inPU7VHgZ9N(PyObject *, PyObject *args) { * char const *interrogate_manifest_name(ManifestIndex manifest) */ static PyObject * -_inPU7VHFnRZ(PyObject *, PyObject *args) { +_inP07ytFnRZ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_manifest_name((ManifestIndex)param0); @@ -268,7 +271,7 @@ _inPU7VHFnRZ(PyObject *, PyObject *args) { * char const *interrogate_manifest_definition(ManifestIndex manifest) */ static PyObject * -_inPU7VHg0Qv(PyObject *, PyObject *args) { +_inP07ytg0Qv(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_manifest_definition((ManifestIndex)param0); @@ -286,7 +289,7 @@ _inPU7VHg0Qv(PyObject *, PyObject *args) { * bool interrogate_manifest_has_type(ManifestIndex manifest) */ static PyObject * -_inPU7VHtrqw(PyObject *, PyObject *args) { +_inP07yttrqw(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_type((ManifestIndex)param0); @@ -300,7 +303,7 @@ _inPU7VHtrqw(PyObject *, PyObject *args) { * TypeIndex interrogate_manifest_get_type(ManifestIndex manifest) */ static PyObject * -_inPU7VHdmpW(PyObject *, PyObject *args) { +_inP07ytdmpW(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_manifest_get_type((ManifestIndex)param0); @@ -318,7 +321,7 @@ _inPU7VHdmpW(PyObject *, PyObject *args) { * bool interrogate_manifest_has_getter(ManifestIndex manifest) */ static PyObject * -_inPU7VHUYgQ(PyObject *, PyObject *args) { +_inP07ytUYgQ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_getter((ManifestIndex)param0); @@ -332,7 +335,7 @@ _inPU7VHUYgQ(PyObject *, PyObject *args) { * FunctionIndex interrogate_manifest_getter(ManifestIndex manifest) */ static PyObject * -_inPU7VH0k7F(PyObject *, PyObject *args) { +_inP07yt0k7F(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_manifest_getter((ManifestIndex)param0); @@ -350,7 +353,7 @@ _inPU7VH0k7F(PyObject *, PyObject *args) { * bool interrogate_manifest_has_int_value(ManifestIndex manifest) */ static PyObject * -_inPU7VHfIsr(PyObject *, PyObject *args) { +_inP07ytfIsr(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_manifest_has_int_value((ManifestIndex)param0); @@ -364,7 +367,7 @@ _inPU7VHfIsr(PyObject *, PyObject *args) { * int interrogate_manifest_get_int_value(ManifestIndex manifest) */ static PyObject * -_inPU7VHvysR(PyObject *, PyObject *args) { +_inP07ytvysR(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_manifest_get_int_value((ManifestIndex)param0); @@ -382,7 +385,7 @@ _inPU7VHvysR(PyObject *, PyObject *args) { * char const *interrogate_element_name(ElementIndex element) */ static PyObject * -_inPU7VHYQ_2(PyObject *, PyObject *args) { +_inP07ytYQ_2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_name((ElementIndex)param0); @@ -400,7 +403,7 @@ _inPU7VHYQ_2(PyObject *, PyObject *args) { * char const *interrogate_element_scoped_name(ElementIndex element) */ static PyObject * -_inPU7VH3kdv(PyObject *, PyObject *args) { +_inP07yt3kdv(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_scoped_name((ElementIndex)param0); @@ -418,7 +421,7 @@ _inPU7VH3kdv(PyObject *, PyObject *args) { * bool interrogate_element_has_comment(ElementIndex element) */ static PyObject * -_inPU7VHew01(PyObject *, PyObject *args) { +_inP07ytew01(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_comment((ElementIndex)param0); @@ -432,7 +435,7 @@ _inPU7VHew01(PyObject *, PyObject *args) { * char const *interrogate_element_comment(ElementIndex element) */ static PyObject * -_inPU7VHQna7(PyObject *, PyObject *args) { +_inP07ytQna7(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_element_comment((ElementIndex)param0); @@ -450,10 +453,10 @@ _inPU7VHQna7(PyObject *, PyObject *args) { * ElementIndex interrogate_get_element_by_name(char const *element_name) */ static PyObject * -_inPU7VHkg95(PyObject *, PyObject *args) { +_inP07ytkg95(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - ElementIndex return_value = interrogate_get_element_by_name((char *)param0); + ElementIndex return_value = interrogate_get_element_by_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -468,10 +471,10 @@ _inPU7VHkg95(PyObject *, PyObject *args) { * ElementIndex interrogate_get_element_by_scoped_name(char const *element_name) */ static PyObject * -_inPU7VHluRc(PyObject *, PyObject *args) { +_inP07ytluRc(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - ElementIndex return_value = interrogate_get_element_by_scoped_name((char *)param0); + ElementIndex return_value = interrogate_get_element_by_scoped_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -486,7 +489,7 @@ _inPU7VHluRc(PyObject *, PyObject *args) { * TypeIndex interrogate_element_type(ElementIndex element) */ static PyObject * -_inPU7VHtHdM(PyObject *, PyObject *args) { +_inP07yttHdM(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_element_type((ElementIndex)param0); @@ -504,7 +507,7 @@ _inPU7VHtHdM(PyObject *, PyObject *args) { * bool interrogate_element_has_getter(ElementIndex element) */ static PyObject * -_inPU7VHDId0(PyObject *, PyObject *args) { +_inP07ytDId0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_getter((ElementIndex)param0); @@ -518,7 +521,7 @@ _inPU7VHDId0(PyObject *, PyObject *args) { * FunctionIndex interrogate_element_getter(ElementIndex element) */ static PyObject * -_inPU7VHHuAm(PyObject *, PyObject *args) { +_inP07ytHuAm(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_element_getter((ElementIndex)param0); @@ -536,7 +539,7 @@ _inPU7VHHuAm(PyObject *, PyObject *args) { * bool interrogate_element_has_setter(ElementIndex element) */ static PyObject * -_inPU7VH_xr0(PyObject *, PyObject *args) { +_inP07yt_xr0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_element_has_setter((ElementIndex)param0); @@ -550,7 +553,7 @@ _inPU7VH_xr0(PyObject *, PyObject *args) { * FunctionIndex interrogate_element_setter(ElementIndex element) */ static PyObject * -_inPU7VHH5qp(PyObject *, PyObject *args) { +_inP07ytH5qp(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_element_setter((ElementIndex)param0); @@ -568,7 +571,7 @@ _inPU7VHH5qp(PyObject *, PyObject *args) { * int interrogate_number_of_globals(void) */ static PyObject * -_inPU7VHU2_B(PyObject *, PyObject *args) { +_inP07ytU2_B(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_globals(); #if PY_MAJOR_VERSION >= 3 @@ -585,7 +588,7 @@ _inPU7VHU2_B(PyObject *, PyObject *args) { * ElementIndex interrogate_get_global(int n) */ static PyObject * -_inPU7VHHFO2(PyObject *, PyObject *args) { +_inP07ytHFO2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { ElementIndex return_value = interrogate_get_global((int)param0); @@ -603,7 +606,7 @@ _inPU7VHHFO2(PyObject *, PyObject *args) { * int interrogate_number_of_global_functions(void) */ static PyObject * -_inPU7VHcfjm(PyObject *, PyObject *args) { +_inP07ytcfjm(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_global_functions(); #if PY_MAJOR_VERSION >= 3 @@ -620,7 +623,7 @@ _inPU7VHcfjm(PyObject *, PyObject *args) { * FunctionIndex interrogate_get_global_function(int n) */ static PyObject * -_inPU7VH3Sjw(PyObject *, PyObject *args) { +_inP07yt3Sjw(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_get_global_function((int)param0); @@ -638,7 +641,7 @@ _inPU7VH3Sjw(PyObject *, PyObject *args) { * int interrogate_number_of_functions(void) */ static PyObject * -_inPU7VHgJcX(PyObject *, PyObject *args) { +_inP07ytgJcX(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_functions(); #if PY_MAJOR_VERSION >= 3 @@ -655,7 +658,7 @@ _inPU7VHgJcX(PyObject *, PyObject *args) { * FunctionIndex interrogate_get_function(int n) */ static PyObject * -_inPU7VHYlw6(PyObject *, PyObject *args) { +_inP07ytYlw6(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_get_function((int)param0); @@ -673,7 +676,7 @@ _inPU7VHYlw6(PyObject *, PyObject *args) { * char const *interrogate_function_name(FunctionIndex function) */ static PyObject * -_inPU7VHsmnz(PyObject *, PyObject *args) { +_inP07ytsmnz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_name((FunctionIndex)param0); @@ -691,7 +694,7 @@ _inPU7VHsmnz(PyObject *, PyObject *args) { * char const *interrogate_function_scoped_name(FunctionIndex function) */ static PyObject * -_inPU7VHxQ10(PyObject *, PyObject *args) { +_inP07ytxQ10(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_scoped_name((FunctionIndex)param0); @@ -709,7 +712,7 @@ _inPU7VHxQ10(PyObject *, PyObject *args) { * bool interrogate_function_has_comment(FunctionIndex function) */ static PyObject * -_inPU7VH6gPB(PyObject *, PyObject *args) { +_inP07yt6gPB(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_comment((FunctionIndex)param0); @@ -723,7 +726,7 @@ _inPU7VH6gPB(PyObject *, PyObject *args) { * char const *interrogate_function_comment(FunctionIndex function) */ static PyObject * -_inPU7VHISgV(PyObject *, PyObject *args) { +_inP07ytISgV(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_comment((FunctionIndex)param0); @@ -741,7 +744,7 @@ _inPU7VHISgV(PyObject *, PyObject *args) { * char const *interrogate_function_prototype(FunctionIndex function) */ static PyObject * -_inPU7VHH3bx(PyObject *, PyObject *args) { +_inP07ytH3bx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_prototype((FunctionIndex)param0); @@ -759,7 +762,7 @@ _inPU7VHH3bx(PyObject *, PyObject *args) { * bool interrogate_function_is_method(FunctionIndex function) */ static PyObject * -_inPU7VHzeUk(PyObject *, PyObject *args) { +_inP07ytzeUk(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_is_method((FunctionIndex)param0); @@ -773,7 +776,7 @@ _inPU7VHzeUk(PyObject *, PyObject *args) { * TypeIndex interrogate_function_class(FunctionIndex function) */ static PyObject * -_inPU7VHUeI5(PyObject *, PyObject *args) { +_inP07ytUeI5(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_function_class((FunctionIndex)param0); @@ -791,7 +794,7 @@ _inPU7VHUeI5(PyObject *, PyObject *args) { * bool interrogate_function_has_module_name(FunctionIndex function) */ static PyObject * -_inPU7VHuSvx(PyObject *, PyObject *args) { +_inP07ytuSvx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_module_name((FunctionIndex)param0); @@ -805,7 +808,7 @@ _inPU7VHuSvx(PyObject *, PyObject *args) { * char const *interrogate_function_module_name(FunctionIndex function) */ static PyObject * -_inPU7VHwpYd(PyObject *, PyObject *args) { +_inP07ytwpYd(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_module_name((FunctionIndex)param0); @@ -823,7 +826,7 @@ _inPU7VHwpYd(PyObject *, PyObject *args) { * bool interrogate_function_has_library_name(FunctionIndex function) */ static PyObject * -_inPU7VHOfNh(PyObject *, PyObject *args) { +_inP07ytOfNh(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_has_library_name((FunctionIndex)param0); @@ -837,7 +840,7 @@ _inPU7VHOfNh(PyObject *, PyObject *args) { * char const *interrogate_function_library_name(FunctionIndex function) */ static PyObject * -_inPU7VHf5_U(PyObject *, PyObject *args) { +_inP07ytf5_U(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_function_library_name((FunctionIndex)param0); @@ -855,7 +858,7 @@ _inPU7VHf5_U(PyObject *, PyObject *args) { * bool interrogate_function_is_virtual(FunctionIndex function) */ static PyObject * -_inPU7VHL3ZB(PyObject *, PyObject *args) { +_inP07ytL3ZB(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_function_is_virtual((FunctionIndex)param0); @@ -869,7 +872,7 @@ _inPU7VHL3ZB(PyObject *, PyObject *args) { * int interrogate_function_number_of_c_wrappers(FunctionIndex function) */ static PyObject * -_inPU7VHXw0I(PyObject *, PyObject *args) { +_inP07ytXw0I(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_function_number_of_c_wrappers((FunctionIndex)param0); @@ -887,7 +890,7 @@ _inPU7VHXw0I(PyObject *, PyObject *args) { * FunctionWrapperIndex interrogate_function_c_wrapper(FunctionIndex function, int n) */ static PyObject * -_inPU7VH3zru(PyObject *, PyObject *args) { +_inP07yt3zru(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -906,7 +909,7 @@ _inPU7VH3zru(PyObject *, PyObject *args) { * int interrogate_function_number_of_python_wrappers(FunctionIndex function) */ static PyObject * -_inPU7VHRrg2(PyObject *, PyObject *args) { +_inP07ytRrg2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_function_number_of_python_wrappers((FunctionIndex)param0); @@ -924,7 +927,7 @@ _inPU7VHRrg2(PyObject *, PyObject *args) { * FunctionWrapperIndex interrogate_function_python_wrapper(FunctionIndex function, int n) */ static PyObject * -_inPU7VHEJCx(PyObject *, PyObject *args) { +_inP07ytEJCx(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -943,7 +946,7 @@ _inPU7VHEJCx(PyObject *, PyObject *args) { * char const *interrogate_wrapper_name(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHWAZr(PyObject *, PyObject *args) { +_inP07ytWAZr(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_name((FunctionWrapperIndex)param0); @@ -961,7 +964,7 @@ _inPU7VHWAZr(PyObject *, PyObject *args) { * bool interrogate_wrapper_is_callable_by_name(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHrD_M(PyObject *, PyObject *args) { +_inP07ytrD_M(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_is_callable_by_name((FunctionWrapperIndex)param0); @@ -975,7 +978,7 @@ _inPU7VHrD_M(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_comment(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHjolz(PyObject *, PyObject *args) { +_inP07ytjolz(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_comment((FunctionWrapperIndex)param0); @@ -989,7 +992,7 @@ _inPU7VHjolz(PyObject *, PyObject *args) { * char const *interrogate_wrapper_comment(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHt_JD(PyObject *, PyObject *args) { +_inP07ytt_JD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_comment((FunctionWrapperIndex)param0); @@ -1007,7 +1010,7 @@ _inPU7VHt_JD(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_return_value(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHwEts(PyObject *, PyObject *args) { +_inP07ytwEts(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_return_value((FunctionWrapperIndex)param0); @@ -1021,7 +1024,7 @@ _inPU7VHwEts(PyObject *, PyObject *args) { * TypeIndex interrogate_wrapper_return_type(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHrJWs(PyObject *, PyObject *args) { +_inP07ytrJWs(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_wrapper_return_type((FunctionWrapperIndex)param0); @@ -1039,7 +1042,7 @@ _inPU7VHrJWs(PyObject *, PyObject *args) { * bool interrogate_wrapper_caller_manages_return_value(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHpmFD(PyObject *, PyObject *args) { +_inP07ytpmFD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_caller_manages_return_value((FunctionWrapperIndex)param0); @@ -1053,7 +1056,7 @@ _inPU7VHpmFD(PyObject *, PyObject *args) { * FunctionIndex interrogate_wrapper_return_value_destructor(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHyYUX(PyObject *, PyObject *args) { +_inP07ytyYUX(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_wrapper_return_value_destructor((FunctionWrapperIndex)param0); @@ -1071,7 +1074,7 @@ _inPU7VHyYUX(PyObject *, PyObject *args) { * int interrogate_wrapper_number_of_parameters(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VH54dn(PyObject *, PyObject *args) { +_inP07yt54dn(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_wrapper_number_of_parameters((FunctionWrapperIndex)param0); @@ -1089,7 +1092,7 @@ _inPU7VH54dn(PyObject *, PyObject *args) { * TypeIndex interrogate_wrapper_parameter_type(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VHGMpW(PyObject *, PyObject *args) { +_inP07ytGMpW(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1108,7 +1111,7 @@ _inPU7VHGMpW(PyObject *, PyObject *args) { * bool interrogate_wrapper_parameter_has_name(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VHNuBV(PyObject *, PyObject *args) { +_inP07ytNuBV(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1123,7 +1126,7 @@ _inPU7VHNuBV(PyObject *, PyObject *args) { * char const *interrogate_wrapper_parameter_name(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VH9UwA(PyObject *, PyObject *args) { +_inP07yt9UwA(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1142,7 +1145,7 @@ _inPU7VH9UwA(PyObject *, PyObject *args) { * bool interrogate_wrapper_parameter_is_this(FunctionWrapperIndex wrapper, int n) */ static PyObject * -_inPU7VH3FDt(PyObject *, PyObject *args) { +_inP07yt3FDt(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1157,7 +1160,7 @@ _inPU7VH3FDt(PyObject *, PyObject *args) { * bool interrogate_wrapper_has_pointer(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHf513(PyObject *, PyObject *args) { +_inP07ytf513(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_wrapper_has_pointer((FunctionWrapperIndex)param0); @@ -1171,7 +1174,7 @@ _inPU7VHf513(PyObject *, PyObject *args) { * void *interrogate_wrapper_pointer(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VHsqGH(PyObject *, PyObject *args) { +_inP07ytsqGH(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { interrogate_wrapper_pointer((FunctionWrapperIndex)param0); @@ -1185,7 +1188,7 @@ _inPU7VHsqGH(PyObject *, PyObject *args) { * char const *interrogate_wrapper_unique_name(FunctionWrapperIndex wrapper) */ static PyObject * -_inPU7VH7shV(PyObject *, PyObject *args) { +_inP07yt7shV(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_wrapper_unique_name((FunctionWrapperIndex)param0); @@ -1203,10 +1206,10 @@ _inPU7VH7shV(PyObject *, PyObject *args) { * FunctionWrapperIndex interrogate_get_wrapper_by_unique_name(char const *unique_name) */ static PyObject * -_inPU7VHA1eF(PyObject *, PyObject *args) { +_inP07ytA1eF(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - FunctionWrapperIndex return_value = interrogate_get_wrapper_by_unique_name((char *)param0); + FunctionWrapperIndex return_value = interrogate_get_wrapper_by_unique_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1221,7 +1224,7 @@ _inPU7VHA1eF(PyObject *, PyObject *args) { * TypeIndex interrogate_make_seq_class(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VH9tTm(PyObject *, PyObject *args) { +_inP07yt9tTm(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_make_seq_class((MakeSeqIndex)param0); @@ -1239,7 +1242,7 @@ _inPU7VH9tTm(PyObject *, PyObject *args) { * char const *interrogate_make_seq_seq_name(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VH776V(PyObject *, PyObject *args) { +_inP07yt776V(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_seq_name((MakeSeqIndex)param0); @@ -1257,7 +1260,7 @@ _inPU7VH776V(PyObject *, PyObject *args) { * char const *interrogate_make_seq_num_name(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VHfaH0(PyObject *, PyObject *args) { +_inP07ytfaH0(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_num_name((MakeSeqIndex)param0); @@ -1275,7 +1278,7 @@ _inPU7VHfaH0(PyObject *, PyObject *args) { * char const *interrogate_make_seq_element_name(MakeSeqIndex make_seq) */ static PyObject * -_inPU7VHGB9D(PyObject *, PyObject *args) { +_inP07ytGB9D(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_make_seq_element_name((MakeSeqIndex)param0); @@ -1293,7 +1296,7 @@ _inPU7VHGB9D(PyObject *, PyObject *args) { * int interrogate_number_of_global_types(void) */ static PyObject * -_inPU7VHsxxs(PyObject *, PyObject *args) { +_inP07ytsxxs(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_global_types(); #if PY_MAJOR_VERSION >= 3 @@ -1310,7 +1313,7 @@ _inPU7VHsxxs(PyObject *, PyObject *args) { * TypeIndex interrogate_get_global_type(int n) */ static PyObject * -_inPU7VHMT0z(PyObject *, PyObject *args) { +_inP07ytMT0z(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_get_global_type((int)param0); @@ -1328,7 +1331,7 @@ _inPU7VHMT0z(PyObject *, PyObject *args) { * int interrogate_number_of_types(void) */ static PyObject * -_inPU7VHiW3v(PyObject *, PyObject *args) { +_inP07ytiW3v(PyObject *, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int return_value = interrogate_number_of_types(); #if PY_MAJOR_VERSION >= 3 @@ -1345,7 +1348,7 @@ _inPU7VHiW3v(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type(int n) */ static PyObject * -_inPU7VH4Px8(PyObject *, PyObject *args) { +_inP07yt4Px8(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_get_type((int)param0); @@ -1363,10 +1366,10 @@ _inPU7VH4Px8(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type_by_name(char const *type_name) */ static PyObject * -_inPU7VHNHcs(PyObject *, PyObject *args) { +_inP07ytNHcs(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - TypeIndex return_value = interrogate_get_type_by_name((char *)param0); + TypeIndex return_value = interrogate_get_type_by_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1381,10 +1384,10 @@ _inPU7VHNHcs(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type_by_scoped_name(char const *type_name) */ static PyObject * -_inPU7VHqHrb(PyObject *, PyObject *args) { +_inP07ytqHrb(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - TypeIndex return_value = interrogate_get_type_by_scoped_name((char *)param0); + TypeIndex return_value = interrogate_get_type_by_scoped_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1399,10 +1402,10 @@ _inPU7VHqHrb(PyObject *, PyObject *args) { * TypeIndex interrogate_get_type_by_true_name(char const *type_name) */ static PyObject * -_inPU7VHaOqq(PyObject *, PyObject *args) { +_inP07ytaOqq(PyObject *, PyObject *args) { char *param0; if (PyArg_ParseTuple(args, "s", ¶m0)) { - TypeIndex return_value = interrogate_get_type_by_true_name((char *)param0); + TypeIndex return_value = interrogate_get_type_by_true_name((char const *)param0); #if PY_MAJOR_VERSION >= 3 return PyLong_FromLong(return_value); #else @@ -1417,7 +1420,7 @@ _inPU7VHaOqq(PyObject *, PyObject *args) { * char const *interrogate_type_name(TypeIndex type) */ static PyObject * -_inPU7VHqWOw(PyObject *, PyObject *args) { +_inP07ytqWOw(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_name((TypeIndex)param0); @@ -1435,7 +1438,7 @@ _inPU7VHqWOw(PyObject *, PyObject *args) { * char const *interrogate_type_scoped_name(TypeIndex type) */ static PyObject * -_inPU7VHHu7x(PyObject *, PyObject *args) { +_inP07ytHu7x(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_scoped_name((TypeIndex)param0); @@ -1453,7 +1456,7 @@ _inPU7VHHu7x(PyObject *, PyObject *args) { * char const *interrogate_type_true_name(TypeIndex type) */ static PyObject * -_inPU7VHwGnA(PyObject *, PyObject *args) { +_inP07ytwGnA(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_true_name((TypeIndex)param0); @@ -1471,7 +1474,7 @@ _inPU7VHwGnA(PyObject *, PyObject *args) { * bool interrogate_type_is_nested(TypeIndex type) */ static PyObject * -_inPU7VHXGxx(PyObject *, PyObject *args) { +_inP07ytXGxx(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_nested((TypeIndex)param0); @@ -1485,7 +1488,7 @@ _inPU7VHXGxx(PyObject *, PyObject *args) { * TypeIndex interrogate_type_outer_class(TypeIndex type) */ static PyObject * -_inPU7VHj04Z(PyObject *, PyObject *args) { +_inP07ytj04Z(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_type_outer_class((TypeIndex)param0); @@ -1503,7 +1506,7 @@ _inPU7VHj04Z(PyObject *, PyObject *args) { * bool interrogate_type_has_comment(TypeIndex type) */ static PyObject * -_inPU7VHEOv4(PyObject *, PyObject *args) { +_inP07ytEOv4(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_comment((TypeIndex)param0); @@ -1517,7 +1520,7 @@ _inPU7VHEOv4(PyObject *, PyObject *args) { * char const *interrogate_type_comment(TypeIndex type) */ static PyObject * -_inPU7VHpCqJ(PyObject *, PyObject *args) { +_inP07ytpCqJ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_comment((TypeIndex)param0); @@ -1535,7 +1538,7 @@ _inPU7VHpCqJ(PyObject *, PyObject *args) { * bool interrogate_type_has_module_name(TypeIndex type) */ static PyObject * -_inPU7VH_Pz3(PyObject *, PyObject *args) { +_inP07yt_Pz3(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_module_name((TypeIndex)param0); @@ -1549,7 +1552,7 @@ _inPU7VH_Pz3(PyObject *, PyObject *args) { * char const *interrogate_type_module_name(TypeIndex type) */ static PyObject * -_inPU7VHt_06(PyObject *, PyObject *args) { +_inP07ytt_06(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_module_name((TypeIndex)param0); @@ -1567,7 +1570,7 @@ _inPU7VHt_06(PyObject *, PyObject *args) { * bool interrogate_type_has_library_name(TypeIndex type) */ static PyObject * -_inPU7VHmuPs(PyObject *, PyObject *args) { +_inP07ytmuPs(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_library_name((TypeIndex)param0); @@ -1581,7 +1584,7 @@ _inPU7VHmuPs(PyObject *, PyObject *args) { * char const *interrogate_type_library_name(TypeIndex type) */ static PyObject * -_inPU7VHvM8B(PyObject *, PyObject *args) { +_inP07ytvM8B(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { char const *return_value = interrogate_type_library_name((TypeIndex)param0); @@ -1599,7 +1602,7 @@ _inPU7VHvM8B(PyObject *, PyObject *args) { * bool interrogate_type_is_atomic(TypeIndex type) */ static PyObject * -_inPU7VHap97(PyObject *, PyObject *args) { +_inP07ytap97(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_atomic((TypeIndex)param0); @@ -1613,7 +1616,7 @@ _inPU7VHap97(PyObject *, PyObject *args) { * AtomicToken interrogate_type_atomic_token(TypeIndex type) */ static PyObject * -_inPU7VH0o8D(PyObject *, PyObject *args) { +_inP07yt0o8D(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { AtomicToken return_value = interrogate_type_atomic_token((TypeIndex)param0); @@ -1631,7 +1634,7 @@ _inPU7VH0o8D(PyObject *, PyObject *args) { * bool interrogate_type_is_unsigned(TypeIndex type) */ static PyObject * -_inPU7VHOoQ2(PyObject *, PyObject *args) { +_inP07ytOoQ2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_unsigned((TypeIndex)param0); @@ -1645,7 +1648,7 @@ _inPU7VHOoQ2(PyObject *, PyObject *args) { * bool interrogate_type_is_signed(TypeIndex type) */ static PyObject * -_inPU7VHKuFh(PyObject *, PyObject *args) { +_inP07ytKuFh(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_signed((TypeIndex)param0); @@ -1659,7 +1662,7 @@ _inPU7VHKuFh(PyObject *, PyObject *args) { * bool interrogate_type_is_long(TypeIndex type) */ static PyObject * -_inPU7VHo5L6(PyObject *, PyObject *args) { +_inP07yto5L6(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_long((TypeIndex)param0); @@ -1673,7 +1676,7 @@ _inPU7VHo5L6(PyObject *, PyObject *args) { * bool interrogate_type_is_longlong(TypeIndex type) */ static PyObject * -_inPU7VHzgKK(PyObject *, PyObject *args) { +_inP07ytzgKK(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_longlong((TypeIndex)param0); @@ -1687,7 +1690,7 @@ _inPU7VHzgKK(PyObject *, PyObject *args) { * bool interrogate_type_is_short(TypeIndex type) */ static PyObject * -_inPU7VH0FIF(PyObject *, PyObject *args) { +_inP07yt0FIF(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_short((TypeIndex)param0); @@ -1701,7 +1704,7 @@ _inPU7VH0FIF(PyObject *, PyObject *args) { * bool interrogate_type_is_wrapped(TypeIndex type) */ static PyObject * -_inPU7VHZqvD(PyObject *, PyObject *args) { +_inP07ytZqvD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_wrapped((TypeIndex)param0); @@ -1715,7 +1718,7 @@ _inPU7VHZqvD(PyObject *, PyObject *args) { * bool interrogate_type_is_pointer(TypeIndex type) */ static PyObject * -_inPU7VHDyRd(PyObject *, PyObject *args) { +_inP07ytDyRd(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_pointer((TypeIndex)param0); @@ -1729,7 +1732,7 @@ _inPU7VHDyRd(PyObject *, PyObject *args) { * bool interrogate_type_is_const(TypeIndex type) */ static PyObject * -_inPU7VHMnKa(PyObject *, PyObject *args) { +_inP07ytMnKa(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_const((TypeIndex)param0); @@ -1743,7 +1746,7 @@ _inPU7VHMnKa(PyObject *, PyObject *args) { * bool interrogate_type_is_typedef(TypeIndex type) */ static PyObject * -_inPU7VHRtji(PyObject *, PyObject *args) { +_inP07ytRtji(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_typedef((TypeIndex)param0); @@ -1757,7 +1760,7 @@ _inPU7VHRtji(PyObject *, PyObject *args) { * TypeIndex interrogate_type_wrapped_type(TypeIndex type) */ static PyObject * -_inPU7VHCnbQ(PyObject *, PyObject *args) { +_inP07ytCnbQ(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { TypeIndex return_value = interrogate_type_wrapped_type((TypeIndex)param0); @@ -1775,7 +1778,7 @@ _inPU7VHCnbQ(PyObject *, PyObject *args) { * bool interrogate_type_is_enum(TypeIndex type) */ static PyObject * -_inPU7VHdUVN(PyObject *, PyObject *args) { +_inP07ytdUVN(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_enum((TypeIndex)param0); @@ -1789,7 +1792,7 @@ _inPU7VHdUVN(PyObject *, PyObject *args) { * int interrogate_type_number_of_enum_values(TypeIndex type) */ static PyObject * -_inPU7VHihbt(PyObject *, PyObject *args) { +_inP07ytihbt(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_enum_values((TypeIndex)param0); @@ -1807,7 +1810,7 @@ _inPU7VHihbt(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_name(TypeIndex type, int n) */ static PyObject * -_inPU7VHbyPY(PyObject *, PyObject *args) { +_inP07ytbyPY(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1826,7 +1829,7 @@ _inPU7VHbyPY(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_scoped_name(TypeIndex type, int n) */ static PyObject * -_inPU7VHAaT6(PyObject *, PyObject *args) { +_inP07ytAaT6(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1845,7 +1848,7 @@ _inPU7VHAaT6(PyObject *, PyObject *args) { * char const *interrogate_type_enum_value_comment(TypeIndex type, int n) */ static PyObject * -_inPU7VHgL9q(PyObject *, PyObject *args) { +_inP07ytgL9q(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1864,7 +1867,7 @@ _inPU7VHgL9q(PyObject *, PyObject *args) { * int interrogate_type_enum_value(TypeIndex type, int n) */ static PyObject * -_inPU7VHWB97(PyObject *, PyObject *args) { +_inP07ytWB97(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1883,7 +1886,7 @@ _inPU7VHWB97(PyObject *, PyObject *args) { * bool interrogate_type_is_struct(TypeIndex type) */ static PyObject * -_inPU7VHDUAl(PyObject *, PyObject *args) { +_inP07ytDUAl(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_struct((TypeIndex)param0); @@ -1897,7 +1900,7 @@ _inPU7VHDUAl(PyObject *, PyObject *args) { * bool interrogate_type_is_class(TypeIndex type) */ static PyObject * -_inPU7VH1_Kf(PyObject *, PyObject *args) { +_inP07yt1_Kf(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_class((TypeIndex)param0); @@ -1911,7 +1914,7 @@ _inPU7VH1_Kf(PyObject *, PyObject *args) { * bool interrogate_type_is_union(TypeIndex type) */ static PyObject * -_inPU7VH98lD(PyObject *, PyObject *args) { +_inP07yt98lD(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_union((TypeIndex)param0); @@ -1925,7 +1928,7 @@ _inPU7VH98lD(PyObject *, PyObject *args) { * bool interrogate_type_is_fully_defined(TypeIndex type) */ static PyObject * -_inPU7VH9SHr(PyObject *, PyObject *args) { +_inP07yt9SHr(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_fully_defined((TypeIndex)param0); @@ -1939,7 +1942,7 @@ _inPU7VH9SHr(PyObject *, PyObject *args) { * bool interrogate_type_is_unpublished(TypeIndex type) */ static PyObject * -_inPU7VHdiZP(PyObject *, PyObject *args) { +_inP07ytdiZP(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_is_unpublished((TypeIndex)param0); @@ -1953,7 +1956,7 @@ _inPU7VHdiZP(PyObject *, PyObject *args) { * int interrogate_type_number_of_constructors(TypeIndex type) */ static PyObject * -_inPU7VHTdER(PyObject *, PyObject *args) { +_inP07ytTdER(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_constructors((TypeIndex)param0); @@ -1971,7 +1974,7 @@ _inPU7VHTdER(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_constructor(TypeIndex type, int n) */ static PyObject * -_inPU7VHYO56(PyObject *, PyObject *args) { +_inP07ytYO56(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -1990,7 +1993,7 @@ _inPU7VHYO56(PyObject *, PyObject *args) { * bool interrogate_type_has_destructor(TypeIndex type) */ static PyObject * -_inPU7VHxtCG(PyObject *, PyObject *args) { +_inP07ytxtCG(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_has_destructor((TypeIndex)param0); @@ -2004,7 +2007,7 @@ _inPU7VHxtCG(PyObject *, PyObject *args) { * bool interrogate_type_destructor_is_inherited(TypeIndex type) */ static PyObject * -_inPU7VH_EB2(PyObject *, PyObject *args) { +_inP07yt_EB2(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { bool return_value = interrogate_type_destructor_is_inherited((TypeIndex)param0); @@ -2018,7 +2021,7 @@ _inPU7VH_EB2(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_destructor(TypeIndex type) */ static PyObject * -_inPU7VHEG1l(PyObject *, PyObject *args) { +_inP07ytEG1l(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { FunctionIndex return_value = interrogate_type_get_destructor((TypeIndex)param0); @@ -2036,7 +2039,7 @@ _inPU7VHEG1l(PyObject *, PyObject *args) { * int interrogate_type_number_of_elements(TypeIndex type) */ static PyObject * -_inPU7VH7tUq(PyObject *, PyObject *args) { +_inP07yt7tUq(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_elements((TypeIndex)param0); @@ -2054,7 +2057,7 @@ _inPU7VH7tUq(PyObject *, PyObject *args) { * ElementIndex interrogate_type_get_element(TypeIndex type, int n) */ static PyObject * -_inPU7VHyStU(PyObject *, PyObject *args) { +_inP07ytyStU(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2073,7 +2076,7 @@ _inPU7VHyStU(PyObject *, PyObject *args) { * int interrogate_type_number_of_methods(TypeIndex type) */ static PyObject * -_inPU7VHdM85(PyObject *, PyObject *args) { +_inP07ytdM85(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_methods((TypeIndex)param0); @@ -2091,7 +2094,7 @@ _inPU7VHdM85(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_method(TypeIndex type, int n) */ static PyObject * -_inPU7VHk_GN(PyObject *, PyObject *args) { +_inP07ytk_GN(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2110,7 +2113,7 @@ _inPU7VHk_GN(PyObject *, PyObject *args) { * int interrogate_type_number_of_make_seqs(TypeIndex type) */ static PyObject * -_inPU7VH8QjG(PyObject *, PyObject *args) { +_inP07yt8QjG(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_make_seqs((TypeIndex)param0); @@ -2128,7 +2131,7 @@ _inPU7VH8QjG(PyObject *, PyObject *args) { * MakeSeqIndex interrogate_type_get_make_seq(TypeIndex type, int n) */ static PyObject * -_inPU7VHyMtj(PyObject *, PyObject *args) { +_inP07ytyMtj(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2147,7 +2150,7 @@ _inPU7VHyMtj(PyObject *, PyObject *args) { * int interrogate_type_number_of_casts(TypeIndex type) */ static PyObject * -_inPU7VHHDtN(PyObject *, PyObject *args) { +_inP07ytHDtN(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_casts((TypeIndex)param0); @@ -2165,7 +2168,7 @@ _inPU7VHHDtN(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_cast(TypeIndex type, int n) */ static PyObject * -_inPU7VHHFjA(PyObject *, PyObject *args) { +_inP07ytHFjA(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2184,7 +2187,7 @@ _inPU7VHHFjA(PyObject *, PyObject *args) { * int interrogate_type_number_of_derivations(TypeIndex type) */ static PyObject * -_inPU7VH_NPR(PyObject *, PyObject *args) { +_inP07yt_NPR(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_derivations((TypeIndex)param0); @@ -2202,7 +2205,7 @@ _inPU7VH_NPR(PyObject *, PyObject *args) { * TypeIndex interrogate_type_get_derivation(TypeIndex type, int n) */ static PyObject * -_inPU7VHcTOH(PyObject *, PyObject *args) { +_inP07ytcTOH(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2221,7 +2224,7 @@ _inPU7VHcTOH(PyObject *, PyObject *args) { * bool interrogate_type_derivation_has_upcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHhdU7(PyObject *, PyObject *args) { +_inP07ythdU7(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2236,7 +2239,7 @@ _inPU7VHhdU7(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_upcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHQPxU(PyObject *, PyObject *args) { +_inP07ytQPxU(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2255,7 +2258,7 @@ _inPU7VHQPxU(PyObject *, PyObject *args) { * bool interrogate_type_derivation_downcast_is_impossible(TypeIndex type, int n) */ static PyObject * -_inPU7VHO7Pz(PyObject *, PyObject *args) { +_inP07ytO7Pz(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2270,7 +2273,7 @@ _inPU7VHO7Pz(PyObject *, PyObject *args) { * bool interrogate_type_derivation_has_downcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHvu_E(PyObject *, PyObject *args) { +_inP07ytvu_E(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2285,7 +2288,7 @@ _inPU7VHvu_E(PyObject *, PyObject *args) { * FunctionIndex interrogate_type_get_downcast(TypeIndex type, int n) */ static PyObject * -_inPU7VHxGUt(PyObject *, PyObject *args) { +_inP07ytxGUt(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2304,7 +2307,7 @@ _inPU7VHxGUt(PyObject *, PyObject *args) { * int interrogate_type_number_of_nested_types(TypeIndex type) */ static PyObject * -_inPU7VHzM1P(PyObject *, PyObject *args) { +_inP07ytzM1P(PyObject *, PyObject *args) { int param0; if (PyArg_ParseTuple(args, "i", ¶m0)) { int return_value = interrogate_type_number_of_nested_types((TypeIndex)param0); @@ -2322,7 +2325,7 @@ _inPU7VHzM1P(PyObject *, PyObject *args) { * TypeIndex interrogate_type_get_nested_type(TypeIndex type, int n) */ static PyObject * -_inPU7VHoY5L(PyObject *, PyObject *args) { +_inP07ytoY5L(PyObject *, PyObject *args) { int param0; int param1; if (PyArg_ParseTuple(args, "ii", ¶m0, ¶m1)) { @@ -2336,139 +2339,169 @@ _inPU7VHoY5L(PyObject *, PyObject *args) { return (PyObject *)NULL; } +/* + * Python simple wrapper for + * void interrogate_request_database(char const *database_filename) + */ +static PyObject * +_inP07yte_7S(PyObject *, PyObject *args) { + char *param0; + if (PyArg_ParseTuple(args, "s", ¶m0)) { + interrogate_request_database((char const *)param0); + return Py_BuildValue(""); + } + return (PyObject *)NULL; +} + +/* + * Python simple wrapper for + * void interrogate_request_module(InterrogateModuleDef *def) + */ +static PyObject * +_inP07ytw_15(PyObject *, PyObject *args) { + int param0; + if (PyArg_ParseTuple(args, "i", ¶m0)) { + interrogate_request_module((InterrogateModuleDef *)param0); + return Py_BuildValue(""); + } + return (PyObject *)NULL; +} + static PyMethodDef python_simple_funcs[] = { - { "interrogate_add_search_directory", &_inPU7VHtbRf, METH_VARARGS }, - { "interrogate_add_search_path", &_inPU7VHda_g, METH_VARARGS }, - { "interrogate_error_flag", &_inPU7VH4RgX, METH_VARARGS }, - { "interrogate_number_of_manifests", &_inPU7VH3Gip, METH_VARARGS }, - { "interrogate_get_manifest", &_inPU7VHRKDz, METH_VARARGS }, - { "interrogate_get_manifest_by_name", &_inPU7VHgZ9N, METH_VARARGS }, - { "interrogate_manifest_name", &_inPU7VHFnRZ, METH_VARARGS }, - { "interrogate_manifest_definition", &_inPU7VHg0Qv, METH_VARARGS }, - { "interrogate_manifest_has_type", &_inPU7VHtrqw, METH_VARARGS }, - { "interrogate_manifest_get_type", &_inPU7VHdmpW, METH_VARARGS }, - { "interrogate_manifest_has_getter", &_inPU7VHUYgQ, METH_VARARGS }, - { "interrogate_manifest_getter", &_inPU7VH0k7F, METH_VARARGS }, - { "interrogate_manifest_has_int_value", &_inPU7VHfIsr, METH_VARARGS }, - { "interrogate_manifest_get_int_value", &_inPU7VHvysR, METH_VARARGS }, - { "interrogate_element_name", &_inPU7VHYQ_2, METH_VARARGS }, - { "interrogate_element_scoped_name", &_inPU7VH3kdv, METH_VARARGS }, - { "interrogate_element_has_comment", &_inPU7VHew01, METH_VARARGS }, - { "interrogate_element_comment", &_inPU7VHQna7, METH_VARARGS }, - { "interrogate_get_element_by_name", &_inPU7VHkg95, METH_VARARGS }, - { "interrogate_get_element_by_scoped_name", &_inPU7VHluRc, METH_VARARGS }, - { "interrogate_element_type", &_inPU7VHtHdM, METH_VARARGS }, - { "interrogate_element_has_getter", &_inPU7VHDId0, METH_VARARGS }, - { "interrogate_element_getter", &_inPU7VHHuAm, METH_VARARGS }, - { "interrogate_element_has_setter", &_inPU7VH_xr0, METH_VARARGS }, - { "interrogate_element_setter", &_inPU7VHH5qp, METH_VARARGS }, - { "interrogate_number_of_globals", &_inPU7VHU2_B, METH_VARARGS }, - { "interrogate_get_global", &_inPU7VHHFO2, METH_VARARGS }, - { "interrogate_number_of_global_functions", &_inPU7VHcfjm, METH_VARARGS }, - { "interrogate_get_global_function", &_inPU7VH3Sjw, METH_VARARGS }, - { "interrogate_number_of_functions", &_inPU7VHgJcX, METH_VARARGS }, - { "interrogate_get_function", &_inPU7VHYlw6, METH_VARARGS }, - { "interrogate_function_name", &_inPU7VHsmnz, METH_VARARGS }, - { "interrogate_function_scoped_name", &_inPU7VHxQ10, METH_VARARGS }, - { "interrogate_function_has_comment", &_inPU7VH6gPB, METH_VARARGS }, - { "interrogate_function_comment", &_inPU7VHISgV, METH_VARARGS }, - { "interrogate_function_prototype", &_inPU7VHH3bx, METH_VARARGS }, - { "interrogate_function_is_method", &_inPU7VHzeUk, METH_VARARGS }, - { "interrogate_function_class", &_inPU7VHUeI5, METH_VARARGS }, - { "interrogate_function_has_module_name", &_inPU7VHuSvx, METH_VARARGS }, - { "interrogate_function_module_name", &_inPU7VHwpYd, METH_VARARGS }, - { "interrogate_function_has_library_name", &_inPU7VHOfNh, METH_VARARGS }, - { "interrogate_function_library_name", &_inPU7VHf5_U, METH_VARARGS }, - { "interrogate_function_is_virtual", &_inPU7VHL3ZB, METH_VARARGS }, - { "interrogate_function_number_of_c_wrappers", &_inPU7VHXw0I, METH_VARARGS }, - { "interrogate_function_c_wrapper", &_inPU7VH3zru, METH_VARARGS }, - { "interrogate_function_number_of_python_wrappers", &_inPU7VHRrg2, METH_VARARGS }, - { "interrogate_function_python_wrapper", &_inPU7VHEJCx, METH_VARARGS }, - { "interrogate_wrapper_name", &_inPU7VHWAZr, METH_VARARGS }, - { "interrogate_wrapper_is_callable_by_name", &_inPU7VHrD_M, METH_VARARGS }, - { "interrogate_wrapper_has_comment", &_inPU7VHjolz, METH_VARARGS }, - { "interrogate_wrapper_comment", &_inPU7VHt_JD, METH_VARARGS }, - { "interrogate_wrapper_has_return_value", &_inPU7VHwEts, METH_VARARGS }, - { "interrogate_wrapper_return_type", &_inPU7VHrJWs, METH_VARARGS }, - { "interrogate_wrapper_caller_manages_return_value", &_inPU7VHpmFD, METH_VARARGS }, - { "interrogate_wrapper_return_value_destructor", &_inPU7VHyYUX, METH_VARARGS }, - { "interrogate_wrapper_number_of_parameters", &_inPU7VH54dn, METH_VARARGS }, - { "interrogate_wrapper_parameter_type", &_inPU7VHGMpW, METH_VARARGS }, - { "interrogate_wrapper_parameter_has_name", &_inPU7VHNuBV, METH_VARARGS }, - { "interrogate_wrapper_parameter_name", &_inPU7VH9UwA, METH_VARARGS }, - { "interrogate_wrapper_parameter_is_this", &_inPU7VH3FDt, METH_VARARGS }, - { "interrogate_wrapper_has_pointer", &_inPU7VHf513, METH_VARARGS }, - { "interrogate_wrapper_pointer", &_inPU7VHsqGH, METH_VARARGS }, - { "interrogate_wrapper_unique_name", &_inPU7VH7shV, METH_VARARGS }, - { "interrogate_get_wrapper_by_unique_name", &_inPU7VHA1eF, METH_VARARGS }, - { "interrogate_make_seq_class", &_inPU7VH9tTm, METH_VARARGS }, - { "interrogate_make_seq_seq_name", &_inPU7VH776V, METH_VARARGS }, - { "interrogate_make_seq_num_name", &_inPU7VHfaH0, METH_VARARGS }, - { "interrogate_make_seq_element_name", &_inPU7VHGB9D, METH_VARARGS }, - { "interrogate_number_of_global_types", &_inPU7VHsxxs, METH_VARARGS }, - { "interrogate_get_global_type", &_inPU7VHMT0z, METH_VARARGS }, - { "interrogate_number_of_types", &_inPU7VHiW3v, METH_VARARGS }, - { "interrogate_get_type", &_inPU7VH4Px8, METH_VARARGS }, - { "interrogate_get_type_by_name", &_inPU7VHNHcs, METH_VARARGS }, - { "interrogate_get_type_by_scoped_name", &_inPU7VHqHrb, METH_VARARGS }, - { "interrogate_get_type_by_true_name", &_inPU7VHaOqq, METH_VARARGS }, - { "interrogate_type_name", &_inPU7VHqWOw, METH_VARARGS }, - { "interrogate_type_scoped_name", &_inPU7VHHu7x, METH_VARARGS }, - { "interrogate_type_true_name", &_inPU7VHwGnA, METH_VARARGS }, - { "interrogate_type_is_nested", &_inPU7VHXGxx, METH_VARARGS }, - { "interrogate_type_outer_class", &_inPU7VHj04Z, METH_VARARGS }, - { "interrogate_type_has_comment", &_inPU7VHEOv4, METH_VARARGS }, - { "interrogate_type_comment", &_inPU7VHpCqJ, METH_VARARGS }, - { "interrogate_type_has_module_name", &_inPU7VH_Pz3, METH_VARARGS }, - { "interrogate_type_module_name", &_inPU7VHt_06, METH_VARARGS }, - { "interrogate_type_has_library_name", &_inPU7VHmuPs, METH_VARARGS }, - { "interrogate_type_library_name", &_inPU7VHvM8B, METH_VARARGS }, - { "interrogate_type_is_atomic", &_inPU7VHap97, METH_VARARGS }, - { "interrogate_type_atomic_token", &_inPU7VH0o8D, METH_VARARGS }, - { "interrogate_type_is_unsigned", &_inPU7VHOoQ2, METH_VARARGS }, - { "interrogate_type_is_signed", &_inPU7VHKuFh, METH_VARARGS }, - { "interrogate_type_is_long", &_inPU7VHo5L6, METH_VARARGS }, - { "interrogate_type_is_longlong", &_inPU7VHzgKK, METH_VARARGS }, - { "interrogate_type_is_short", &_inPU7VH0FIF, METH_VARARGS }, - { "interrogate_type_is_wrapped", &_inPU7VHZqvD, METH_VARARGS }, - { "interrogate_type_is_pointer", &_inPU7VHDyRd, METH_VARARGS }, - { "interrogate_type_is_const", &_inPU7VHMnKa, METH_VARARGS }, - { "interrogate_type_is_typedef", &_inPU7VHRtji, METH_VARARGS }, - { "interrogate_type_wrapped_type", &_inPU7VHCnbQ, METH_VARARGS }, - { "interrogate_type_is_enum", &_inPU7VHdUVN, METH_VARARGS }, - { "interrogate_type_number_of_enum_values", &_inPU7VHihbt, METH_VARARGS }, - { "interrogate_type_enum_value_name", &_inPU7VHbyPY, METH_VARARGS }, - { "interrogate_type_enum_value_scoped_name", &_inPU7VHAaT6, METH_VARARGS }, - { "interrogate_type_enum_value_comment", &_inPU7VHgL9q, METH_VARARGS }, - { "interrogate_type_enum_value", &_inPU7VHWB97, METH_VARARGS }, - { "interrogate_type_is_struct", &_inPU7VHDUAl, METH_VARARGS }, - { "interrogate_type_is_class", &_inPU7VH1_Kf, METH_VARARGS }, - { "interrogate_type_is_union", &_inPU7VH98lD, METH_VARARGS }, - { "interrogate_type_is_fully_defined", &_inPU7VH9SHr, METH_VARARGS }, - { "interrogate_type_is_unpublished", &_inPU7VHdiZP, METH_VARARGS }, - { "interrogate_type_number_of_constructors", &_inPU7VHTdER, METH_VARARGS }, - { "interrogate_type_get_constructor", &_inPU7VHYO56, METH_VARARGS }, - { "interrogate_type_has_destructor", &_inPU7VHxtCG, METH_VARARGS }, - { "interrogate_type_destructor_is_inherited", &_inPU7VH_EB2, METH_VARARGS }, - { "interrogate_type_get_destructor", &_inPU7VHEG1l, METH_VARARGS }, - { "interrogate_type_number_of_elements", &_inPU7VH7tUq, METH_VARARGS }, - { "interrogate_type_get_element", &_inPU7VHyStU, METH_VARARGS }, - { "interrogate_type_number_of_methods", &_inPU7VHdM85, METH_VARARGS }, - { "interrogate_type_get_method", &_inPU7VHk_GN, METH_VARARGS }, - { "interrogate_type_number_of_make_seqs", &_inPU7VH8QjG, METH_VARARGS }, - { "interrogate_type_get_make_seq", &_inPU7VHyMtj, METH_VARARGS }, - { "interrogate_type_number_of_casts", &_inPU7VHHDtN, METH_VARARGS }, - { "interrogate_type_get_cast", &_inPU7VHHFjA, METH_VARARGS }, - { "interrogate_type_number_of_derivations", &_inPU7VH_NPR, METH_VARARGS }, - { "interrogate_type_get_derivation", &_inPU7VHcTOH, METH_VARARGS }, - { "interrogate_type_derivation_has_upcast", &_inPU7VHhdU7, METH_VARARGS }, - { "interrogate_type_get_upcast", &_inPU7VHQPxU, METH_VARARGS }, - { "interrogate_type_derivation_downcast_is_impossible", &_inPU7VHO7Pz, METH_VARARGS }, - { "interrogate_type_derivation_has_downcast", &_inPU7VHvu_E, METH_VARARGS }, - { "interrogate_type_get_downcast", &_inPU7VHxGUt, METH_VARARGS }, - { "interrogate_type_number_of_nested_types", &_inPU7VHzM1P, METH_VARARGS }, - { "interrogate_type_get_nested_type", &_inPU7VHoY5L, METH_VARARGS }, + { "interrogate_add_search_directory", &_inP07yttbRf, METH_VARARGS }, + { "interrogate_add_search_path", &_inP07ytda_g, METH_VARARGS }, + { "interrogate_error_flag", &_inP07yt4RgX, METH_VARARGS }, + { "interrogate_number_of_manifests", &_inP07yt3Gip, METH_VARARGS }, + { "interrogate_get_manifest", &_inP07ytRKDz, METH_VARARGS }, + { "interrogate_get_manifest_by_name", &_inP07ytgZ9N, METH_VARARGS }, + { "interrogate_manifest_name", &_inP07ytFnRZ, METH_VARARGS }, + { "interrogate_manifest_definition", &_inP07ytg0Qv, METH_VARARGS }, + { "interrogate_manifest_has_type", &_inP07yttrqw, METH_VARARGS }, + { "interrogate_manifest_get_type", &_inP07ytdmpW, METH_VARARGS }, + { "interrogate_manifest_has_getter", &_inP07ytUYgQ, METH_VARARGS }, + { "interrogate_manifest_getter", &_inP07yt0k7F, METH_VARARGS }, + { "interrogate_manifest_has_int_value", &_inP07ytfIsr, METH_VARARGS }, + { "interrogate_manifest_get_int_value", &_inP07ytvysR, METH_VARARGS }, + { "interrogate_element_name", &_inP07ytYQ_2, METH_VARARGS }, + { "interrogate_element_scoped_name", &_inP07yt3kdv, METH_VARARGS }, + { "interrogate_element_has_comment", &_inP07ytew01, METH_VARARGS }, + { "interrogate_element_comment", &_inP07ytQna7, METH_VARARGS }, + { "interrogate_get_element_by_name", &_inP07ytkg95, METH_VARARGS }, + { "interrogate_get_element_by_scoped_name", &_inP07ytluRc, METH_VARARGS }, + { "interrogate_element_type", &_inP07yttHdM, METH_VARARGS }, + { "interrogate_element_has_getter", &_inP07ytDId0, METH_VARARGS }, + { "interrogate_element_getter", &_inP07ytHuAm, METH_VARARGS }, + { "interrogate_element_has_setter", &_inP07yt_xr0, METH_VARARGS }, + { "interrogate_element_setter", &_inP07ytH5qp, METH_VARARGS }, + { "interrogate_number_of_globals", &_inP07ytU2_B, METH_VARARGS }, + { "interrogate_get_global", &_inP07ytHFO2, METH_VARARGS }, + { "interrogate_number_of_global_functions", &_inP07ytcfjm, METH_VARARGS }, + { "interrogate_get_global_function", &_inP07yt3Sjw, METH_VARARGS }, + { "interrogate_number_of_functions", &_inP07ytgJcX, METH_VARARGS }, + { "interrogate_get_function", &_inP07ytYlw6, METH_VARARGS }, + { "interrogate_function_name", &_inP07ytsmnz, METH_VARARGS }, + { "interrogate_function_scoped_name", &_inP07ytxQ10, METH_VARARGS }, + { "interrogate_function_has_comment", &_inP07yt6gPB, METH_VARARGS }, + { "interrogate_function_comment", &_inP07ytISgV, METH_VARARGS }, + { "interrogate_function_prototype", &_inP07ytH3bx, METH_VARARGS }, + { "interrogate_function_is_method", &_inP07ytzeUk, METH_VARARGS }, + { "interrogate_function_class", &_inP07ytUeI5, METH_VARARGS }, + { "interrogate_function_has_module_name", &_inP07ytuSvx, METH_VARARGS }, + { "interrogate_function_module_name", &_inP07ytwpYd, METH_VARARGS }, + { "interrogate_function_has_library_name", &_inP07ytOfNh, METH_VARARGS }, + { "interrogate_function_library_name", &_inP07ytf5_U, METH_VARARGS }, + { "interrogate_function_is_virtual", &_inP07ytL3ZB, METH_VARARGS }, + { "interrogate_function_number_of_c_wrappers", &_inP07ytXw0I, METH_VARARGS }, + { "interrogate_function_c_wrapper", &_inP07yt3zru, METH_VARARGS }, + { "interrogate_function_number_of_python_wrappers", &_inP07ytRrg2, METH_VARARGS }, + { "interrogate_function_python_wrapper", &_inP07ytEJCx, METH_VARARGS }, + { "interrogate_wrapper_name", &_inP07ytWAZr, METH_VARARGS }, + { "interrogate_wrapper_is_callable_by_name", &_inP07ytrD_M, METH_VARARGS }, + { "interrogate_wrapper_has_comment", &_inP07ytjolz, METH_VARARGS }, + { "interrogate_wrapper_comment", &_inP07ytt_JD, METH_VARARGS }, + { "interrogate_wrapper_has_return_value", &_inP07ytwEts, METH_VARARGS }, + { "interrogate_wrapper_return_type", &_inP07ytrJWs, METH_VARARGS }, + { "interrogate_wrapper_caller_manages_return_value", &_inP07ytpmFD, METH_VARARGS }, + { "interrogate_wrapper_return_value_destructor", &_inP07ytyYUX, METH_VARARGS }, + { "interrogate_wrapper_number_of_parameters", &_inP07yt54dn, METH_VARARGS }, + { "interrogate_wrapper_parameter_type", &_inP07ytGMpW, METH_VARARGS }, + { "interrogate_wrapper_parameter_has_name", &_inP07ytNuBV, METH_VARARGS }, + { "interrogate_wrapper_parameter_name", &_inP07yt9UwA, METH_VARARGS }, + { "interrogate_wrapper_parameter_is_this", &_inP07yt3FDt, METH_VARARGS }, + { "interrogate_wrapper_has_pointer", &_inP07ytf513, METH_VARARGS }, + { "interrogate_wrapper_pointer", &_inP07ytsqGH, METH_VARARGS }, + { "interrogate_wrapper_unique_name", &_inP07yt7shV, METH_VARARGS }, + { "interrogate_get_wrapper_by_unique_name", &_inP07ytA1eF, METH_VARARGS }, + { "interrogate_make_seq_class", &_inP07yt9tTm, METH_VARARGS }, + { "interrogate_make_seq_seq_name", &_inP07yt776V, METH_VARARGS }, + { "interrogate_make_seq_num_name", &_inP07ytfaH0, METH_VARARGS }, + { "interrogate_make_seq_element_name", &_inP07ytGB9D, METH_VARARGS }, + { "interrogate_number_of_global_types", &_inP07ytsxxs, METH_VARARGS }, + { "interrogate_get_global_type", &_inP07ytMT0z, METH_VARARGS }, + { "interrogate_number_of_types", &_inP07ytiW3v, METH_VARARGS }, + { "interrogate_get_type", &_inP07yt4Px8, METH_VARARGS }, + { "interrogate_get_type_by_name", &_inP07ytNHcs, METH_VARARGS }, + { "interrogate_get_type_by_scoped_name", &_inP07ytqHrb, METH_VARARGS }, + { "interrogate_get_type_by_true_name", &_inP07ytaOqq, METH_VARARGS }, + { "interrogate_type_name", &_inP07ytqWOw, METH_VARARGS }, + { "interrogate_type_scoped_name", &_inP07ytHu7x, METH_VARARGS }, + { "interrogate_type_true_name", &_inP07ytwGnA, METH_VARARGS }, + { "interrogate_type_is_nested", &_inP07ytXGxx, METH_VARARGS }, + { "interrogate_type_outer_class", &_inP07ytj04Z, METH_VARARGS }, + { "interrogate_type_has_comment", &_inP07ytEOv4, METH_VARARGS }, + { "interrogate_type_comment", &_inP07ytpCqJ, METH_VARARGS }, + { "interrogate_type_has_module_name", &_inP07yt_Pz3, METH_VARARGS }, + { "interrogate_type_module_name", &_inP07ytt_06, METH_VARARGS }, + { "interrogate_type_has_library_name", &_inP07ytmuPs, METH_VARARGS }, + { "interrogate_type_library_name", &_inP07ytvM8B, METH_VARARGS }, + { "interrogate_type_is_atomic", &_inP07ytap97, METH_VARARGS }, + { "interrogate_type_atomic_token", &_inP07yt0o8D, METH_VARARGS }, + { "interrogate_type_is_unsigned", &_inP07ytOoQ2, METH_VARARGS }, + { "interrogate_type_is_signed", &_inP07ytKuFh, METH_VARARGS }, + { "interrogate_type_is_long", &_inP07yto5L6, METH_VARARGS }, + { "interrogate_type_is_longlong", &_inP07ytzgKK, METH_VARARGS }, + { "interrogate_type_is_short", &_inP07yt0FIF, METH_VARARGS }, + { "interrogate_type_is_wrapped", &_inP07ytZqvD, METH_VARARGS }, + { "interrogate_type_is_pointer", &_inP07ytDyRd, METH_VARARGS }, + { "interrogate_type_is_const", &_inP07ytMnKa, METH_VARARGS }, + { "interrogate_type_is_typedef", &_inP07ytRtji, METH_VARARGS }, + { "interrogate_type_wrapped_type", &_inP07ytCnbQ, METH_VARARGS }, + { "interrogate_type_is_enum", &_inP07ytdUVN, METH_VARARGS }, + { "interrogate_type_number_of_enum_values", &_inP07ytihbt, METH_VARARGS }, + { "interrogate_type_enum_value_name", &_inP07ytbyPY, METH_VARARGS }, + { "interrogate_type_enum_value_scoped_name", &_inP07ytAaT6, METH_VARARGS }, + { "interrogate_type_enum_value_comment", &_inP07ytgL9q, METH_VARARGS }, + { "interrogate_type_enum_value", &_inP07ytWB97, METH_VARARGS }, + { "interrogate_type_is_struct", &_inP07ytDUAl, METH_VARARGS }, + { "interrogate_type_is_class", &_inP07yt1_Kf, METH_VARARGS }, + { "interrogate_type_is_union", &_inP07yt98lD, METH_VARARGS }, + { "interrogate_type_is_fully_defined", &_inP07yt9SHr, METH_VARARGS }, + { "interrogate_type_is_unpublished", &_inP07ytdiZP, METH_VARARGS }, + { "interrogate_type_number_of_constructors", &_inP07ytTdER, METH_VARARGS }, + { "interrogate_type_get_constructor", &_inP07ytYO56, METH_VARARGS }, + { "interrogate_type_has_destructor", &_inP07ytxtCG, METH_VARARGS }, + { "interrogate_type_destructor_is_inherited", &_inP07yt_EB2, METH_VARARGS }, + { "interrogate_type_get_destructor", &_inP07ytEG1l, METH_VARARGS }, + { "interrogate_type_number_of_elements", &_inP07yt7tUq, METH_VARARGS }, + { "interrogate_type_get_element", &_inP07ytyStU, METH_VARARGS }, + { "interrogate_type_number_of_methods", &_inP07ytdM85, METH_VARARGS }, + { "interrogate_type_get_method", &_inP07ytk_GN, METH_VARARGS }, + { "interrogate_type_number_of_make_seqs", &_inP07yt8QjG, METH_VARARGS }, + { "interrogate_type_get_make_seq", &_inP07ytyMtj, METH_VARARGS }, + { "interrogate_type_number_of_casts", &_inP07ytHDtN, METH_VARARGS }, + { "interrogate_type_get_cast", &_inP07ytHFjA, METH_VARARGS }, + { "interrogate_type_number_of_derivations", &_inP07yt_NPR, METH_VARARGS }, + { "interrogate_type_get_derivation", &_inP07ytcTOH, METH_VARARGS }, + { "interrogate_type_derivation_has_upcast", &_inP07ythdU7, METH_VARARGS }, + { "interrogate_type_get_upcast", &_inP07ytQPxU, METH_VARARGS }, + { "interrogate_type_derivation_downcast_is_impossible", &_inP07ytO7Pz, METH_VARARGS }, + { "interrogate_type_derivation_has_downcast", &_inP07ytvu_E, METH_VARARGS }, + { "interrogate_type_get_downcast", &_inP07ytxGUt, METH_VARARGS }, + { "interrogate_type_number_of_nested_types", &_inP07ytzM1P, METH_VARARGS }, + { "interrogate_type_get_nested_type", &_inP07ytoY5L, METH_VARARGS }, + { "interrogate_request_database", &_inP07yte_7S, METH_VARARGS }, + { "interrogate_request_module", &_inP07ytw_15, METH_VARARGS }, { NULL, NULL } }; @@ -2502,3 +2535,4 @@ INIT_FUNC() { Py_InitModule("interrogatedb", python_simple_funcs); #endif } + From 57e5c8fb2544b3f7fa5efda4eea3bbbfdd939d69 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 10 Sep 2015 15:29:31 +0200 Subject: [PATCH 170/203] Wrap TypeHandle and ButtonHandle as ints in C wrappers --- dtool/src/dtoolbase/typeHandle.I | 15 ++++ dtool/src/dtoolbase/typeHandle.h | 5 +- dtool/src/interrogate/functionRemap.cxx | 48 ++++++++---- dtool/src/interrogate/interfaceMakerC.cxx | 27 +++++++ dtool/src/interrogate/interfaceMakerC.h | 2 + .../interrogate/interrogate_composite2.cxx | 1 + .../interrogate/parameterRemapHandleToInt.cxx | 65 ++++++++++++++++ .../interrogate/parameterRemapHandleToInt.h | 40 ++++++++++ dtool/src/interrogate/parameterRemapThis.cxx | 4 +- dtool/src/interrogate/typeManager.cxx | 27 ++++++- dtool/src/interrogate/typeManager.h | 1 + panda/src/express/config_express.N | 2 +- panda/src/linmath/luse.N | 74 +++++++++---------- panda/src/putil/buttonHandle.h | 2 +- panda/src/putil/config_util.N | 2 +- 15 files changed, 257 insertions(+), 58 deletions(-) create mode 100644 dtool/src/interrogate/parameterRemapHandleToInt.cxx create mode 100644 dtool/src/interrogate/parameterRemapHandleToInt.h diff --git a/dtool/src/dtoolbase/typeHandle.I b/dtool/src/dtoolbase/typeHandle.I index 867bdb4cea..ceb46a8e41 100644 --- a/dtool/src/dtoolbase/typeHandle.I +++ b/dtool/src/dtoolbase/typeHandle.I @@ -263,3 +263,18 @@ INLINE TypeHandle:: operator bool () const { return (_index != 0); } + +//////////////////////////////////////////////////////////////////// +// Function: TypeHandle::from_index +// Access: Public, Static +// Description: Creates a TypeHandle from a type index without +// error checking, for use by internal functions. +// +// See TypeRegistry::find_type_by_id(). +//////////////////////////////////////////////////////////////////// +INLINE TypeHandle TypeHandle:: +from_index(int index) { + TypeHandle handle; + handle._index = index; + return handle; +} diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index f94e983447..c05e25dd46 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -82,7 +82,7 @@ class TypedObject; // ancestry of a particular type may be queried, and the // type name may be retrieved for run-time display. //////////////////////////////////////////////////////////////////// -class EXPCL_DTOOL TypeHandle { +class EXPCL_DTOOL TypeHandle FINAL { PUBLISHED: enum MemoryClass { MC_singleton, @@ -140,6 +140,9 @@ PUBLISHED: INLINE static TypeHandle none(); INLINE operator bool () const; +public: + INLINE static TypeHandle from_index(int index); + private: int _index; static TypeHandle _none; diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 5e602a7553..2bf2fb06da 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -17,6 +17,7 @@ #include "interrogate.h" #include "parameterRemap.h" #include "parameterRemapThis.h" +#include "parameterRemapHandleToInt.h" #include "parameterRemapUnchanged.h" #include "interfaceMaker.h" #include "interrogateBuilder.h" @@ -146,8 +147,13 @@ call_function(ostream &out, int indent_level, bool convert_result, } else if (_type == T_typecast_method) { // A typecast method can be invoked implicitly. string cast_expr = - "(" + _return_type->get_orig_type()->get_local_name(&parser) + - ")(*" + container + ")"; + "(" + _return_type->get_orig_type()->get_local_name(&parser) + ")"; + + if (TypeManager::is_handle(_cpptype)) { + cast_expr += "(" + container + ")"; + } else { + cast_expr += "(*" + container + ")"; + } if (!convert_result) { return_expr = cast_expr; @@ -177,10 +183,7 @@ call_function(ostream &out, int indent_level, bool convert_result, } else if (_type == T_constructor) { // A special case for constructors. - string defconstruct = builder.in_defconstruct(_cpptype->get_local_name(&parser)); - if (pexprs.empty() && !defconstruct.empty()) { - return_expr = defconstruct; - } else if (_extension) { + if (_extension) { // Extension constructors are a special case. We assume there is a // default constructor for the class, and the actual construction is // done by an __init__ method. @@ -192,8 +195,22 @@ call_function(ostream &out, int indent_level, bool convert_result, << get_call_str("result", pexprs) << ";\n"; return_expr = "result"; + } else { - return_expr = "new " + get_call_str(container, pexprs); + string defconstruct = builder.in_defconstruct(_cpptype->get_local_name(&parser)); + string call_expr; + + if (pexprs.empty() && !defconstruct.empty()) { + call_expr = defconstruct; + } else { + call_expr = get_call_str(container, pexprs); + } + + if (!_return_type->return_value_needs_management()) { + return_expr = _return_type->get_return_expr(call_expr); + } else { + return_expr = "new " + call_expr; + } } if (_void_return) { nout << "Error, constructor for " << *_cpptype << " returning void.\n"; @@ -448,12 +465,9 @@ get_call_str(const string &container, const vector_string &pexprs) const { } else if (_has_this && !container.empty()) { // If we have a "this" parameter, the calling convention is also // a bit different. - if (container == "local_this") { - // This isn't important, it just looks a bit prettier. - call << container << "->" << _cppfunc->get_local_name(); - } else { - call << "(" << container << ")->" << _cppfunc->get_local_name(); - } + call << "("; + _parameters[0]._remap->pass_parameter(call, container); + call << ")." << _cppfunc->get_local_name(); } else { call << _cppfunc->get_local_name(&parser); @@ -569,7 +583,13 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak Parameter param; param._name = "this"; param._has_name = true; - param._remap = new ParameterRemapThis(_cpptype, _const_method); + if (_const_method) { + CPPType *const_type = CPPType::new_type(new CPPConstType(_cpptype)); + param._remap = interface_maker->remap_parameter(_cpptype, const_type); + } else { + param._remap = interface_maker->remap_parameter(_cpptype, _cpptype); + } + // param._remap = new ParameterRemapThis(_cpptype, _const_method); _parameters.push_back(param); _first_true_parameter = 1; } diff --git a/dtool/src/interrogate/interfaceMakerC.cxx b/dtool/src/interrogate/interfaceMakerC.cxx index 25eeb87023..9bd21a9922 100644 --- a/dtool/src/interrogate/interfaceMakerC.cxx +++ b/dtool/src/interrogate/interfaceMakerC.cxx @@ -16,6 +16,7 @@ #include "interrogateBuilder.h" #include "interrogate.h" #include "functionRemap.h" +#include "parameterRemapHandleToInt.h" #include "parameterRemapUnchanged.h" #include "typeManager.h" @@ -89,6 +90,32 @@ write_functions(ostream &out) { InterfaceMaker::write_functions(out); } +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMakerC::remap_parameter +// Access: Public, Virtual +// Description: Allocates a new ParameterRemap object suitable to the +// indicated parameter type. If struct_type is +// non-NULL, it is the type of the enclosing class for +// the function (method) in question. +// +// The return value is a newly-allocated ParameterRemap +// object, if the parameter type is acceptable, or NULL +// if the parameter type cannot be handled. +//////////////////////////////////////////////////////////////////// +ParameterRemap *InterfaceMakerC:: +remap_parameter(CPPType *struct_type, CPPType *param_type) { + // Wrap TypeHandle and ButtonHandle, which are practically just + // ints, as an integer instead of a pointer. It makes things easier + // on the scripting language, especially if there has to be a + // dynamic downcasting system on the scripting language side. + if (TypeManager::is_handle(param_type)) { + return new ParameterRemapHandleToInt(param_type); + + } else { + return InterfaceMaker::remap_parameter(struct_type, param_type); + } +} + //////////////////////////////////////////////////////////////////// // Function: InterfaceMakerC::synthesize_this_parameter // Access: Public, Virtual diff --git a/dtool/src/interrogate/interfaceMakerC.h b/dtool/src/interrogate/interfaceMakerC.h index 3faea7bae8..ee715424ac 100644 --- a/dtool/src/interrogate/interfaceMakerC.h +++ b/dtool/src/interrogate/interfaceMakerC.h @@ -36,6 +36,8 @@ public: virtual void write_prototypes(ostream &out,ostream *out_h); virtual void write_functions(ostream &out); + virtual ParameterRemap *remap_parameter(CPPType *struct_type, CPPType *param_type); + virtual bool synthesize_this_parameter(); protected: diff --git a/dtool/src/interrogate/interrogate_composite2.cxx b/dtool/src/interrogate/interrogate_composite2.cxx index 39000d2778..a427cf2674 100644 --- a/dtool/src/interrogate/interrogate_composite2.cxx +++ b/dtool/src/interrogate/interrogate_composite2.cxx @@ -14,5 +14,6 @@ #include "parameterRemapReferenceToPointer.cxx" #include "parameterRemapThis.cxx" #include "parameterRemapToString.cxx" +#include "parameterRemapHandleToInt.cxx" #include "parameterRemapUnchanged.cxx" diff --git a/dtool/src/interrogate/parameterRemapHandleToInt.cxx b/dtool/src/interrogate/parameterRemapHandleToInt.cxx new file mode 100644 index 0000000000..82220c1b75 --- /dev/null +++ b/dtool/src/interrogate/parameterRemapHandleToInt.cxx @@ -0,0 +1,65 @@ +// Filename: parameterRemapHandleToInt.cxx +// Created by: rdb (08Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "parameterRemapHandleToInt.h" +#include "interrogate.h" +#include "interrogateBuilder.h" +#include "typeManager.h" + +#include "cppType.h" +#include "cppDeclaration.h" +#include "cppConstType.h" +#include "cppPointerType.h" + +//////////////////////////////////////////////////////////////////// +// Function: ParameterRemapHandleToInt::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +ParameterRemapHandleToInt:: +ParameterRemapHandleToInt(CPPType *orig_type) : + ParameterRemap(orig_type) +{ + _new_type = TypeManager::get_int_type(); +} + +//////////////////////////////////////////////////////////////////// +// Function: ParameterRemapHandleToInt::pass_parameter +// Access: Public, Virtual +// Description: Outputs an expression that converts the indicated +// variable from the new type to the original type, for +// passing into the actual C++ function. +//////////////////////////////////////////////////////////////////// +void ParameterRemapHandleToInt:: +pass_parameter(ostream &out, const string &variable_name) { + CPPType *unwrapped = TypeManager::unwrap_const(_orig_type); + + if (unwrapped->get_local_name(&parser) == "TypeHandle") { + out << "TypeHandle::from_index(" << variable_name << ")"; + } else { + out << unwrapped->get_local_name(&parser) << "(" << variable_name << ")"; + } +} + +//////////////////////////////////////////////////////////////////// +// Function: ParameterRemapHandleToInt::get_return_expr +// Access: Public, Virtual +// Description: Returns an expression that evalutes to the +// appropriate value type for returning from the +// function, given an expression of the original type. +//////////////////////////////////////////////////////////////////// +string ParameterRemapHandleToInt:: +get_return_expr(const string &expression) { + return "(" + expression + ").get_index()"; +} diff --git a/dtool/src/interrogate/parameterRemapHandleToInt.h b/dtool/src/interrogate/parameterRemapHandleToInt.h new file mode 100644 index 0000000000..4a2915d279 --- /dev/null +++ b/dtool/src/interrogate/parameterRemapHandleToInt.h @@ -0,0 +1,40 @@ +// Filename: parameterRemapHandleToInt.h +// Created by: rdb (08Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef PARAMETERREMAPHANDLETOINT_H +#define PARAMETERREMAPHANDLETOINT_H + +#include "dtoolbase.h" + +#include "parameterRemap.h" + +//////////////////////////////////////////////////////////////////// +// Class : ParameterRemapHandleToInt +// Description : A ParameterRemap class that handles remapping a +// Handle parameter to an integer. This makes it +// easier to set up a dynamic typing system on the +// scripting language side. +// +// It also applies to ButtonHandle or any other class +// with the same semantics, because why not. +//////////////////////////////////////////////////////////////////// +class ParameterRemapHandleToInt : public ParameterRemap { +public: + ParameterRemapHandleToInt(CPPType *orig_type); + + virtual void pass_parameter(ostream &out, const string &variable_name); + virtual string get_return_expr(const string &expression); +}; + +#endif diff --git a/dtool/src/interrogate/parameterRemapThis.cxx b/dtool/src/interrogate/parameterRemapThis.cxx index db6e1d6d30..220f01ab44 100644 --- a/dtool/src/interrogate/parameterRemapThis.cxx +++ b/dtool/src/interrogate/parameterRemapThis.cxx @@ -45,8 +45,8 @@ ParameterRemapThis(CPPType *type, bool is_const) : // passing into the actual C++ function. //////////////////////////////////////////////////////////////////// void ParameterRemapThis:: -pass_parameter(ostream &out, const string &) { - out << "**invalid**"; +pass_parameter(ostream &out, const string &variable_name) { + out << "(*" << variable_name << ")"; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index c8e6dce9c7..1fd968d09f 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -1820,6 +1820,31 @@ is_Py_buffer(CPPType *type) { } } +//////////////////////////////////////////////////////////////////// +// Function: TypeManager::is_handle +// Access: Public, Static +// Description: Returns true if the indicated type is TypeHandle +// or a class with identical semantics like ButtonHandle. +//////////////////////////////////////////////////////////////////// +bool TypeManager:: +is_handle(CPPType *type) { + switch (type->get_subtype()) { + case CPPDeclaration::ST_const: + return is_handle(type->as_const_type()->_wrapped_around); + + case CPPDeclaration::ST_extension: + case CPPDeclaration::ST_struct: + return (type->get_local_name(&parser) == "TypeHandle" || + type->get_local_name(&parser) == "ButtonHandle"); + + case CPPDeclaration::ST_typedef: + return is_handle(type->as_typedef_type()->_type); + + default: + return false; + } +} + //////////////////////////////////////////////////////////////////// // Function: TypeManager::is_ostream // Access: Public, Static @@ -2631,7 +2656,7 @@ is_trivial(CPPType *source_type) { return is_trivial(source_type->as_typedef_type()->_type); default: - if (source_type->is_trivial()) { + if (source_type->is_trivial() || is_handle(source_type)) { return true; } else { // This is a bit of a hack. is_trivial() returns false for types that diff --git a/dtool/src/interrogate/typeManager.h b/dtool/src/interrogate/typeManager.h index 29b29eb2c7..5df95c63b9 100644 --- a/dtool/src/interrogate/typeManager.h +++ b/dtool/src/interrogate/typeManager.h @@ -112,6 +112,7 @@ public: static bool is_PyUnicodeObject(CPPType *type); static bool is_pointer_to_Py_buffer(CPPType *type); static bool is_Py_buffer(CPPType *type); + static bool is_handle(CPPType *type); static bool involves_unpublished(CPPType *type); static bool involves_protected(CPPType *type); diff --git a/panda/src/express/config_express.N b/panda/src/express/config_express.N index ad6e244b4e..454c630ed2 100644 --- a/panda/src/express/config_express.N +++ b/panda/src/express/config_express.N @@ -1,4 +1,4 @@ -defconstruct TypeHandle new TypeHandle(TypeHandle::none()) +defconstruct TypeHandle TypeHandle(TypeHandle::none()) forcetype PandaSystem forcetype DSearchPath diff --git a/panda/src/linmath/luse.N b/panda/src/linmath/luse.N index 20da19f1c8..ce89055b3d 100644 --- a/panda/src/linmath/luse.N +++ b/panda/src/linmath/luse.N @@ -1,46 +1,46 @@ -defconstruct LPoint2f new LPoint2f(0.0f) -defconstruct LPoint3f new LPoint3f(0.0f) -defconstruct LPoint4f new LPoint4f(0.0f) -defconstruct LPoint2d new LPoint2d(0.0) -defconstruct LPoint3d new LPoint3d(0.0) -defconstruct LPoint4d new LPoint4d(0.0) -defconstruct LPoint2i new LPoint2i(0) -defconstruct LPoint3i new LPoint3i(0) -defconstruct LPoint4i new LPoint4i(0) +defconstruct LPoint2f LPoint2f(0.0f) +defconstruct LPoint3f LPoint3f(0.0f) +defconstruct LPoint4f LPoint4f(0.0f) +defconstruct LPoint2d LPoint2d(0.0) +defconstruct LPoint3d LPoint3d(0.0) +defconstruct LPoint4d LPoint4d(0.0) +defconstruct LPoint2i LPoint2i(0) +defconstruct LPoint3i LPoint3i(0) +defconstruct LPoint4i LPoint4i(0) -defconstruct LVecBase2f new LVecBase2f(0.0f) -defconstruct LVecBase3f new LVecBase3f(0.0f) -defconstruct LVecBase4f new LVecBase4f(0.0f) -defconstruct LVecBase2d new LVecBase2d(0.0) -defconstruct LVecBase3d new LVecBase3d(0.0) -defconstruct LVecBase4d new LVecBase4d(0.0) -defconstruct LVecBase2i new LVecBase2i(0) -defconstruct LVecBase3i new LVecBase3i(0) -defconstruct LVecBase4i new LVecBase4i(0) +defconstruct LVecBase2f LVecBase2f(0.0f) +defconstruct LVecBase3f LVecBase3f(0.0f) +defconstruct LVecBase4f LVecBase4f(0.0f) +defconstruct LVecBase2d LVecBase2d(0.0) +defconstruct LVecBase3d LVecBase3d(0.0) +defconstruct LVecBase4d LVecBase4d(0.0) +defconstruct LVecBase2i LVecBase2i(0) +defconstruct LVecBase3i LVecBase3i(0) +defconstruct LVecBase4i LVecBase4i(0) -defconstruct LVector2f new LVector2f(0.0f) -defconstruct LVector3f new LVector3f(0.0f) -defconstruct LVector4f new LVector4f(0.0f) -defconstruct LVector2d new LVector2d(0.0) -defconstruct LVector3d new LVector3d(0.0) -defconstruct LVector4d new LVector4d(0.0) -defconstruct LVector2i new LVector2i(0) -defconstruct LVector3i new LVector3i(0) -defconstruct LVector4i new LVector4i(0) +defconstruct LVector2f LVector2f(0.0f) +defconstruct LVector3f LVector3f(0.0f) +defconstruct LVector4f LVector4f(0.0f) +defconstruct LVector2d LVector2d(0.0) +defconstruct LVector3d LVector3d(0.0) +defconstruct LVector4d LVector4d(0.0) +defconstruct LVector2i LVector2i(0) +defconstruct LVector3i LVector3i(0) +defconstruct LVector4i LVector4i(0) -defconstruct LMatrix3f new LMatrix3f(LMatrix3f::ident_mat()) -defconstruct LMatrix4f new LMatrix4f(LMatrix4f::ident_mat()) -defconstruct LMatrix3d new LMatrix3d(LMatrix3d::ident_mat()) -defconstruct LMatrix4d new LMatrix4d(LMatrix4d::ident_mat()) +defconstruct LMatrix3f LMatrix3f(LMatrix3f::ident_mat()) +defconstruct LMatrix4f LMatrix4f(LMatrix4f::ident_mat()) +defconstruct LMatrix3d LMatrix3d(LMatrix3d::ident_mat()) +defconstruct LMatrix4d LMatrix4d(LMatrix4d::ident_mat()) -defconstruct LQuaternionf new LQuaternionf(LQuaternionf::ident_quat()) -defconstruct LRotationf new LRotationf(LQuaternionf::ident_quat()) -defconstruct LOrientationf new LOrientationf(LQuaternionf::ident_quat()) +defconstruct LQuaternionf LQuaternionf(LQuaternionf::ident_quat()) +defconstruct LRotationf LRotationf(LQuaternionf::ident_quat()) +defconstruct LOrientationf LOrientationf(LQuaternionf::ident_quat()) -defconstruct LQuaterniond new LQuaterniond(LQuaterniond::ident_quat()) -defconstruct LRotationd new LRotationd(LQuaterniond::ident_quat()) -defconstruct LOrientationd new LOrientationd(LQuaterniond::ident_quat()) +defconstruct LQuaterniond LQuaterniond(LQuaterniond::ident_quat()) +defconstruct LRotationd LRotationd(LQuaterniond::ident_quat()) +defconstruct LOrientationd LOrientationd(LQuaterniond::ident_quat()) # We don't want to accidentally include any of the _src files in the # generated output, since these files aren't intended to be included by diff --git a/panda/src/putil/buttonHandle.h b/panda/src/putil/buttonHandle.h index c53f9a6ac9..dcb0e82db3 100644 --- a/panda/src/putil/buttonHandle.h +++ b/panda/src/putil/buttonHandle.h @@ -25,7 +25,7 @@ // device, including keyboard buttons and mouse buttons // (but see KeyboardButton and MouseButton). //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA_PUTIL ButtonHandle { +class EXPCL_PANDA_PUTIL ButtonHandle FINAL { PUBLISHED: INLINE ButtonHandle(); INLINE ButtonHandle(int index); diff --git a/panda/src/putil/config_util.N b/panda/src/putil/config_util.N index 4bcc299b1e..3e7f11238a 100644 --- a/panda/src/putil/config_util.N +++ b/panda/src/putil/config_util.N @@ -1,4 +1,4 @@ -defconstruct ButtonHandle new ButtonHandle(0) +defconstruct ButtonHandle ButtonHandle(0) ignoremember _factory ignoremember get_factory From c9434c5b8506c64014eee6544c847ce51402e0c2 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 10 Sep 2015 15:30:24 +0200 Subject: [PATCH 171/203] Fix shadowed light copy constructor, fix point light lens orientations --- panda/src/pgraphnodes/lightLensNode.cxx | 13 +++++------ panda/src/pgraphnodes/pointLight.cxx | 29 +++++-------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/panda/src/pgraphnodes/lightLensNode.cxx b/panda/src/pgraphnodes/lightLensNode.cxx index bead7ecf01..c26f0cd9c4 100644 --- a/panda/src/pgraphnodes/lightLensNode.cxx +++ b/panda/src/pgraphnodes/lightLensNode.cxx @@ -62,15 +62,12 @@ LightLensNode:: LightLensNode:: LightLensNode(const LightLensNode ©) : Light(copy), - Camera(copy) + Camera(copy), + _shadow_caster(copy._shadow_caster), + _sb_xsize(copy._sb_xsize), + _sb_ysize(copy._sb_ysize), + _sb_sort(-10) { - _shadow_caster = false; - _sb_xsize = 512; - _sb_ysize = 512; - _sb_sort = -10; - // Backface culling helps eliminating artifacts. - set_initial_state(RenderState::make(CullFaceAttrib::make_reverse(), - ColorWriteAttrib::make(ColorWriteAttrib::C_off))); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraphnodes/pointLight.cxx b/panda/src/pgraphnodes/pointLight.cxx index 5ac0c8885c..20fb1dbd1e 100644 --- a/panda/src/pgraphnodes/pointLight.cxx +++ b/panda/src/pgraphnodes/pointLight.cxx @@ -69,22 +69,22 @@ PointLight(const string &name) : { PT(Lens) lens; lens = new PerspectiveLens(90, 90); - lens->set_view_vector(1, 0, 0, 0, 0, 1); + lens->set_view_vector(1, 0, 0, 0, -1, 0); set_lens(0, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(-1, 0, 0, 0, 0, 1); + lens->set_view_vector(-1, 0, 0, 0, -1, 0); set_lens(1, lens); lens = new PerspectiveLens(90, 90); lens->set_view_vector(0, 1, 0, 0, 0, 1); set_lens(2, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, -1, 0, 0, 0, 1); + lens->set_view_vector(0, -1, 0, 0, 0, -1); set_lens(3, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, 1, 0, 0, 1); + lens->set_view_vector(0, 0, 1, 0, -1, 0); set_lens(4, lens); lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, -1, 0, 0, 1); + lens->set_view_vector(0, 0, -1, 0, -1, 0); set_lens(5, lens); } @@ -100,25 +100,6 @@ PointLight(const PointLight ©) : LightLensNode(copy), _cycler(copy._cycler) { - PT(Lens) lens; - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(1, 0, 0, 0, 0, 1); - set_lens(0, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(-1, 0, 0, 0, 0, 1); - set_lens(1, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 1, 0, 0, 0, 1); - set_lens(2, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, -1, 0, 0, 0, 1); - set_lens(3, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, 1, 0, 0, 1); - set_lens(4, lens); - lens = new PerspectiveLens(90, 90); - lens->set_view_vector(0, 0, -1, 0, 0, 1); - set_lens(5, lens); } //////////////////////////////////////////////////////////////////// From d63110a49e9d7a3243204974f99761065e39652d Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 30 Apr 2015 19:56:24 +0200 Subject: [PATCH 172/203] Add localized text strings to p3dcert --- direct/src/plugin/p3dAuthSession.cxx | 5 +- direct/src/plugin/p3dCert.cxx | 133 +++--- direct/src/plugin/p3dCert.h | 6 +- direct/src/plugin/p3dCert_strings.cxx | 570 ++++++++++++++++++++++++++ direct/src/plugin/p3dCert_strings.h | 45 ++ direct/src/plugin/p3dSession.cxx | 4 +- makepanda/makepanda.py | 2 + 7 files changed, 695 insertions(+), 70 deletions(-) create mode 100644 direct/src/plugin/p3dCert_strings.cxx create mode 100644 direct/src/plugin/p3dCert_strings.h diff --git a/direct/src/plugin/p3dAuthSession.cxx b/direct/src/plugin/p3dAuthSession.cxx index 103c372f0a..177ffc7c0a 100644 --- a/direct/src/plugin/p3dAuthSession.cxx +++ b/direct/src/plugin/p3dAuthSession.cxx @@ -183,7 +183,7 @@ start_p3dcert() { // These are the enviroment variables we forward from the current // environment, if they are set. const wchar_t *keep[] = { - L"TMP", L"TEMP", L"HOME", L"USER", + L"TMP", L"TEMP", L"HOME", L"USER", L"SYSTEMROOT", L"USERPROFILE", L"COMSPEC", NULL }; @@ -209,7 +209,8 @@ start_p3dcert() { // These are the enviroment variables we forward from the current // environment, if they are set. const char *keep[] = { - "TMP", "TEMP", "HOME", "USER", + "TMP", "TEMP", "HOME", "USER", + "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG", #ifdef HAVE_X11 "DISPLAY", "XAUTHORITY", #endif diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index b920550092..8d78ff7485 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "p3dCert.h" +#include "p3dCert_strings.h" #include "wstring_encode.h" #include "mkdir_complete.h" @@ -26,8 +27,9 @@ #include #include #include +#include -#define BUTTON_WIDTH 120 +#define BUTTON_WIDTH 180 // fit the Russian text #define BUTTON_SPACE 10 #include "ca_bundle_data_src.c" @@ -40,59 +42,58 @@ #define snprintf sprintf_s #endif -static const char -self_signed_cert_text[] = - "This Panda3D application uses a self-signed certificate. " - "This means the author's name can't be verified, and you have " - "no way of knowing for sure who wrote it.\n\n" +static LanguageIndex li = LI_default; - "We recommend you click Cancel to avoid running this application."; +static LanguageIndex detect_language() { + // First consult the LANGUAGE variable, which is a GNU extension that can + // contain multiple languages in order of preference. + const char *lang = getenv("LANGUAGE"); + while (lang != NULL && lang[0] != 0) { + size_t len; + const char *next = strchr(lang, ':'); + if (next == NULL) { + len = strlen(lang); + } else { + len = (next - lang); + ++next; + } -static const char -unknown_auth_cert_text[] = - "This Panda3D application has been signed, but we don't recognize " - "the authority that verifies the signature. This means the author's " - "name can't be trusted, and you have no way of knowing " - "for sure who wrote it.\n\n" + if (len >= 2 && !isalnum(lang[2])) { + // It may be a two-letter language code; match it in our list. + for (int i = 0; i < LI_COUNT; ++i) { + const char *lang_code = language_codes[i]; + if (lang_code != NULL && strncasecmp(lang, lang_code, 2) == 0) { + return (LanguageIndex)i; + } + } + } - "We recommend you click Cancel to avoid running this application."; + lang = next; + } -static const char -verified_cert_text[] = - "This Panda3D application has been signed by %s. " - "If you trust %s, then click the Run button below " - "to run this application on your computer. This will also " - "automatically approve this and any other applications signed by " - "%s in the future.\n\n" + // Fall back to the C locale functions. + setlocale(LC_ALL, ""); + lang = setlocale(LC_MESSAGES, NULL); - "If you are unsure about this application, " - "you should click Cancel instead."; + if (lang == NULL || lang[0] == 0 || strcmp(lang, "C") == 0) { + // Try the LANG variable. + lang = getenv("LANG"); + } -static const char -expired_cert_text[] = - "This Panda3D application has been signed by %s, " - "but the certificate has expired.\n\n" - - "You should check the current date set on your computer's clock " - "to make sure it is correct.\n\n" - - "If your computer's date is correct, we recommend " - "you click Cancel to avoid running this application."; - -static const char -generic_error_cert_text[] = - "This Panda3D application has been signed, but there is a problem " - "with the certificate (OpenSSL error code %d).\n\n" - - "We recommend you click Cancel to avoid running this application."; - -static const char -no_cert_text[] = - "This Panda3D application has not been signed. This means you have " - "no way of knowing for sure who wrote it.\n\n" - - "Click Cancel to avoid running this application."; + if (lang == NULL || strlen(lang) < 2 || isalnum(lang[2])) { + // Couldn't extract a meaningful two-letter code. + return LI_default; + } + // It may be a two-letter language code; match it in our list. + for (int i = 0; i < LI_COUNT; ++i) { + const char *lang_code = language_codes[i]; + if (lang_code != NULL && strncasecmp(lang, lang_code, 2) == 0) { + return (LanguageIndex)i; + } + } + return LI_default; +} #ifdef _WIN32 int WINAPI @@ -107,6 +108,8 @@ wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdS return 1; } + li = detect_language(); + wstring cert_filename (argv[0]); wstring cert_dir (argv[1]); LocalFree(argv); @@ -126,6 +129,8 @@ int main(int argc, char **argv) { return 1; } + li = detect_language(); + string cert_filename (argv[1]); string cert_dir (argv[2]); @@ -510,19 +515,19 @@ layout() { short bx = (w() - nbuttons * BUTTON_WIDTH - (nbuttons - 1) * BUTTON_SPACE) / 2; if (_verify_result == 0 && _cert != NULL) { - Fl_Return_Button *run_button = new Fl_Return_Button(bx, next_y, BUTTON_WIDTH, 25, "Run"); + Fl_Return_Button *run_button = new Fl_Return_Button(bx, next_y, BUTTON_WIDTH, 25, run_title[li]); run_button->callback(this->run_clicked, this); bx += BUTTON_WIDTH + BUTTON_SPACE; } if (_cert != NULL) { - Fl_Button *view_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, "View Certificate"); + Fl_Button *view_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, show_cert_title[li]); view_button->callback(this->view_cert_clicked, this); bx += BUTTON_WIDTH + BUTTON_SPACE; } Fl_Button *cancel_button; - cancel_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, "Cancel"); + cancel_button = new Fl_Button(bx, next_y, BUTTON_WIDTH, 25, cancel_title[li]); cancel_button->callback(this->cancel_clicked, this); next_y += 42; @@ -542,12 +547,12 @@ void AuthDialog:: get_text(char *header, size_t hlen, char *text, size_t tlen) { switch (_verify_result) { case -1: - strncpy(header, "No signature!", hlen); - strncpy(text, no_cert_text, tlen); + strncpy(header, no_cert_title[li], hlen); + strncpy(text, no_cert_text[li], tlen); break; case 0: - snprintf(text, tlen, verified_cert_text, _friendly_name.c_str(), + snprintf(text, tlen, verified_cert_text[li], _friendly_name.c_str(), _friendly_name.c_str(), _friendly_name.c_str()); break; @@ -555,24 +560,24 @@ get_text(char *header, size_t hlen, char *text, size_t tlen) { case X509_V_ERR_CERT_HAS_EXPIRED: case X509_V_ERR_CRL_NOT_YET_VALID: case X509_V_ERR_CRL_HAS_EXPIRED: - strncpy(header, "Expired signature!", hlen); - snprintf(text, tlen, expired_cert_text, _friendly_name.c_str()); + strncpy(header, expired_cert_title[li], hlen); + snprintf(text, tlen, expired_cert_text[li], _friendly_name.c_str()); break; case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: - strncpy(header, "Unverified signature!", hlen); - snprintf(text, tlen, unknown_auth_cert_text); + strncpy(header, unverified_cert_title[li], hlen); + strncpy(text, unknown_auth_cert_text[li], tlen); break; case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: - strncpy(header, "Unverified signature!", hlen); - strncpy(text, self_signed_cert_text, tlen); + strncpy(header, unverified_cert_title[li], hlen); + strncpy(text, self_signed_cert_text[li], tlen); break; default: - strncpy(header, "Unverified signature!", hlen); - snprintf(text, tlen, generic_error_cert_text, _verify_result); + strncpy(header, unverified_cert_title[li], hlen); + snprintf(text, tlen, generic_error_cert_text[li], _verify_result); } } @@ -583,7 +588,7 @@ get_text(char *header, size_t hlen, char *text, size_t tlen) { //////////////////////////////////////////////////////////////////// ViewCertDialog:: ViewCertDialog(AuthDialog *auth_dialog, X509 *cert) : - Fl_Window(600, 400, "View Certificate"), + Fl_Window(600, 400, show_cert_title[li]), _auth_dialog(auth_dialog), _cert(cert) { @@ -660,12 +665,12 @@ layout() { short bx = (w() - BUTTON_WIDTH * 2 - BUTTON_SPACE) / 2; - Fl_Return_Button *run_button = new Fl_Return_Button(bx, 360, BUTTON_WIDTH, 25, "Run"); + Fl_Return_Button *run_button = new Fl_Return_Button(bx, 360, BUTTON_WIDTH, 25, run_title[li]); run_button->callback(this->run_clicked, this); bx += BUTTON_WIDTH + BUTTON_SPACE; - Fl_Button *cancel_button = new Fl_Button(bx, 360, BUTTON_WIDTH, 25, "Cancel"); + Fl_Button *cancel_button = new Fl_Button(bx, 360, BUTTON_WIDTH, 25, cancel_title[li]); cancel_button->callback(this->cancel_clicked, this); end(); diff --git a/direct/src/plugin/p3dCert.h b/direct/src/plugin/p3dCert.h index dd434409b6..abc5deed4e 100644 --- a/direct/src/plugin/p3dCert.h +++ b/direct/src/plugin/p3dCert.h @@ -92,9 +92,9 @@ private: X509 *_cert; STACK_OF(X509) *_stack; - char _header[32]; - char _text[512]; - char _text_clean[1024]; + char _header[64]; + char _text[1024]; + char _text_clean[2048]; string _friendly_name; int _verify_result; diff --git a/direct/src/plugin/p3dCert_strings.cxx b/direct/src/plugin/p3dCert_strings.cxx new file mode 100644 index 0000000000..e33f2adba9 --- /dev/null +++ b/direct/src/plugin/p3dCert_strings.cxx @@ -0,0 +1,570 @@ +// Filename: p3dCert_strings.h +// Created by: rdb (25Mar15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "p3dCert_strings.h" + +// Translations kindly provided by: +// eng: drwr +// nld: rdb +// deu: Sebastian Hoffmann +// spa: Imanol Celaya +// ita: Flavio Clava +// rus: montreal + +const char *language_codes[LI_COUNT] = + {"en", "nl", "de", "es", "it", "eo", "ru"}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693%28v=vs.85%29.aspx +const unsigned char language_ids[LI_COUNT] = + {0x09, 0x13, 0x07, 0x0A, 0x10, 0, 0x19}; + +const char * +run_title[LI_COUNT] = { + "Run", + "Uitvoeren", + "Starten", + "Ejecutar", + "Lancia", + "Lan\304\211i", + "\320\227\320\260\320\277\321\203\321\201\321\202\320\270\321\202\321\214", +}; + +const char * +cancel_title[LI_COUNT] = { + "Cancel", + "Annuleren", + "Abbrechen", + "Cancelar", + "Cancella", + "Nuligi", + "\320\236\321\202\320\274\320\265\320\275\320\260", +}; + +const char * +show_cert_title[LI_COUNT] = { + "Show Certificate", + "Toon Certificaat", + "Zertifikat anzeigen", + "Mostrar certificado", + "Mostra certificato", + "Montri Ateston", + "\320\237\320\276\320\272\320\260\320\267\320\260\321\202\321\214 \321\201" + "\320\265\321\200\321\202\320\270\321\204\320\270\320\272\320\260\321\202", +}; + +const char * +new_application_title[LI_COUNT] = { + "New Panda3D Application", + "Nieuwe Panda3D Applicatie", + "Neue Panda3D-Anwendung", + "Nueva aplicaci\303\263n de Panda3D", + "Nuova applicazione Panda3D", + "Nova aplika\304\265o de Panda3D", + "\320\235\320\276\320\262\320\276\320\265 Panda3D-\320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\320\265", +}; + +const char * +no_cert_title[LI_COUNT] = { + "No signature!", + "Geen handtekening!", + "Keine Signatur!", + "Sin firma!", + "Nessuna firma!", + "Ne subskribo!", + "\320\235\320\265\321\202 \320\277\320\276\320\264\320\277\320\270\321\201" + "\320\270!", +}; + +const char * +unverified_cert_title[LI_COUNT] = { + "Unverified signature!", + "Ongeverifieerde handtekening!", + "Unbest\303\244tigte Signatur!", + "Firma sin verificar!", + "Firma non verificata!", + "Nekontrolita subskribo!", + "\320\235\320\265\320\277\321\200\320\276\320\262\320\265\321\200\320\265" + "\320\275\320\275\320\260\321\217 \320\277\320\276\320\264\320\277\320\270" + "\321\201\321\214!", +}; + +const char * +expired_cert_title[LI_COUNT] = { + "Expired signature!", + "Verlopen handtekening!", + "Abgelaufene Signatur!", + "Firma caducada!", + "Firma scaduta!", + "Eksvalidi\304\235inta subskribo!", + "\320\241\321\200\320\276\320\272 \320\264\320\265\320\271\321\201\321\202" + "\320\262\320\270\321\217 \320\277\320\276\320\264\320\277\320\270\321\201" + "\320\270 \320\270\321\201\321\202\321\221\320\272!", +}; + + +const char * +self_signed_cert_text[LI_COUNT] = { + // eng + "This Panda3D application uses a self-signed certificate. " + "This means the author's name can't be verified, and you have " + "no way of knowing for sure who wrote it.\n" + "\n" + "We recommend you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie gebruikt een zelf-getekend certificaat. " + "Dit betekent dat de auteursnaam niet kan worden geverifieerd, en het " + "niet zeker is of de applicatie te vertrouwen is.\n" + "\n" + "Het is aanbevolen om op Annuleren te klikken om de applicatie af te " + "sluiten.", + + // deu + "Diese Panda3D-Anwendung benutzt ein selbst-signiertes Zertifikat. Dies " + "bedeutet, dass weder der Name des Autors \303\274berpr\303\274ft werden " + "kann, noch dass garantiert werden kann, dass tats\303\244chlich die " + "angegebene Person diese Anwendung geschrieben hat.\n" + "\n" + "Wir empfehlen, dass Sie Abbrechen dr\303\274cken um diese Anwendung nicht " + "auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D usa un certificado autofirmado. " + "Esto significa que el nombre del autor no puede ser verificado y no se " + "puede conocer seguro quien la ha escrito.\n" + "\n" + "Se recomienda cancelar para evitar ejecutar esta aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D usa un certificato autofirmato. Ci\303\262 " + "significa che il nome dell'autore non pu\303\262 essere verificato, e " + "che non hai modo di assicurarti circa chi la abbia scritta.\n" + "\n" + "Raccomandiamo di cliccare su Cancella per evitare di lanciare questa " + "applicazione.", + + // epo + "\304\210i tiu aplika\304\265o de Panda3D uzas memsubskribitan ateston. " + "Tio signifas ke la nomo de la verkanto ne povas esti kontrolita, kaj vi " + "ne havas certan scimanieron pri la vera verkanto de la aplika\304\265o.\n" + "\n" + "Ni rekomendas ke vi premas la butonon 'Nuligi' por eviti lan\304\211on de " + "\304\211i tiu aplika\304\265o.", + + // rus + "\320\255\321\202\320\276 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\265 \320\270\321\201\320\277\320\276\320\273" + "\321\214\320\267\321\203\320\265\321\202 \321\201\320\260\320\274\320\276" + "\320\267\320\260\320\262\320\265\321\200\320\265\320\275\320\275\321\213" + "\320\271 \321\201\320\265\321\200\321\202\320\270\321\204\320\270\320\272" + "\320\260\321\202. \320\255\321\202\320\276 \320\276\320\267\320\275" + "\320\260\321\207\320\260\320\265\321\202, \321\207\321\202\320\276 " + "\320\270\320\274\321\217 \320\260\320\262\321\202\320\276\321\200\320\260 " + "\320\275\320\265 \320\274\320\276\320\266\320\265\321\202 \320\261\321\213" + "\321\202\321\214 \320\277\320\276\320\264\321\202\320\262\320\265\320\266" + "\320\264\320\265\320\275\320\276, \320\270 \320\262\321\213 \320\275" + "\320\265 \320\274\320\276\320\266\320\265\321\202\320\265 \320\267\320\275" + "\320\260\321\202\321\214, \320\272\321\202\320\276 \320\275\320\260" + "\320\277\320\270\321\201\320\260\320\273 \321\215\321\202\320\276 \320\277" + "\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270\320\265.\n" + "\n" + "\320\234\321\213 \321\200\320\265\320\272\320\276\320\274\320\265\320\275" + "\320\264\321\203\320\265\320\274 \320\262\320\260\320\274 \320\275\320\260" + "\320\266\320\260\321\202\321\214 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +unknown_auth_cert_text[LI_COUNT] = { + "This Panda3D application has been signed, but we don't recognize " + "the authority that verifies the signature. This means the author's " + "name can't be verified, and you have no way of knowing " + "for sure who wrote it.\n" + "\n" + "We recommend you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is ondertekend, maar de certificaatautoriteit " + "die het certificaat heeft uitgegeven wordt niet herkend. Dit betekent " + "dat de auteursnaam niet te vertrouwen is, en het niet zeker is wie de " + "applicatie gemaakt heeft.\n" + "\n" + "Het is aanbevolen om op Annuleren te klikken om de applicatie af te " + "sluiten.", + + // deu + "Diese Panda3D-Anwendung wurde signiert, aber die " + "\303\234berpr\303\274fungsstelle wurde nicht anerkannt. Dies bedeutet, " + "dass weder der Name des Autors \303\274berpr\303\274ft werden kann, noch " + "dass garantiert werden kann, dass tats\303\244chlich die angegebene " + "Person diese Anwendung geschrieben hat.\n" + "\n" + "Wir empfehlen, dass Sie Abbrechen dr\303\274cken um diese Anwendung nicht " + "auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D esta firmada, pero no reconocemos la " + "autoridad que la verifica. Esto significa que el nombre del autor no " + "puede ser verificado y no se puede conocer seguro quien la ha escrito.\n" + "\n" + "Se recomienda cancelar para evitar ejecutar esta aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D \303\250 stata firmata, ma non riconosciamo " + "l'autorit\303\240 che verifica la firma. Ci\303\262 significa che il " + "nome dell'autore non pu\303\262 essere verificato, e che non hai modo " + "di assicurarti circa chi la abbia scritta.\n" + "\n" + "Raccomandiamo di cliccare su Cancella per evitare di lanciare questa " + "applicazione.", + + // epo + "\304\210i tiu aplika\304\265o estas subskribita, sed ni ne rekonas " + "la a\305\255toritaton, kiu kontrolas la subskribon. Tio signifas ke la " + "nomo de la verkanto ne povas esti konfidata, kaj vi ne havas certan " + "scimanieron pri la vera verkanto de la aplika\304\265o.\n" + "\n" + "Ni rekomendas ke vi premas la butonon 'Nuligi' por eviti lan\304\211on " + "de \304\211i tiu aplika\304\265o.", + + // rus + "\320\243 \321\215\321\202\320\276\320\263\320\276 \320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\321\217 \320\265\321\201" + "\321\202\321\214 \320\277\320\276\320\264\320\277\320\270\321\201\321\214," + " \320\277\320\276 \320\272\320\276\321\202\320\276\321\200\320\276\320\271" + " \320\274\321\213 \320\275\320\265 \320\274\320\276\320\266\320\265" + "\320\274 \321\200\320\260\321\201\320\277\320\276\320\267\320\275\320\260" + "\321\202\321\214 \320\262\320\273\320\260\320\264\320\265\320\273\321\214" + "\321\206\320\260. \320\255\321\202\320\276 \320\276\320\267\320\275" + "\320\260\321\207\320\260\320\265\321\202, \321\207\321\202\320\276 " + "\320\270\320\274\321\217 \320\260\320\262\321\202\320\276\321\200\320\260 " + "\320\275\320\265 \320\274\320\276\320\266\320\265\321\202 \320\261\321\213" + "\321\202\321\214 \320\276\320\277\321\200\320\265\320\264\320\265\320\273" + "\320\265\320\275\320\276, \320\270 \320\275\320\265\320\262\320\276" + "\320\267\320\274\320\276\320\266\320\275\320\276 \321\202\320\276\321\207" + "\320\275\320\276 \321\203\320\267\320\275\320\260\321\202\321\214, " + "\320\272\321\202\320\276 \320\275\320\260\320\277\320\270\321\201\320\260" + "\320\273 \321\215\321\202\320\276 \320\277\321\200\320\270\320\273\320\276" + "\320\266\320\265\320\275\320\270\320\265.\n" + "\n" + "\320\234\321\213 \321\200\320\265\320\272\320\276\320\274\320\265\320\275" + "\320\264\321\203\320\265\320\274 \320\262\320\260\320\274 \320\275\320\260" + "\320\266\320\260\321\202\321\214 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +verified_cert_text[LI_COUNT] = { + // eng + "This Panda3D application has been signed by %s. " + "If you trust %s, then click the Run button below " + "to run this application on your computer. This will also " + "automatically approve this and any other applications signed by " + "%s in the future.\n" + "\n" + "If you are unsure about this application, " + "you should click Cancel instead.", + + // nld + "Deze Panda3D applicatie is ondertekend door %s. " + "Als u %s vertrouwt, klik dan de onderstaande knop Uitvoeren om de applicatie " + "op uw computer uit te voeren. Dit zal ook deze en andere door %s getekende " + "applicaties in het vervolg toestaan.\n" + "\n" + "Als u niet zeker bent over deze applicatie is het aanbevolen om op " + "Annuleren te klikken.", + + // deu + "Diese Panda3D-Anwendung wurde von %s signiert. Falls Sie %s vertrauen, " + "dr\303\274cken Sie den Starten-Knopf, um diese Anwendung auszuf\303\274hren. " + "Zudem werden in der Zukunft diese und alle anderen von %s signierten " + "Anwendungen automatisch als vertrauensw\303\274rdig anerkannt.\n" + "\n" + "Falls Sie sich unsicher \303\274ber diese Anwendung sind, sollten Sie " + "Abbrechen dr\303\274cken.", + + // spa + "Esta aplicaci\303\263n de Panda3D ha sido firmada por %s. Si se considera %s" + "de confianza el bot\303\263n inferior ejecutar\303\241 la aplicaci\303\263n." + "Esto validara esta y cualquier otra applizacion firmada por %s en el futuro.\n" + "\n" + "Si se duda de la aplicaci\303\263nse recomienda cancelar." + + // ita + "Questa applicazione Panda3D \303\250 stata firmata da %s. Se %s \303\250 " + "un'entit\303\240 fidata, allora clicca il bottone Lancia sottostante per " + "lanciare questa applicazione sul tuo computer. Inoltre, ci\303\262 " + "approver\303\240 automaticamente questa e ogni altra applicazione " + "firmata da %s in futuro.\n" + "\n" + "Se non sei sicuro circa questa applicazione, dovresti invece cliccare " + "su Cancella.", + + // epo + "\304\210i tiu aplika\304\265o estas subskribita de %s. " + "Se %s estas fidinda la\305\255 vi, premu la butonon 'Lan\304\211i' sube por " + "lan\304\211i \304\211i tiun aplika\304\265on per via komputilo. Anka\305\255 tio a\305\255tomate estonece " + "aprobos \304\211i tiun kaj alian ajn aplika\304\265on, kiu estas subskribita de %s.\n" + "\n" + "Se vi ne estas certa pri \304\211i tiu aplika\304\265o, " + "vi anstata\305\255e povus premi la butonon 'Nuligi'.", + + // rus + "\320\255\321\202\320\276 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\265 \320\277\320\276\320\264\320\277\320\270" + "\321\201\320\260\320\275\320\276 %s. " + "\320\225\321\201\320\273\320\270 \320\262\321\213 \320\264\320\276\320\262" + "\320\265\321\200\321\217\320\265\321\202\320\265 %s, \320\275\320\260" + "\320\266\320\274\320\270\321\202\320\265 \320\272\320\275\320\276\320\277" + "\320\272\321\203 \"\320\227\320\260\320\277\321\203\321\201\321\202" + "\320\270\321\202\321\214\" \320\262\320\275\320\270\320\267\321\203, " + "\321\207\321\202\320\276\320\261\321\213 \320\267\320\260\320\277\321\203" + "\321\201\321\202\320\270\321\202\321\214 \321\215\321\202\320\276 \320\277" + "\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270\320\265 " + "\320\275\320\260 \320\262\320\260\321\210\320\265\320\274 \320\272\320\276" + "\320\274\320\277\321\214\321\216\321\202\320\265\321\200\320\265. \320\255" + "\321\202\320\276 \321\202\320\260\320\272\320\266\320\265 \320\260\320\262" + "\321\202\320\276\320\274\320\260\321\202\320\270\321\207\320\265\321\201" + "\320\272\320\270 \320\277\320\276\320\264\321\202\320\262\320\265\321\200" + "\320\264\320\270\321\202 \321\215\321\202\320\276 \320\270 \320\264" + "\321\200\321\203\320\263\320\270\320\265 \320\277\321\200\320\270\320\273" + "\320\276\320\266\320\265\320\275\320\270\321\217, \320\275\320\260\320\277" + "\320\270\321\201\320\260\320\275\320\275\321\213\320\265 %s \320\262 " + "\320\261\321\203\320\264\321\203\321\211\320\265\320\274.\n" + "\n" + "\320\225\321\201\320\273\320\270 \320\262\321\213 \320\275\320\265 " + "\321\203\320\262\320\265\321\200\320\265\320\275\321\213 \320\262 \321\215" + "\321\202\320\276\320\274 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\270, \320\275\320\260\320\266\320\274\320\270" + "\321\202\320\265 \320\272\320\275\320\276\320\277\320\272\321\203 \"" + "\320\236\321\202\320\274\320\265\320\275\320\260\".", +}; + + +const char * +expired_cert_text[LI_COUNT] = { + // eng + "This Panda3D application has been signed by %s, " + "but the certificate has expired.\n" + "\n" + "You should check the current date set on your computer's clock " + "to make sure it is correct.\n" + "\n" + "If your computer's date is correct, we recommend " + "you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is ondertekend door %s, maar de geldigheidsdatum " + "van het certificaat is verstreken.\n" + "\n" + "Controleer de datum op uw computerklok om te zorgen dat deze juist is " + "ingesteld.\n" + "\n" + "Als de datum op uw computer juist is, is het aanbevolen om op Annuleren te " + "klikken om de applicatie af te sluiten.", + + // deu + "Diese Anwendung wurde von %s signiert, aber das Zertifikat ist abgelaufen.\n" + "\n" + "Sie sollten die aktuelle Uhrzeit auf Ihrem Computer " + "\303\274berpr\303\274fen, um sicherzugehen, dass sie korrekt ist.\n" + "\n" + "Falls die Uhrzeit auf Ihrem Computer korrekt ist, empfehlen wir Ihnen " + "Abbrechen zu dr\303\274cken.", + + // spa + "Esta aplicaci\303\263n Panda3D ha sido firmada por %s pero el certificado ha" + "caducado.\n" + "\n" + "Se recomienda comprobar la fecha del reloj.\n" + "\n" + "Si la fecha del reloj es correcta se recomienda cancelar.", + + // ita + "Questa applicazione Panda3D \303\250 stata firmata da %s, ma il " + "certificato \303\250 scaduto.\n" + "\n" + "Dovresti controllare la data attuale impostata nell'orologio del tuo " + "computer per assicurarti che sia corretta.\n" + "\n" + "Se la data del tuo computer \303\250 corretta, raccomandiamo di cliccare " + "Cancella per evitare di lanciare questa applicazione." + + // epo + "\304\210i tiu aplika\304\265o de Panda3D estas subskribita de %s, " + "sed la atesto eksvalidi\304\235is.\n" + "\n" + "Vi povus kontroli la aktualan daton, kiu estas agordata sur la horlo\304\235o de " + "via komputilo por certigi ke \304\235i estas korekta.\n" + "\n" + "Se la dato de via komputilo estas korekta, ni rekomendas ke vi premas la " + "butonon 'Nuligi' por eviti lan\304\211on de \304\211i tiu aplika\304\265o.", + + // rus + "\320\255\321\202\320\276 \320\277\321\200\320\270\320\273\320\276\320\266" + "\320\265\320\275\320\270\320\265 \320\277\320\276\320\264\320\277\320\270" + "\321\201\320\260\320\275\320\276 %s, \320\276\320\264\320\275\320\260" + "\320\272\320\276 \321\201\321\200\320\276\320\272 \320\264\320\265\320\271" + "\321\201\321\202\320\262\320\270\321\217 \321\201\320\265\321\200\321\202" + "\320\270\321\204\320\270\320\272\320\260\321\202\320\260 \320\270\321\201" + "\321\202\321\221\320\272.\n" + "\n" + "\320\237\321\200\320\276\320\262\320\265\321\200\321\214\321\202\320\265, " + "\320\277\320\276\320\266\320\260\320\273\321\203\320\271\321\201\321\202" + "\320\260, \320\264\320\260\321\202\321\203 \320\275\320\260 \320\262" + "\320\260\321\210\320\265\320\274 \320\272\320\276\320\274\320\277\321\214" + "\321\216\321\202\320\265\321\200\320\265.\n" + "\n" + "\320\225\321\201\320\273\320\270 \320\275\320\260 \320\262\320\260\321\210" + "\320\265\320\274 \320\272\320\276\320\274\320\277\321\214\321\216\321\202" + "\320\265\321\200\320\265 \321\203\321\201\321\202\320\260\320\275\320\276" + "\320\262\320\273\320\265\320\275\320\276 \320\277\321\200\320\260\320\262" + "\320\270\320\273\321\214\320\275\320\276\320\265 \320\262\321\200\320\265" + "\320\274\321\217, \320\274\321\213 \321\200\320\265\320\272\320\276" + "\320\274\320\265\320\275\320\264\321\203\320\265\320\274 \320\262\320\260" + "\320\274 \320\275\320\260\320\266\320\260\321\202\321\214 \320\272\320\275" + "\320\276\320\277\320\272\321\203 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +generic_error_cert_text[LI_COUNT] = { + // eng + "This Panda3D application has been signed, but there is a problem " + "with the certificate (OpenSSL error code %d).\n" + "\n" + "We recommend you click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is ondertekend, maar er is een probleem " + "met het certificaat opgetreden (OpenSSL foutcode %d).\n" + "\n" + "Het is aanbevolen om op Annuleren te klikken om de applicatie af te " + "sluiten.", + + // deu + "Diese Panda3D-Anwendung wurde signiert, aber es gibt ein Problem mit " + "dem Zertifikat (OpenSSL Fehlercode %d).\n" + "\n" + "Wir empfehlen, dass Sie Abbrechen dr\303\274cken um diese Anwendung nicht " + "auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D esta firmada pero hay un problema con el " + "certificado (Error de OpenSSL %d).\n" + "\n" + "Se recomienda cancelar para evitar ejecutar esta aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D \303\250 stata firmata, ma c'\303\250 un " + "problema col certificato (codice di errore OpenSSL %s).\n" + "\n" + "Raccomandiamo di cliccare su Cancella per evitare di lanciare questa " + "applicazione.", + + // epo + "\304\210i tiu aplika\304\265o de Panda3D estas subskribita, sed la " + "atesto havas problemon (OpenSSL erarkodo %d).\n" + "\n" + "Ni rekomendas ke vi premas la butonon 'Nuligi' por eviti lan\304\211on " + "de \304\211i tiu aplika\304\265o.", + + // rus + "\320\243 \321\215\321\202\320\276\320\263\320\276 \320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\321\217 \320\265\321\201" + "\321\202\321\214 \320\277\320\276\320\264\320\277\320\270\321\201\321\214," + " \320\275\320\276 \320\262\320\276\320\267\320\275\320\270\320\272\320\273" + "\320\260 \320\277\321\200\320\276\320\261\320\273\320\265\320\274\320\260 " + "\321\201 \321\201\320\265\321\200\321\202\320\270\321\204\320\270\320\272" + "\320\260\321\202\320\276\320\274 (\320\232\320\276\320\264 \320\276" + "\321\210\320\270\320\261\320\272\320\270 OpenSSL %d).\n" + "\n" + "\320\234\321\213 \321\200\320\265\320\272\320\276\320\274\320\265\320\275" + "\320\264\321\203\320\265\320\274 \320\262\320\260\320\274 \320\275\320\260" + "\320\266\320\260\321\202\321\214 \"\320\236\321\202\320\274\320\265" + "\320\275\320\260\" \320\270 \320\275\320\265 \320\267\320\260\320\277" + "\321\203\321\201\320\272\320\260\321\202\321\214 \321\215\321\202\320\276 " + "\320\277\321\200\320\270\320\273\320\276\320\266\320\265\320\275\320\270" + "\320\265.", +}; + + +const char * +no_cert_text[LI_COUNT] = { + "This Panda3D application has not been signed. This means you have " + "no way of knowing for sure who wrote it.\n" + "\n" + "Click Cancel to avoid running this application.", + + // nld + "Deze Panda3D applicatie is niet ondertekend. Dit betekent dat het niet " + "mogelijk is om de auteur te verifi\303\253ren.\n" + "\n" + "Klik op Annuleren om de applicatie af te sluiten.", + + // deu + "Diese Panda3D-Anwendung wurde nicht signiert. Es gibt keine " + "M\303\266glichkeit festzustellen, wer diese entwickelt hat.\n" + "\n" + "Dr\303\274cken Sie Abbrechen, um diese Anwendung nicht auszuf\303\274hren.", + + // spa + "Esta aplicaci\303\263n de Panda3D no esta firmada, no hay forma de conocer " + "quien la ha escrito.\n" + "\n" + "Cancelar para evitar ejecutar la aplicaci\303\263n.", + + // ita + "Questa applicazione Panda3D non \303\250 stata firmata. Ci\303\262 " + "significa che non hai modo di assicurarti circa chi la abbia scritta.\n" + "\n" + "Clicca Cancella per evitare di lanciare questa applicazione.", + + // epo + "\304\210i tiu aplika\304\265o de Panda3D ne estas subskribita. Tio " + "signifas ke vi ne havas certan scimanieron pri la vera verkanto de " + "la aplika\304\265o.\n" + "\n" + "Premu la butonon 'Nuligi' por eviti lan\304\211on de \304\211i tiu " + "aplika\304\265o.", + + // rus + "\320\243 \321\215\321\202\320\276\320\263\320\276 \320\277\321\200\320\270" + "\320\273\320\276\320\266\320\265\320\275\320\270\321\217 \320\275\320\265" + "\321\202 \320\277\320\276\320\264\320\277\320\270\321\201\320\270. " + "\320\255\321\202\320\276 \320\276\320\267\320\275\320\260\321\207\320\260" + "\320\265\321\202, \321\207\321\202\320\276 \320\262\321\213 \320\275" + "\320\265 \320\274\320\276\320\266\320\265\321\202\320\265 \320\267\320\275" + "\320\260\321\202\321\214, \320\272\321\202\320\276 \320\265\320\263" + "\320\276 \320\275\320\260\320\277\320\270\321\201\320\260\320\273.\n" + "\n" + "\320\235\320\260\320\266\320\274\320\270\321\202\320\265 \"\320\236" + "\321\202\320\274\320\265\320\275\320\260\", \321\207\321\202\320\276" + "\320\261\321\213 \320\275\320\265 \320\267\320\260\320\277\321\203\321\201" + "\320\272\320\260\321\202\321\214 \320\277\321\200\320\270\320\273\320\276" + "\320\266\320\265\320\275\320\270\320\265.", +}; diff --git a/direct/src/plugin/p3dCert_strings.h b/direct/src/plugin/p3dCert_strings.h new file mode 100644 index 0000000000..064a04360e --- /dev/null +++ b/direct/src/plugin/p3dCert_strings.h @@ -0,0 +1,45 @@ +// Filename: p3dCert_strings.h +// Created by: rdb (25Mar15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +enum LanguageIndex { + LI_en, // English + LI_nl, // Dutch + LI_de, // German + LI_es, // Spanish + LI_it, // Italian + LI_eo, // Esperanto + LI_ru, // Russian + LI_COUNT, + + LI_default = LI_en +}; + +extern const char *language_codes[LI_COUNT]; +extern const unsigned char language_ids[LI_COUNT]; + +extern const char *run_title[LI_COUNT]; +extern const char *cancel_title[LI_COUNT]; +extern const char *show_cert_title[LI_COUNT]; + +extern const char *new_application_title[LI_COUNT]; +extern const char *no_cert_title[LI_COUNT]; +extern const char *unverified_cert_title[LI_COUNT]; +extern const char *expired_cert_title[LI_COUNT]; + +extern const char *self_signed_cert_text[LI_COUNT]; +extern const char *unknown_auth_cert_text[LI_COUNT]; +extern const char *verified_cert_text[LI_COUNT]; +extern const char *expired_cert_text[LI_COUNT]; +extern const char *generic_error_cert_text[LI_COUNT]; +extern const char *no_cert_text[LI_COUNT]; diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index 27361a8d85..0c2f13e4a8 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -891,11 +891,13 @@ start_p3dpython(P3DInstance *inst) { // These are the enviroment variables we forward from the current // environment, if they are set. const char *keep[] = { - "HOME", "USER", + "HOME", "USER", #ifdef _WIN32 "SYSTEMROOT", "USERPROFILE", "COMSPEC", "SYSTEMDRIVE", "ALLUSERSPROFILE", "APPDATA", "COMMONPROGRAMFILES", "PROGRAMFILES", "WINDIR", "PROGRAMDATA", "USERDOMAIN", +#else + "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG", #endif #ifdef HAVE_X11 "DISPLAY", "XAUTHORITY", diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 64c624100d..6e3f367be3 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -4915,9 +4915,11 @@ if (RTDIST or RUNTIME): if (PkgSkip("FLTK")==0): OPTS.append("FLTK") TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx') + TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx') TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj') TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj') + TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj') OPTS=['OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS'] if GetTarget() == 'darwin': OPTS += ['OPT:2'] From 58963a167c04cf62e394963e739ce9e02aeaec62 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 11 Sep 2015 15:43:22 +0200 Subject: [PATCH 173/203] Implement user preferred language detection on Mac --- direct/src/plugin/p3dCert.cxx | 46 ++++++++++++++++++++++++++- direct/src/plugin/p3dCert_strings.cxx | 7 ++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index 8d78ff7485..6fa6c7d3e6 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -42,8 +42,51 @@ #define snprintf sprintf_s #endif +#ifdef __APPLE__ +#include +#endif + static LanguageIndex li = LI_default; +#ifdef __APPLE__ +static LanguageIndex detect_language() { + // Get and iterate through the list of preferred languages. + CFArrayRef langs = CFLocaleCopyPreferredLanguages(); + CFIndex num_langs = CFArrayGetCount(langs); + + for (long i = 0; i < num_langs; ++i) { + CFStringRef lang = (CFStringRef)CFArrayGetValueAtIndex(langs, i); + + CFIndex length = CFStringGetLength(lang); + if (length < 2) { + continue; + } + + CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1; + char *buffer = (char *)alloca(max_size); + if (!CFStringGetCString(lang, buffer, max_size, kCFStringEncodingUTF8)) { + continue; + } + + if (isalnum(buffer[2])) { + // It's not a two-letter code. + continue; + } + + // See if we support this language. + for (int j = 0; j < LI_COUNT; ++j) { + const char *lang_code = language_codes[j]; + if (lang_code != NULL && strncasecmp(buffer, lang_code, 2) == 0) { + CFRelease(langs); + return (LanguageIndex)j; + } + } + } + + CFRelease(langs); + return LI_default; +} +#else static LanguageIndex detect_language() { // First consult the LANGUAGE variable, which is a GNU extension that can // contain multiple languages in order of preference. @@ -94,6 +137,7 @@ static LanguageIndex detect_language() { } return LI_default; } +#endif #ifdef _WIN32 int WINAPI @@ -153,7 +197,7 @@ AuthDialog(const wstring &cert_filename, const wstring &cert_dir) : AuthDialog:: AuthDialog(const string &cert_filename, const string &cert_dir) : #endif - Fl_Window(435, 242, "New Panda3D Application"), + Fl_Window(435, 242, new_application_title[li]), _cert_dir(cert_dir) { _view_cert_dialog = NULL; diff --git a/direct/src/plugin/p3dCert_strings.cxx b/direct/src/plugin/p3dCert_strings.cxx index e33f2adba9..1f111cd645 100644 --- a/direct/src/plugin/p3dCert_strings.cxx +++ b/direct/src/plugin/p3dCert_strings.cxx @@ -323,8 +323,9 @@ verified_cert_text[LI_COUNT] = { // epo "\304\210i tiu aplika\304\265o estas subskribita de %s. " "Se %s estas fidinda la\305\255 vi, premu la butonon 'Lan\304\211i' sube por " - "lan\304\211i \304\211i tiun aplika\304\265on per via komputilo. Anka\305\255 tio a\305\255tomate estonece " - "aprobos \304\211i tiun kaj alian ajn aplika\304\265on, kiu estas subskribita de %s.\n" + "lan\304\211i \304\211i tiun aplika\304\265on per via komputilo. Anka\305\255 " + "tio a\305\255tomate estonece aprobos \304\211i tiun kaj alian ajn " + "aplika\304\265on, kiu estas subskribita de %s.\n" "\n" "Se vi ne estas certa pri \304\211i tiu aplika\304\265o, " "vi anstata\305\255e povus premi la butonon 'Nuligi'.", @@ -546,7 +547,7 @@ no_cert_text[LI_COUNT] = { // epo "\304\210i tiu aplika\304\265o de Panda3D ne estas subskribita. Tio " - "signifas ke vi ne havas certan scimanieron pri la vera verkanto de " + "signifas ke vi ne havas certan scimanieron pri la vera verkanto de " "la aplika\304\265o.\n" "\n" "Premu la butonon 'Nuligi' por eviti lan\304\211on de \304\211i tiu " From c9a45f288c4ae4f760e420780e86d31469b21ea3 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 11 Sep 2015 17:32:49 +0200 Subject: [PATCH 174/203] Proper display language detection on Windows --- direct/src/plugin/p3dCert.cxx | 56 ++++++++++++++++++++++++++- direct/src/plugin/p3dCert_strings.cxx | 2 +- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index 6fa6c7d3e6..0d84e1058e 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -38,6 +38,7 @@ #define WIN32_LEAN_AND_MEAN #include #include +#include #define snprintf sprintf_s #endif @@ -48,7 +49,51 @@ static LanguageIndex li = LI_default; -#ifdef __APPLE__ +#if defined(_WIN32) +static LanguageIndex detect_language() { + // This function was introduced in Windows Vista; it may not be available + // on older systems. + typedef BOOL (*GUPL)(DWORD, PULONG, PZZWSTR, PULONG); + GUPL pGetUserPreferredUILanguages = (GUPL)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), + TEXT("GetUserPreferredUILanguages")); + if (pGetUserPreferredUILanguages != NULL) { + ULONG num_langs = 0; + ULONG buffer_size = 0; + pGetUserPreferredUILanguages(8, &num_langs, NULL, &buffer_size); + PZZWSTR buffer = (PZZWSTR)_alloca(buffer_size); + if (pGetUserPreferredUILanguages(8, &num_langs, buffer, &buffer_size)) { + for (ULONG i = 0; i < num_langs; ++i) { + size_t len = wcslen(buffer); + if (len >= 2 && (buffer[2] == 0 || buffer[2] == L'-')) { + // It may be a two-letter code; match it in our list. + for (int j = 0; j < LI_COUNT; ++j) { + const char *lang_code = language_codes[j]; + if (lang_code != NULL && lang_code[0] == buffer[0] && + lang_code[1] == buffer[1]) { + return (LanguageIndex)j; + } + } + } + buffer += len + 1; + } + } + } + + // Fall back to the old Windows XP function. + LANGID lang = GetUserDefaultUILanguage() & 0x3ff; + if (lang == 0) { + return LI_default; + } + + for (int i = 0; i < LI_COUNT; ++i) { + if (language_ids[i] != 0 && language_ids[i] == lang) { + return (LanguageIndex)i; + } + } + return LI_default; +} + +#elif defined(__APPLE__) static LanguageIndex detect_language() { // Get and iterate through the list of preferred languages. CFArrayRef langs = CFLocaleCopyPreferredLanguages(); @@ -86,6 +131,7 @@ static LanguageIndex detect_language() { CFRelease(langs); return LI_default; } + #else static LanguageIndex detect_language() { // First consult the LANGUAGE variable, which is a GNU extension that can @@ -364,12 +410,20 @@ read_cert_file(const string &cert_filename) { #endif // _WIN32 if (fp == NULL) { +#ifdef _WIN32 + wcerr << L"Couldn't read " << cert_filename.c_str() << L"\n"; +#else cerr << "Couldn't read " << cert_filename.c_str() << "\n"; +#endif return; } _cert = PEM_read_X509(fp, NULL, NULL, (void *)""); if (_cert == NULL) { +#ifdef _WIN32 + wcerr << L"Could not read certificate in " << cert_filename.c_str() << L".\n"; +#else cerr << "Could not read certificate in " << cert_filename.c_str() << ".\n"; +#endif fclose(fp); return; } diff --git a/direct/src/plugin/p3dCert_strings.cxx b/direct/src/plugin/p3dCert_strings.cxx index 1f111cd645..bd191768e0 100644 --- a/direct/src/plugin/p3dCert_strings.cxx +++ b/direct/src/plugin/p3dCert_strings.cxx @@ -27,7 +27,7 @@ const char *language_codes[LI_COUNT] = // https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693%28v=vs.85%29.aspx const unsigned char language_ids[LI_COUNT] = - {0x09, 0x13, 0x07, 0x0A, 0x10, 0, 0x19}; + {0x09, 0x13, 0x07, 0x0A, 0x10, 0x8F, 0x19}; const char * run_title[LI_COUNT] = { From bed4fdd5af90fb50a39d6918cca656024e39bbca Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 11 Sep 2015 19:13:30 +0200 Subject: [PATCH 175/203] Fix issue that caused pdeploy to spit out broken win32 installer alongside win_i386 installer --- direct/src/p3d/DeploymentTools.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 78b2378eda..e55edc1d76 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -99,6 +99,9 @@ class Standalone: if len(platforms) == 0: Standalone.notify.warning("No platforms found to build for!") + if 'win32' in platforms and 'win_i386' in platforms: + platforms.remove('win32') + outputDir = Filename(outputDir + "/") outputDir.makeDir() for platform in platforms: @@ -669,6 +672,9 @@ class Installer: if len(platforms) == 0: Installer.notify.warning("No platforms found to build for!") + if 'win32' in platforms and 'win_i386' in platforms: + platforms.remove('win32') + outputDir = Filename(outputDir + "/") outputDir.makeDir() for platform in platforms: From 6fce996cebd50c386c8949e557ce8ab7e3c6cf01 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 15 Sep 2015 17:15:12 +0200 Subject: [PATCH 176/203] Add 'ast' module to morepy package --- direct/src/p3d/panda3d.pdef | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/p3d/panda3d.pdef b/direct/src/p3d/panda3d.pdef index 87a42eff2b..beac7049b5 100644 --- a/direct/src/p3d/panda3d.pdef +++ b/direct/src/p3d/panda3d.pdef @@ -195,7 +195,7 @@ class morepy(package): 'termios', 'tty', 'pty', 'fcntl', 'pipes', 'posixfile', 'resource', 'nis', 'syslog', 'commands', 'ic', 'MacOS', 'macostools', 'findertools', 'EasyDialogs', 'FrameWork', - 'autoGIL', 'ColorPicker') + 'autoGIL', 'ColorPicker', 'ast') # To add the multitude of standard Python string encodings. module('encodings', 'encodings.*') From 5736e7a4b07fc4ef2f3719f42b4807356c67f011 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 18 Sep 2015 21:19:09 +0200 Subject: [PATCH 177/203] Fix crash when passing None to Filename constructor --- dtool/src/dtoolutil/filename.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dtool/src/dtoolutil/filename.h b/dtool/src/dtoolutil/filename.h index 650f7d84a6..f01d03483e 100644 --- a/dtool/src/dtoolutil/filename.h +++ b/dtool/src/dtoolutil/filename.h @@ -60,10 +60,11 @@ public: F_pattern = 0x40, }; + INLINE Filename(const char *filename); + PUBLISHED: INLINE Filename(const string &filename = ""); INLINE Filename(const wstring &filename); - INLINE Filename(const char *filename); INLINE Filename(const Filename ©); Filename(const Filename &dirname, const Filename &basename); INLINE ~Filename(); From 445c3461d66745b8c7fbb18f1888ff2b5c777237 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 18 Sep 2015 21:20:25 +0200 Subject: [PATCH 178/203] Python 3 support to rtdist, reimplement VFS open() on top of io.IOBase, allow freezing into .c target, make VFSImporter and friends frozen into p3dpython --- direct/src/p3d/AppRunner.py | 30 +- direct/src/p3d/HostInfo.py | 23 +- direct/src/p3d/PackageInfo.py | 4 +- direct/src/p3d/Packager.py | 65 ++-- direct/src/p3d/packp3d.py | 4 +- direct/src/p3d/panda3d.pdef | 2 +- direct/src/plugin/p3dPythonRun.cxx | 62 ++- direct/src/showbase/VFSImporter.py | 56 ++- direct/src/showutil/FreezeTool.py | 141 ++++--- direct/src/showutil/pfreeze.py | 49 ++- direct/src/stdpy/file.py | 362 ++++++++---------- dtool/src/prc/streamReader.cxx | 41 +- dtool/src/prc/streamReader.h | 8 +- makepanda/makepanda.py | 42 +- panda/src/express/p3express_ext_composite.cxx | 1 + panda/src/express/ramfile.h | 13 +- panda/src/express/ramfile_ext.cxx | 57 +++ panda/src/express/ramfile_ext.h | 6 +- panda/src/express/streamReader_ext.cxx | 68 +++- panda/src/express/streamReader_ext.h | 3 + panda/src/express/virtualFile.h | 7 +- panda/src/express/virtualFile_ext.cxx | 83 ++++ panda/src/express/virtualFile_ext.h | 42 ++ 23 files changed, 725 insertions(+), 444 deletions(-) create mode 100644 panda/src/express/virtualFile_ext.cxx create mode 100644 panda/src/express/virtualFile_ext.h diff --git a/direct/src/p3d/AppRunner.py b/direct/src/p3d/AppRunner.py index 64bc774d9c..68443e4601 100644 --- a/direct/src/p3d/AppRunner.py +++ b/direct/src/p3d/AppRunner.py @@ -13,22 +13,9 @@ __all__ = ["AppRunner", "dummyAppRunner", "ArgumentError"] import sys import os -import __builtin__ - -if 'VFSImporter' in sys.modules: - # If we've already got a VFSImporter module defined at the - # toplevel, we must have come in here by way of the - # p3dPythonRun.cxx program, which starts out by importing a frozen - # VFSImporter. Let's make sure we don't have two VFSImporter - # modules. - import VFSImporter - import direct.showbase - direct.showbase.VFSImporter = VFSImporter - sys.modules['direct.showbase.VFSImporter'] = VFSImporter -else: - # Otherwise, we can import the VFSImporter normally. - from direct.showbase import VFSImporter +import __builtin__ as builtins +from direct.showbase import VFSImporter from direct.showbase.DirectObject import DirectObject from panda3d.core import VirtualFileSystem, Filename, Multifile, loadPrcFileData, unloadPrcFile, getModelPath, WindowProperties, ExecutionEnvironment, PandaSystem, Notify, StreamWriter, ConfigVariableString, ConfigPageManager from panda3d.direct import init_app_for_gui @@ -570,14 +557,14 @@ class AppRunner(DirectObject): for packageData in hostData.packages: totalSize += packageData.totalSize self.notify.info("Total Panda3D disk space used: %s MB" % ( - (totalSize + 524288) / 1048576)) + (totalSize + 524288) // 1048576)) if self.verifyContents == self.P3DVCNever: # We're not allowed to delete anything anyway. return self.notify.info("Configured max usage is: %s MB" % ( - (self.maxDiskUsage + 524288) / 1048576)) + (self.maxDiskUsage + 524288) // 1048576)) if totalSize <= self.maxDiskUsage: # Still within budget; no need to clean up anything. return @@ -638,7 +625,7 @@ class AppRunner(DirectObject): except SystemExit as err: # Presumably the window has already been shut down here, but shut # it down again for good measure. - if hasattr(__builtin__, "base"): + if hasattr(builtins, "base"): base.destroy() self.notify.info("Normal exit with status %s." % repr(err.code)) @@ -697,9 +684,10 @@ class AppRunner(DirectObject): # Replace the builtin open and file symbols so user code will get # our versions by default, which can open and read files out of # the multifile. - __builtin__.file = file.file - __builtin__.open = file.open - __builtin__.execfile = file.execfile + builtins.open = file.open + if sys.version_info < (3, 0): + builtins.file = file.open + builtins.execfile = file.execfile os.listdir = file.listdir os.walk = file.walk os.path.join = file.join diff --git a/direct/src/p3d/HostInfo.py b/direct/src/p3d/HostInfo.py index 82fa5001cd..da5d9723c4 100644 --- a/direct/src/p3d/HostInfo.py +++ b/direct/src/p3d/HostInfo.py @@ -161,14 +161,14 @@ class HostInfo: self.notify.info("Downloading contents file %s" % (request)) statusCode = None statusString = '' - for attempt in range(ConfigVariableInt('contents-xml-dl-attempts', 3)): + for attempt in range(int(ConfigVariableInt('contents-xml-dl-attempts', 3))): if attempt > 0: self.notify.info("Retrying (%s)..."%(attempt,)) rf = Ramfile() channel = http.makeChannel(False) channel.getDocument(request) if channel.downloadToRam(rf): - self.notify.warning("Successfully downloaded %s" % (url,)) + self.notify.info("Successfully downloaded %s" % (url,)) break else: rf = None @@ -369,7 +369,7 @@ class HostInfo: assert self.hostDir self.__findHostXmlForHostDir(xcontents) - if not self.hostDir: + if self.rootDir and not self.hostDir: self.hostDir = self.__determineHostDir(None, self.hostUrl) # Get the list of packages available for download and/or import. @@ -403,7 +403,7 @@ class HostInfo: self.hasContentsFile = True # Now save the contents.xml file into the standard location. - if not self.appRunner or self.appRunner.verifyContents != self.appRunner.P3DVCNever: + if self.appRunner and self.appRunner.verifyContents != self.appRunner.P3DVCNever: assert self.hostDir filename = Filename(self.hostDir, 'contents.xml') filename.makeDir() @@ -476,7 +476,7 @@ class HostInfo: self.descriptiveName = descriptiveName hostDirBasename = xhost.Attribute('host_dir') - if not self.hostDir: + if self.rootDir and not self.hostDir: self.hostDir = self.__determineHostDir(hostDirBasename, self.hostUrl) # Get the "download" URL, which is the source from which we @@ -514,8 +514,9 @@ class HostInfo: if not platform: # Ensure that we're on the same page with non-specified - # platforms. We always use None, not empty string. - platform = None + # platforms. We have to use the empty string, not None, + # since Python 3 can't sort lists with both strings and None. + platform = "" platforms = self.packages.setdefault((name, version), {}) package = platforms.get(platform, None) @@ -581,14 +582,12 @@ class HostInfo: result = [] - items = self.packages.items() - items.sort() + items = sorted(self.packages.items()) for key, platforms in items: if self.perPlatform or includeAllPlatforms: # If we maintain a different answer per platform, # return all of them. - pitems = platforms.items() - pitems.sort() + pitems = sorted(platforms.items()) for pkey, package in pitems: result.append(package) else: @@ -701,7 +700,7 @@ class HostInfo: # If we successfully got a hostname, we don't really need the # full hash. We'll keep half of it. - keepHash = keepHash / 2; + keepHash = keepHash // 2 md = HashVal() md.hashString(hostUrl) diff --git a/direct/src/p3d/PackageInfo.py b/direct/src/p3d/PackageInfo.py index cceb2164c6..b48392dd28 100644 --- a/direct/src/p3d/PackageInfo.py +++ b/direct/src/p3d/PackageInfo.py @@ -277,7 +277,7 @@ class PackageInfo: # We've already got one. yield self.stepComplete; return - if self.host.appRunner and self.host.appRunner.verifyContents != self.host.appRunner.P3DVCNever: + if not self.host.appRunner or self.host.appRunner.verifyContents != self.host.appRunner.P3DVCNever: # We're allowed to download it. self.http = http @@ -1151,7 +1151,7 @@ class PackageInfo: thisDir = ScanDirectoryNode(self.getPackageDir(), ignoreUsageXml = True) diskSpace = thisDir.getTotalSize() self.notify.info("Package %s uses %s MB" % ( - self.packageName, (diskSpace + 524288) / 1048576)) + self.packageName, (diskSpace + 524288) // 1048576)) return diskSpace def markUsed(self): diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index 4d65d80937..791bad6b8e 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -186,7 +186,7 @@ class Packager: def getKey(self): """ Returns a tuple used for sorting the PackageEntry objects uniquely per package. """ - return (self.packageName, self.platform, self.version) + return (self.packageName, self.platform or "", self.version or "") def fromFile(self, packageName, platform, version, solo, perPlatform, installDir, descFilename, importDescFilename): @@ -300,8 +300,7 @@ class Packager: xhost.InsertEndChild(xmirror) if packager: - altHosts = self.altHosts.items() - altHosts.sort() + altHosts = sorted(self.altHosts.items()) for keyword, alt in altHosts: he = packager.hosts.get(alt, None) if he: @@ -393,8 +392,7 @@ class Packager: raise PackagerError, message if self.ignoredDirFiles: - exts = list(self.ignoredDirFiles.keys()) - exts.sort() + exts = sorted(self.ignoredDirFiles.keys()) total = sum([x for x in self.ignoredDirFiles.values()]) self.notify.warning("excluded %s files not marked for inclusion: %s" \ % (total, ", ".join(["'" + ext + "'" for ext in exts]))) @@ -590,8 +588,7 @@ class Packager: # Add known module names. self.moduleNames = {} - modules = self.freezer.modules.items() - modules.sort() + modules = sorted(self.freezer.modules.items()) for newName, mdef in modules: if mdef.guess: # Not really a module. @@ -2766,11 +2763,15 @@ class Packager: # errors, and that the pdef file doesn't contain any really # crazy Python code, all this will do is fill in the # '__statements' list in the module scope. + fn = packageDef.toOsSpecific() + f = open(fn) + code = compile(f.read(), fn, 'exec') + f.close() # It appears that having a separate globals and locals # dictionary causes problems with resolving symbols within a # class scope. So, we just use one dictionary, the globals. - execfile(packageDef.toOsSpecific(), globals) + exec(code, globals) packages = [] @@ -3351,42 +3352,27 @@ class Packager: producing their own custom panda3d for download. Should be called before any other Python modules are named. """ - # First, freeze just VFSImporter.py into its own - # _vfsimporter.pyd file. This one is a special case, because - # we need this code in order to load python files from the - # Multifile, so this file can't itself be in the Multifile. + # This module and all its dependencies come frozen into p3dpython. + # We should mark them as having already been added so that we don't + # add them again to the Multifile. + self.do_module('direct.showbase.VFSImporter') + self.currentPackage.freezer.done(addStartupModules=True) + self.currentPackage.freezer.writeCode(None) + self.currentPackage.addExtensionModules() + self.currentPackage.freezer.reset() - # This requires a bit of care, because we only want to freeze - # VFSImporter.py, and not any other part of direct. We do - # also want panda3d/__init__.py, though, since it would - # otherwise be part of the multifile. - self.do_excludeModule('direct') - - # Import the actual VFSImporter module to get its filename on - # disk. - from direct.showbase import VFSImporter - filename = Filename.fromOsSpecific(VFSImporter.__file__) - - self.do_module('VFSImporter', filename = filename) - self.do_freeze('_vfsimporter', compileToExe = False) - - self.do_file('panda3d/_core.pyd'); - - # Now that we're done freezing, explicitly add 'direct' to - # counteract the previous explicit excludeModule(). - self.do_module('direct') + self.do_file('panda3d/_core.pyd', newDir='panda3d') # This is the key Python module that is imported at runtime to # start an application running. self.do_module('direct.p3d.AppRunner') # This is the main program that drives the runtime Python. It - # is responsible for loading _vfsimporter.pyd, and then - # importing direct.p3d.AppRunner, to start an application - # running. The program comes in two parts: an executable, and - # an associated dynamic library. Note that the .exe and .dll - # extensions are automatically replaced with the appropriate - # platform-specific extensions. + # is responsible for importing direct.p3d.AppRunner to start an + # application running. The program comes in two parts: an + # executable, and an associated dynamic library. Note that the + # .exe and .dll extensions are automatically replaced with the + # appropriate platform-specific extensions. if self.platform.startswith('osx'): # On Mac, we package up a P3DPython.app bundle. This @@ -3469,7 +3455,7 @@ class Packager: freezer.addModule(moduleName, newName = newName) else: freezer.modules[newName] = freezer.modules[moduleName] - freezer.done(compileToExe = compileToExe) + freezer.done(addStartupModules = compileToExe) dirname = '' basename = filename @@ -3850,8 +3836,7 @@ class Packager: xhost = he.makeXml(packager = self) xcontents.InsertEndChild(xhost) - contents = self.contents.items() - contents.sort() + contents = sorted(self.contents.items()) for key, pe in contents: xpackage = pe.makeXml() xcontents.InsertEndChild(xpackage) diff --git a/direct/src/p3d/packp3d.py b/direct/src/p3d/packp3d.py index 53a703b5eb..e1cebf2137 100755 --- a/direct/src/p3d/packp3d.py +++ b/direct/src/p3d/packp3d.py @@ -164,10 +164,10 @@ def makePackedApp(args): PandaSystem.getPackageHostUrl(), os.path.split(sys.argv[0])[1], '%s.%s' % (sys.version_info[0], sys.version_info[1])) - sys.exit(1) + sys.exit(0) if not appFilename: - raise ArgumentError, "No target app specified. Use:\n%s -o app.p3d" % (os.path.split(sys.argv[0])[1]) + raise ArgumentError, "No target app specified. Use:\n %s -o app.p3d\nUse -h to get more usage information." % (os.path.split(sys.argv[0])[1]) if args: raise ArgumentError, "Extra arguments on command line." diff --git a/direct/src/p3d/panda3d.pdef b/direct/src/p3d/panda3d.pdef index 87a42eff2b..d298e0e3c1 100644 --- a/direct/src/p3d/panda3d.pdef +++ b/direct/src/p3d/panda3d.pdef @@ -61,7 +61,7 @@ class panda3d(package): 'panda3d.physics') # Include various standard Python encodings. The rest is in morepy. - module('encodings', 'encodings.aliases', 'encodings.undefined,' + module('encodings', 'encodings.aliases', 'encodings.undefined', 'encodings.utf_8', 'encodings.ascii', 'encodings.string_escape', 'encodings.mbcs', 'encodings.latin_1', 'io') diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 28f004933f..459d1015ce 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -21,6 +21,9 @@ #include "py_panda.h" +// This has been compiled-in by the build system, if all is well. +extern struct _frozen _PyImport_FrozenModules[]; + // There is only one P3DPythonRun object in any given process space. // Makes the statics easier to deal with, and we don't need multiple // instances of this thing. @@ -85,17 +88,30 @@ P3DPythonRun(const char *program_name, const char *archive_file, // Turn off the automatic load of site.py at startup. extern int Py_NoSiteFlag; Py_NoSiteFlag = 1; + Py_NoUserSiteDirectory = 1; + + // Tell Python not to write bytecode files for loaded modules. + Py_DontWriteBytecodeFlag = 1; + + // Prevent Python from complaining about finding the standard modules. + Py_FrozenFlag = 1; + + // This contains the modules we need in order to call Py_Initialize, + // as well as the VFSImporter. + PyImport_FrozenModules = _PyImport_FrozenModules; // Initialize Python. It appears to be important to do this before // we open the pipe streams and spawn the thread, below. #if PY_MAJOR_VERSION >= 3 Py_SetProgramName((wchar_t *)_program_name.c_str()); + Py_SetPythonHome((wchar_t *)L""); #else Py_SetProgramName((char *)_program_name.c_str()); + Py_SetPythonHome((char *)""); #endif Py_Initialize(); PyEval_InitThreads(); - PySys_SetArgv(_py_argc, _py_argv); + PySys_SetArgvEx(_py_argc, _py_argv, 0); // Open the error output before we do too much more. if (log_pathname != NULL && *log_pathname != '\0') { @@ -170,38 +186,44 @@ run_python() { // setting __path__ of frozen modules properly. PyObject *panda3d_module = PyImport_AddModule("panda3d"); if (panda3d_module == NULL) { - nout << "Failed to create panda3d module:\n"; + nout << "Failed to add panda3d module:\n"; PyErr_Print(); return 1; } - // Set the __path__ such that it can find panda3d/core.pyd, etc. + // Set the __path__ such that it can find panda3d/_core.pyd, etc. Filename panda3d_dir(dir, "panda3d"); string dir_str = panda3d_dir.to_os_specific(); - PyObject *panda3d_dict = PyModule_GetDict(panda3d_module); - PyObject *panda3d_path = Py_BuildValue("[s#]", dir_str.data(), dir_str.length()); - PyDict_SetItemString(panda3d_dict, "__path__", panda3d_path); - Py_DECREF(panda3d_path); + PyModule_AddObject(panda3d_module, "__path__", Py_BuildValue("[s#]", dir_str.data(), dir_str.length())); + PyModule_AddStringConstant(panda3d_module, "__package__", "panda3d"); - // Now we can load _vfsimporter.pyd. Since this is a magic frozen - // pyd, importing it automatically makes all of its frozen contents - // available to import as well. - PyObject *vfsimporter = PyImport_ImportModule("_vfsimporter"); - if (vfsimporter == NULL) { - nout << "Failed to import _vfsimporter:\n"; - PyErr_Print(); - return 1; - } - Py_DECREF(vfsimporter); - - // And now we can import the VFSImporter module that was so defined. - PyObject *vfsimporter_module = PyImport_ImportModule("VFSImporter"); + // Import the VFSImporter module that was frozen in. + PyObject *vfsimporter_module = PyImport_ImportModule("direct.showbase.VFSImporter"); if (vfsimporter_module == NULL) { nout << "Failed to import VFSImporter:\n"; PyErr_Print(); return 1; } + // Now repair the "direct" and "direct.showbase" trees, which were + // presumably frozen along with the VFSImporter, by setting their + // __path__ such that we can still find the other direct modules. + Filename direct_dir(dir, "direct"); + PyObject *direct_module = PyImport_AddModule("direct"); + if (direct_module != NULL) { + dir_str = direct_dir.to_os_specific(); + PyModule_AddObject(direct_module, "__path__", Py_BuildValue("[s#]", dir_str.data(), dir_str.length())); + PyModule_AddStringConstant(direct_module, "__package__", "direct"); + } + + PyObject *showbase_module = PyImport_AddModule("direct.showbase"); + if (showbase_module != NULL) { + Filename showbase_dir(direct_dir, "showbase"); + dir_str = showbase_dir.to_os_specific(); + PyModule_AddObject(showbase_module, "__path__", Py_BuildValue("[s#]", dir_str.data(), dir_str.length())); + PyModule_AddStringConstant(showbase_module, "__package__", "direct.showbase"); + } + // And register the VFSImporter. PyObject *result = PyObject_CallMethod(vfsimporter_module, (char *)"register", (char *)""); if (result == NULL) { diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index 16b1ac4bec..e7be781c45 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -136,7 +136,7 @@ class VFSLoader: code = self._read_code() if not code: - raise ImportError, 'No Python code in %s' % (fullname) + raise ImportError('No Python code in %s' % (fullname)) mod = sys.modules.setdefault(fullname, imp.new_module(fullname)) mod.__file__ = self.filename.toOsSpecific() @@ -230,6 +230,10 @@ class VFSLoader: #print >>sys.stderr, "importing frozen %s" % (fullname) module = imp.load_module(fullname, None, fullname, ('', '', imp.PY_FROZEN)) + + # Workaround for bug in Python 2. + if getattr(module, '__path__', None) == fullname: + module.__path__ = [] return module def _read_code(self): @@ -243,7 +247,7 @@ class VFSLoader: pycVfile = vfs.getFile(self.filename, False) if pycVfile: return self._loadPyc(pycVfile, None) - raise IOError, 'Could not read %s' % (self.filename) + raise IOError('Could not read %s' % (self.filename)) elif self.fileType == FTExtensionModule: return None @@ -281,16 +285,21 @@ class VFSLoader: code = None data = vfile.readFile(True) - if data[:4] == imp.get_magic(): + if data[:4] != imp.get_magic(): + raise ValueError("Bad magic number in %s" % (vfile)) + + if sys.version_info >= (3, 0): + t = int.from_bytes(data[4:8], 'little') + data = data[12:] + else: t = ord(data[4]) + (ord(data[5]) << 8) + \ (ord(data[6]) << 16) + (ord(data[7]) << 24) - if not timestamp or t == timestamp: - code = marshal.loads(data[8:]) - else: - raise ValueError, 'Timestamp wrong on %s' % (vfile) + data = data[8:] + + if not timestamp or t == timestamp: + return marshal.loads(data) else: - raise ValueError, 'Bad magic number in %s' % (vfile) - return code + raise ValueError("Timestamp wrong on %s" % (vfile)) def _compile(self, filename, source): @@ -310,15 +319,16 @@ class VFSLoader: except IOError: pass else: - f.write('\0\0\0\0') - f.write(chr(self.timestamp & 0xff) + - chr((self.timestamp >> 8) & 0xff) + - chr((self.timestamp >> 16) & 0xff) + - chr((self.timestamp >> 24) & 0xff)) - f.write(marshal.dumps(code)) - f.flush() - f.seek(0, 0) f.write(imp.get_magic()) + if sys.version_info >= (3, 0): + f.write((self.timestamp & 0xffffffff).to_bytes(4, 'little')) + f.write(b'\0\0\0\0') + else: + f.write(chr(self.timestamp & 0xff) + + chr((self.timestamp >> 8) & 0xff) + + chr((self.timestamp >> 16) & 0xff) + + chr((self.timestamp >> 24) & 0xff)) + f.write(marshal.dumps(code)) f.close() return code @@ -388,7 +398,7 @@ class VFSSharedImporter: """ Returns the directory name that the indicated conventionally-loaded module must have been loaded from. """ - if not hasattr(mod, __file__) or mod.__file__ is None: + if not getattr(mod, '__file__', None): return None fullname = mod.__name__ @@ -433,6 +443,9 @@ class VFSSharedLoader: if self.reload: mod = sys.modules[fullname] path = mod.__path__ or [] + if path == fullname: + # Work around Python bug setting __path__ of frozen modules. + path = [] vfs_shared_path = getattr(mod, '_vfs_shared_path', []) for loader in self.loaders: @@ -450,11 +463,12 @@ class VFSSharedLoader: if mod is None: # If all of them failed to load, raise ImportError. - raise ImportError, message + raise ImportError(message) # If at least one of them loaded successfully, return the # union of loaded modules. mod.__path__ = path + mod.__package__ = fullname # Also set this special symbol, which records that this is a # shared package, and also lists the paths we have already @@ -515,7 +529,9 @@ def reloadSharedPackages(): #print >> sys.stderr, "reloadSharedPackages, path = %s, sharedPackages = %s" % (sys.path, sharedPackages.keys()) - for fullname in sharedPackages.keys(): + # Sort the list, just to make sure parent packages are reloaded + # before child packages are. + for fullname in sorted(sharedPackages.keys()): mod = sys.modules.get(fullname, None) if not mod: continue diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 50f1077e30..cd303697f2 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -31,14 +31,12 @@ isDebugBuild = (python.lower().endswith('_d')) # must be frozen in any main.exe. startupModules = [ 'site', 'sitecustomize', 'os', 'encodings.cp1252', - 'org', + 'encodings.latin_1', 'encodings.utf_8', 'io', 'org', ] # These are missing modules that we've reported already this session. reportedMissing = {} -# Our own Python source trees to watch out for. -sourceTrees = ['direct'] class CompilationEnvironment: """ Create an instance of this class to record the commands to @@ -445,7 +443,7 @@ extend_frozen_modules(const struct _frozen *new_modules, int new_count) { } %(dllexport)svoid init%(moduleName)s() { - extend_frozen_modules(_PyImport_FrozenModules, %(newcount)s); + extend_frozen_modules(_PyImport_FrozenModules, sizeof(_PyImport_FrozenModules) / sizeof(struct _frozen)); Py_InitModule("%(moduleName)s", nullMethods); } """ @@ -458,7 +456,7 @@ programFile = """ %(moduleDefs)s -static struct _frozen _PyImport_FrozenModules[] = { +struct _frozen _PyImport_FrozenModules[] = { %(moduleList)s {NULL, NULL, 0} }; @@ -485,7 +483,7 @@ okMissing = [ 'Carbon.Folder', 'Carbon.Folders', 'HouseGlobals', 'Carbon.File', 'MacOS', '_emx_link', 'ce', 'mac', 'org.python.core', 'os.path', 'os2', 'posix', 'pwd', 'readline', 'riscos', 'riscosenviron', - 'riscospath', 'dbm', 'fcntl', 'win32api', + 'riscospath', 'dbm', 'fcntl', 'win32api', 'usercustomize', '_winreg', 'ctypes', 'ctypes.wintypes', 'nt','msvcrt', 'EasyDialogs', 'SOCKS', 'ic', 'rourl2path', 'termios', 'OverrideFrom23._Res', 'email', 'email.Utils', 'email.Generator', @@ -613,20 +611,14 @@ class Freezer: self.mf = None - # Make sure we know how to find "direct". - for sourceTree in sourceTrees: - try: - module = __import__(sourceTree) - except: - pass - # Actually, make sure we know how to find all of the # already-imported modules. (Some of them might do their own # special path mangling.) for moduleName, module in sys.modules.items(): if module and hasattr(module, '__path__'): path = getattr(module, '__path__') - modulefinder.AddPackagePath(moduleName, path[0]) + if path: + modulefinder.AddPackagePath(moduleName, path[0]) def excludeFrom(self, freezer): """ Excludes all modules that have already been processed by @@ -827,7 +819,7 @@ class Freezer: moduleName, filename = filename, implicit = implicit, guess = guess, fromSource = fromSource, text = text) - def done(self, compileToExe = False): + def done(self, addStartupModules = False): """ Call this method after you have added all modules with addModule(). You may then call generateCode() or writeMultifile() to dump the resulting output. After a call @@ -838,7 +830,9 @@ class Freezer: # If we are building an exe, we also need to implicitly # bring in Python's startup modules. - if compileToExe: + if addStartupModules: + self.modules['_frozen_importlib'] = self.ModuleDef('importlib._bootstrap', implicit = True) + for moduleName in startupModules: if moduleName not in self.modules: self.modules[moduleName] = self.ModuleDef(moduleName, implicit = True) @@ -1071,8 +1065,12 @@ class Freezer: def __addPyc(self, multifile, filename, code, compressionLevel): if code: - data = imp.get_magic() + b'\0\0\0\0' + \ - marshal.dumps(code) + data = imp.get_magic() + b'\0\0\0\0' + + if sys.version_info >= (3, 0): + data += b'\0\0\0\0' + + data += marshal.dumps(code) stream = StringStream(data) multifile.addSubfile(filename, stream, compressionLevel) @@ -1214,22 +1212,9 @@ class Freezer: multifile.flush() multifile.repack() - def generateCode(self, basename, compileToExe = False): - """ After a call to done(), this freezes all of the - accumulated python code into either an executable program (if - compileToExe is true) or a dynamic library (if compileToExe is - false). The basename is the name of the file to write, - without the extension. - - The return value is the newly-generated filename, including - the filename extension. Additional extension modules are - listed in self.extras. """ - - if compileToExe: - # We must have a __main__ module to make an exe file. - if not self.__writingModule('__main__'): - message = "Can't generate an executable without a __main__ module." - raise StandardError, message + def writeCode(self, filename, initCode = ""): + """ After a call to done(), this freezes all of the accumulated + Python code into a C source file. """ self.__replacePaths() @@ -1247,38 +1232,57 @@ class Freezer: # Allow importing this module. module = self.mf.modules.get(origName, None) code = getattr(module, "__code__", None) - if not code and moduleName in startupModules: + if code: + code = marshal.dumps(code) + + mangledName = self.mangleName(moduleName) + moduleDefs.append(self.makeModuleDef(mangledName, code)) + moduleList.append(self.makeModuleListEntry(mangledName, code, moduleName, module)) + + elif moduleName in startupModules: # Forbid the loading of this startup module. moduleList.append(self.makeForbiddenModuleListEntry(moduleName)) + else: - if origName in sourceTrees: - # This is one of Panda3D's own Python source - # trees. These are a special case: we don't - # compile the __init__.py files within them, - # since their only purpose is to munge the - # __path__ variable anyway. Instead, we - # pretend the __init__.py files are empty. - code = compile('', moduleName, 'exec') - - if code: - code = marshal.dumps(code) - - mangledName = self.mangleName(moduleName) - moduleDefs.append(self.makeModuleDef(mangledName, code)) - moduleList.append(self.makeModuleListEntry(mangledName, code, moduleName, module)) + # This is a module with no associated Python + # code. It must be an extension module. Get the + # filename. + extensionFilename = getattr(module, '__file__', None) + if extensionFilename: + self.extras.append((moduleName, extensionFilename)) else: + # It doesn't even have a filename; it must + # be a built-in module. No worries about + # this one, then. + pass - # This is a module with no associated Python - # code. It must be an extension module. Get the - # filename. - extensionFilename = getattr(module, '__file__', None) - if extensionFilename: - self.extras.append((moduleName, extensionFilename)) - else: - # It doesn't even have a filename; it must - # be a built-in module. No worries about - # this one, then. - pass + text = programFile % { + 'moduleDefs': '\n'.join(moduleDefs), + 'moduleList': '\n'.join(moduleList), + 'initCode': initCode + } + + if filename is not None: + file = open(filename, 'w') + file.write(text) + file.close() + + def generateCode(self, basename, compileToExe = False): + """ After a call to done(), this freezes all of the + accumulated python code into either an executable program (if + compileToExe is true) or a dynamic library (if compileToExe is + false). The basename is the name of the file to write, + without the extension. + + The return value is the newly-generated filename, including + the filename extension. Additional extension modules are + listed in self.extras. """ + + if compileToExe: + # We must have a __main__ module to make an exe file. + if not self.__writingModule('__main__'): + message = "Can't generate an executable without a __main__ module." + raise StandardError, message filename = basename + self.sourceExtension @@ -1317,21 +1321,12 @@ class Freezer: initCode = dllInitCode % { 'moduleName' : os.path.basename(basename), - 'newcount' : len(moduleList), 'dllexport' : dllexport, 'dllimport' : dllimport, } compileFunc = self.cenv.compileDll - text = programFile % { - 'moduleDefs' : '\n'.join(moduleDefs), - 'moduleList' : '\n'.join(moduleList), - 'initCode' : initCode, - } - - file = open(filename, 'w') - file.write(text) - file.close() + self.writeCode(filename, initCode=initCode) try: compileFunc(filename, basename) @@ -1390,9 +1385,9 @@ class PandaModuleFinder(modulefinder.ModuleFinder): def __init__(self, *args, **kw): modulefinder.ModuleFinder.__init__(self, *args, **kw) - def find_module(self, name, path, parent=None): + def find_module(self, name, path, *args, **kwargs): try: - return modulefinder.ModuleFinder.find_module(self, name, path, parent = parent) + return modulefinder.ModuleFinder.find_module(self, name, path, *args, **kwargs) except ImportError: # It wasn't found through the normal channels. Maybe it's # one of ours, or maybe it's frozen? diff --git a/direct/src/showutil/pfreeze.py b/direct/src/showutil/pfreeze.py index ca43c25703..5bcc3c41ee 100755 --- a/direct/src/showutil/pfreeze.py +++ b/direct/src/showutil/pfreeze.py @@ -40,6 +40,11 @@ Options: of the __path__ variable, and thus must be actually imported to determine the true value of __path__. + -s + Adds the standard set of modules that are necessary for embedding + the Python interpreter. Implicitly set if an executable is + generated. + """ import getopt @@ -58,9 +63,10 @@ def usage(code, msg = ''): freezer = FreezeTool.Freezer() basename = None +addStartupModules = False try: - opts, args = getopt.getopt(sys.argv[1:], 'o:i:x:p:h') + opts, args = getopt.getopt(sys.argv[1:], 'o:i:x:p:sh') except getopt.error, msg: usage(1, msg) @@ -76,48 +82,57 @@ for opt, arg in opts: elif opt == '-p': for module in arg.split(','): freezer.handleCustomPath(module) + elif opt == '-s': + addStartupModules = True elif opt == '-h': usage(0) else: print 'illegal option: ' + flag sys.exit(1) -if not args: - usage(0) - if not basename: usage(1, 'You did not specify an output file.') -if len(args) != 1: +if len(args) > 1: usage(1, 'Only one main file may be specified.') outputType = 'exe' bl = basename.lower() if bl.endswith('.mf'): outputType = 'mf' +elif bl.endswith('.c'): + outputType = 'c' elif bl.endswith('.dll') or bl.endswith('.pyd') or bl.endswith('.so'): basename = os.path.splitext(basename)[0] outputType = 'dll' elif bl.endswith('.exe'): basename = os.path.splitext(basename)[0] -startfile = args[0] -startmod = startfile -if startfile.endswith('.py') or startfile.endswith('.pyw') or \ - startfile.endswith('.pyc') or startfile.endswith('.pyo'): - startmod = os.path.splitext(startfile)[0] - compileToExe = False -if outputType == 'dll': - freezer.addModule(startmod, filename = startfile) -else: - freezer.addModule('__main__', filename = startfile) - compileToExe = True +if args: + startfile = args[0] + startmod = startfile + if startfile.endswith('.py') or startfile.endswith('.pyw') or \ + startfile.endswith('.pyc') or startfile.endswith('.pyo'): + startmod = os.path.splitext(startfile)[0] -freezer.done(compileToExe = compileToExe) + if outputType == 'dll' or outputType == 'c': + freezer.addModule(startmod, filename = startfile) + else: + freezer.addModule('__main__', filename = startfile) + compileToExe = True + addStartupModules = True + +elif outputType == 'exe': + # We must have a main module when making an executable. + usage(0) + +freezer.done(addStartupModules = addStartupModules) if outputType == 'mf': freezer.writeMultifile(basename) +elif outputType == 'c': + freezer.writeCode(basename) else: freezer.generateCode(basename, compileToExe = compileToExe) diff --git a/direct/src/stdpy/file.py b/direct/src/stdpy/file.py index a3e114738c..c9524e845e 100644 --- a/direct/src/stdpy/file.py +++ b/direct/src/stdpy/file.py @@ -5,175 +5,185 @@ SIMPLE_THREADS model, by avoiding blocking all threads while waiting for I/O to complete. """ __all__ = [ - 'file', 'open', 'listdir', 'walk', 'join', + 'open', 'listdir', 'walk', 'join', 'isfile', 'isdir', 'exists', 'lexists', 'getmtime', 'getsize', 'execfile', ] -from panda3d import core +import panda3d._core as core import sys -import types import os +import io _vfs = core.VirtualFileSystem.getGlobalPtr() -class file: - def __init__(self, filename, mode = 'r', bufsize = None, - autoUnwrap = False): - self.__stream = None - self.__needsVfsClose = False - self.__reader = None - self.__writer = None - self.closed = True - self.encoding = None - self.errors = None - self.__lastWrite = False +def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True): + if sys.version_info >= (3, 0): + # Python 3 is much stricter than Python 2, which lets + # unknown flags fall through. + for ch in mode: + if ch not in 'rwxabt+U': + raise IOError("invalid mode: '%s'" % (mode)) - self.mode = mode - self.name = None - self.filename = None - self.newlines = None - self.softspace = False + creating = 'x' in mode + writing = 'w' in mode + appending = 'a' in mode + updating = '+' in mode + binary = 'b' in mode + universal = 'U' in mode + reading = universal or 'r' in mode - readMode = False - writeMode = False + if binary and 't' in mode: + raise IOError("can't have text and binary mode at once") - if isinstance(filename, core.Istream) or isinstance(filename, core.Ostream): - # If we were given a stream instead of a filename, assign - # it directly. - self.__stream = filename - readMode = isinstance(filename, core.Istream) - writeMode = isinstance(filename, core.Ostream) + if creating + reading + writing + appending > 1: + raise ValueError("must have exactly one of create/read/write/append mode") - elif isinstance(filename, core.VirtualFile): + if binary: + if encoding: + raise ValueError("binary mode doesn't take an encoding argument") + if errors: + raise ValueError("binary mode doesn't take an errors argument") + if newline: + raise ValueError("binary mode doesn't take a newline argument") + + if isinstance(file, core.Istream) or isinstance(file, core.Ostream): + # If we were given a stream instead of a filename, assign + # it directly. + raw = StreamIOWrapper(file) + raw.mode = mode + + else: + vfile = None + + if isinstance(file, core.VirtualFile): # We can also "open" a VirtualFile object for reading. - self.__stream = filename.openReadFile(autoUnwrap) - if not self.__stream: - message = 'Could not read virtual file %s' % (repr(filename)) - raise IOError, message - self.__needsVfsClose = True - readMode = True - + vfile = file + filename = vfile.getFilename() + filename.setBinary() else: # Otherwise, we must have been given a filename. Open it. - if isinstance(filename, types.StringTypes): + if isinstance(file, unicode): # If a raw string is given, assume it's an os-specific # filename. - filename = core.Filename.fromOsSpecific(filename) + filename = core.Filename.fromOsSpecificW(file) + elif isinstance(file, str): + filename = core.Filename.fromOsSpecific(file) else: # If a Filename is given, make a writable copy anyway. - filename = core.Filename(filename) + filename = core.Filename(file) - self.filename = filename - self.name = filename.toOsSpecific() + filename.setBinary() + vfile = _vfs.getFile(filename) - if sys.version_info >= (3, 0): - # Python 3 is much stricter than Python 2, which lets - # unknown flags fall through. - for ch in mode: - if not ch in 'rwxabt+U': - raise IOError("invalid mode: " + mode) + if not vfile: + if reading: + raise FileNotFoundError("No such file or directory: '%s'" % (filename)) - binary = False - if 'b' in mode and 't' in mode: - raise IOError("can't have text and binary mode at once") - - if 'b' in mode: - # Strip 'b'. This means a binary file. - i = mode.index('b') - mode = mode[:i] + mode[i + 1:] - binary = True - elif 't' in mode: - # Strip 't'. This means a text file (redundant, yes). - i = mode.index('t') - mode = mode[:i] + mode[i + 1:] - binary = False + vfile = _vfs.createFile(filename) + if not vfile: + raise IOError("Failed to create file: '%s'" % (filename)) - if 'U' in mode: - # Strip 'U'. We don't use it; universal-newline support - # is built into Panda, and can't be changed at runtime. - i = mode.index('U') - mode = mode[:i] + mode[i + 1:] - binary = False + elif creating: + # In 'creating' mode, we have to raise FileExistsError + # if the file already exists. Otherwise, it's the same + # as 'writing' mode. + raise FileExistsError("File exists: '%s'" % (filename)) - if mode == '': - mode = 'r' + elif vfile.isDirectory(): + raise IsADirectoryError("Is a directory: '%s'" % (filename)) - # Per Python docs, we insist this is true. - modeType = mode[0] - assert modeType in 'rwa' - - if binary: - filename.setBinary() + # Actually open the streams. + if reading: + if updating: + stream = vfile.openReadWriteFile(False) else: - filename.setText() - - # Actually open the streams, taking care to - # ignore unknown chars in the mode string. - # We already asserted that it starts with a mode - # char above, so locate the '+' - if modeType == 'w' and '+' in mode: - self.__stream = _vfs.openReadWriteFile(filename, True) - if not self.__stream: - message = 'Could not open %s for writing' % (filename) - raise IOError(message) - readMode = True - writeMode = True + stream = vfile.openReadFile(False) - elif modeType == 'a' and '+' in mode: - self.__stream = _vfs.openReadAppendFile(filename) - if not self.__stream: - message = 'Could not open %s for writing' % (filename) - raise IOError(message) - readMode = True - writeMode = True + if not stream: + raise IOError("Could not open %s for reading" % (filename)) - elif modeType == 'r' and '+' in mode: - self.__stream = _vfs.openReadWriteFile(filename, False) - if not self.__stream: - message = 'Could not open %s for writing' % (filename) - raise IOError(message) - readMode = True - writeMode = True - - elif modeType == 'w': - self.__stream = _vfs.openWriteFile(filename, autoUnwrap, True) - if not self.__stream: - message = 'Could not open %s for writing' % (filename) - raise IOError(message) - writeMode = True - - elif modeType == 'a': - self.__stream = _vfs.openAppendFile(filename) - if not self.__stream: - message = 'Could not open %s for writing' % (filename) - raise IOError(message) - writeMode = True - - elif modeType == 'r': - self.__stream = _vfs.openReadFile(filename, autoUnwrap) - if not self.__stream: - if not _vfs.exists(filename): - message = 'No such file: %s' % (filename) - else: - message = 'Could not open %s for reading' % (filename) - raise IOError(message) - readMode = True - + elif writing or creating: + if updating: + stream = vfile.openReadWriteFile(True) else: - # should not get here unless there's a bug above - raise IOError("Unhandled mode flags: " + mode) + stream = vfile.openWriteFile(False) - self.__needsVfsClose = True + if not stream: + raise IOError("Could not open %s for writing" % (filename)) - if readMode: + elif appending: + if updating: + stream = vfile.openReadAppendFile() + else: + stream = vfile.openAppendFile() + + if not stream: + raise IOError("Could not open %s for appending" % (filename)) + + else: + raise ValueError("Must have exactly one of create/read/write/append mode and at most one plus") + + raw = StreamIOWrapper(stream, needsVfsClose=True) + raw.mode = mode + raw.name = vfile.getFilename().toOsSpecific() + + # If a binary stream was requested, return the stream we've created. + if binary: + return raw + + line_buffering = False + if buffering == 1: + line_buffering = True + elif buffering == 0: + raise ValueError("can't have unbuffered text I/O") + + # Otherwise, create a TextIOWrapper object to wrap it. + wrapper = io.TextIOWrapper(raw, encoding, errors, newline, line_buffering) + wrapper.mode = mode + return wrapper + + +if sys.version_info < (3, 0): + # Python 2 had an alias for open() called file(). + __all__.append('file') + file = open + + +class StreamIOWrapper(io.IOBase): + """ This is a file-like object that wraps around a C++ istream and/or + ostream object. It only deals with binary data; to work with text I/O, + create an io.TextIOWrapper object around this, or use the open() + function that is also provided with this module. """ + + def __init__(self, stream, needsVfsClose=False): + self.__stream = stream + self.__needsVfsClose = needsVfsClose + self.__reader = None + self.__writer = None + self.__lastWrite = False + + if isinstance(stream, core.Istream): self.__reader = core.StreamReader(self.__stream, False) - if writeMode: - self.__writer = core.StreamWriter(self.__stream, False) + + if isinstance(stream, core.Ostream): + self.__writer = core.StreamWriter(stream, False) self.__lastWrite = True - def __del__(self): - self.close() + def __repr__(self): + s = "= 0: + if size is not None and size >= 0: result = self.__reader.extractBytes(size) else: # Read to end-of-file. - result = '' + result = b'' while not self.__stream.eof(): - result += self.__reader.extractBytes(1024) + result += self.__reader.extractBytes(512) return result - def readline(self, size = -1): + def readline(self, size=-1): if not self.__reader: if not self.__writer: # The stream is not even open at all. - message = 'I/O operation on closed file' - raise ValueError, message + raise ValueError("I/O operation on closed file") + # The stream is open only in write mode. - message = 'Attempt to read from write-only stream' - raise IOError, message + raise IOError("Attempt to read from write-only stream") self.__stream.clear() # clear eof flag self.__lastWrite = False return self.__reader.readline() - def readlines(self, sizehint = -1): - lines = [] - line = self.readline() - while line: - lines.append(line) - line = self.readline() - return lines - - xreadlines = readlines - def seek(self, offset, whence = 0): if self.__stream: self.__stream.clear() # clear eof flag @@ -264,58 +253,43 @@ class file: else: if self.__reader: return self.__stream.tellg() - message = 'I/O operation on closed file' - raise ValueError, message + raise ValueError("I/O operation on closed file") - def truncate(self): - """ Sorry, this isn't supported by Panda's low-level I/O, - because it isn't supported by the standard C++ library. """ - raise NotImplementedError - - def write(self, str): + def write(self, b): if not self.__writer: if not self.__reader: # The stream is not even open at all. - message = 'I/O operation on closed file' - raise ValueError, message + raise ValueError("I/O operation on closed file") + # The stream is open only in read mode. - message = 'Attempt to write to read-only stream' - raise IOError, message + raise IOError("Attempt to write to read-only stream") self.__stream.clear() # clear eof flag - self.__writer.appendData(str) + self.__writer.appendData(b) self.__lastWrite = True def writelines(self, lines): if not self.__writer: if not self.__reader: # The stream is not even open at all. - message = 'I/O operation on closed file' - raise ValueError, message + raise ValueError("I/O operation on closed file") + # The stream is open only in read mode. - message = 'Attempt to write to read-only stream' - raise IOError, message + raise IOError("Attempt to write to read-only stream") self.__stream.clear() # clear eof flag for line in lines: self.__writer.appendData(line) self.__lastWrite = True - def __enter__(self): - return self - - def __exit__(self, t, v, tb): - self.close() - -open = file def listdir(path): """ Implements os.listdir over vfs. """ files = [] dirlist = _vfs.scanDirectory(core.Filename.fromOsSpecific(path)) if dirlist is None: - message = 'No such file or directory: %s' % (path) - raise OSError, message + raise OSError("No such file or directory: '%s'" % (path)) + for file in dirlist: files.append(file.getFilename().getBasename()) return files diff --git a/dtool/src/prc/streamReader.cxx b/dtool/src/prc/streamReader.cxx index 27708563bd..c469309b53 100644 --- a/dtool/src/prc/streamReader.cxx +++ b/dtool/src/prc/streamReader.cxx @@ -112,25 +112,6 @@ skip_bytes(size_t size) { } } -//////////////////////////////////////////////////////////////////// -// Function: StreamReader::extract_bytes -// Access: Published -// Description: Extracts the indicated number of bytes in the -// stream and returns them as a string. Returns empty -// string at end-of-file. -//////////////////////////////////////////////////////////////////// -string StreamReader:: -extract_bytes(size_t size) { - if (_in->eof() || _in->fail()) { - return string(); - } - - char *buffer = (char *)alloca(size); - _in->read(buffer, size); - size_t read_bytes = _in->gcount(); - return string(buffer, read_bytes); -} - //////////////////////////////////////////////////////////////////// // Function: StreamReader::extract_bytes // Access: Published @@ -150,9 +131,28 @@ extract_bytes(unsigned char *into, size_t size) { return _in->gcount(); } +//////////////////////////////////////////////////////////////////// +// Function: StreamReader::extract_bytes +// Access: Public +// Description: Extracts the indicated number of bytes in the +// stream and returns them as a string. Returns empty +// string at end-of-file. +//////////////////////////////////////////////////////////////////// +string StreamReader:: +extract_bytes(size_t size) { + if (_in->eof() || _in->fail()) { + return string(); + } + + char *buffer = (char *)alloca(size); + _in->read(buffer, size); + size_t read_bytes = _in->gcount(); + return string(buffer, read_bytes); +} + //////////////////////////////////////////////////////////////////// // Function: StreamReader::readline -// Access: Published +// Access: Public // Description: Assumes the stream represents a text file, and // extracts one line up to and including the trailing // newline character. Returns empty string when the end @@ -177,4 +177,3 @@ readline() { return line; } - diff --git a/dtool/src/prc/streamReader.h b/dtool/src/prc/streamReader.h index 8d71cf6b9b..9560cfef5e 100644 --- a/dtool/src/prc/streamReader.h +++ b/dtool/src/prc/streamReader.h @@ -66,12 +66,16 @@ PUBLISHED: BLOCKING string get_fixed_string(size_t size); BLOCKING void skip_bytes(size_t size); - BLOCKING string extract_bytes(size_t size); BLOCKING size_t extract_bytes(unsigned char *into, size_t size); + EXTENSION(BLOCKING PyObject *extract_bytes(size_t size)); - BLOCKING string readline(); + EXTENSION(BLOCKING PyObject *readline()); EXTENSION(BLOCKING PyObject *readlines()); +public: + BLOCKING string extract_bytes(size_t size); + BLOCKING string readline(); + private: istream *_in; bool _owns_stream; diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index b34c655f56..687aa70510 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -381,9 +381,10 @@ if (RUNTIME or RTDIST): if (RUNTIME): outputdir_suffix += "_rt" - RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION -elif (DISTRIBUTOR == ""): +if DISTRIBUTOR == "": DISTRIBUTOR = "makepanda" +else: + RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION if not IsCustomOutputDir(): if GetTarget() == "windows" and GetTargetArch() == 'x64': @@ -1800,10 +1801,25 @@ def FreezePy(target, inputs, opts): if sys.version_info >= (2, 6): cmdstr += "-B " - cmdstr += os.path.join("direct", "src", "showutil", "pfreeze.py") - src = inputs.pop(0) + cmdstr += os.path.join(GetOutputDir(), "direct", "showutil", "pfreeze.py") + + if 'FREEZE_STARTUP' in opts: + cmdstr += " -s" + + if GetOrigExt(target) == '.exe': + src = inputs.pop(0) + else: + src = "" + for i in inputs: - cmdstr += " -i " + os.path.splitext(i)[0] + i = os.path.splitext(i)[0] + i = i.replace('/', '.') + + if i.startswith('direct.src'): + i = i.replace('.src.', '.') + + cmdstr += " -i " + i + cmdstr += " -o " + target + " " + src if ("LINK_PYTHON_STATIC" in opts): @@ -1919,6 +1935,7 @@ def CompileAnything(target, inputs, opts, progress = None): exit("No input files for target "+target) infile = inputs[0] origsuffix = GetOrigExt(target) + if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)): # It must be a simple copy operation. ProgressOutput(progress, "Copying file", target) @@ -1926,15 +1943,26 @@ def CompileAnything(target, inputs, opts, progress = None): if (origsuffix==".exe" and GetHost() != "windows"): os.system("chmod +x \"%s\"" % target) return + elif (target.endswith(".py")): ProgressOutput(progress, "Generating", target) return GenPyExtensions(target, inputs, opts) + elif (infile.endswith(".py")): - if (origsuffix==".exe"): + if origsuffix == ".obj": + source = os.path.splitext(target)[0] + ".c" + SetOrigExt(source, ".c") + ProgressOutput(progress, "Building frozen source", source) + FreezePy(source, inputs, opts) + ProgressOutput(progress, "Building C++ object", target) + return CompileCxx(target, source, opts) + + if origsuffix == ".exe": ProgressOutput(progress, "Building frozen executable", target) else: ProgressOutput(progress, "Building frozen library", target) return FreezePy(target, inputs, opts) + elif (infile.endswith(".idl")): ProgressOutput(progress, "Compiling MIDL file", infile) return CompileMIDL(target, infile, opts) @@ -5021,10 +5049,12 @@ if (RTDIST or RUNTIME): TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj') if (PkgSkip("PYTHON")==0 and RTDIST): + TargetAdd('p3dpython_frozen.obj', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'], input='VFSImporter.py') TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx') TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx') TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj') TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj') + TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj') TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS) TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb') TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll') diff --git a/panda/src/express/p3express_ext_composite.cxx b/panda/src/express/p3express_ext_composite.cxx index 7956bce4de..1dab5d4477 100644 --- a/panda/src/express/p3express_ext_composite.cxx +++ b/panda/src/express/p3express_ext_composite.cxx @@ -5,3 +5,4 @@ #include "streamReader_ext.cxx" #include "typeHandle_ext.cxx" #include "virtualFileSystem_ext.cxx" +#include "virtualFile_ext.cxx" diff --git a/panda/src/express/ramfile.h b/panda/src/express/ramfile.h index d8006400a4..d09aaae98e 100644 --- a/panda/src/express/ramfile.h +++ b/panda/src/express/ramfile.h @@ -18,6 +18,7 @@ #include "pandabase.h" #include "typedef.h" #include "referenceCount.h" +#include "extension.h" //////////////////////////////////////////////////////////////////// // Class : Ramfile @@ -30,17 +31,23 @@ PUBLISHED: INLINE void seek(size_t pos); INLINE size_t tell() const; - string read(size_t length); - string readline(); + EXTENSION(PyObject *read(size_t length)); + EXTENSION(PyObject *readline()); EXTENSION(PyObject *readlines()); - INLINE const string &get_data() const; + EXTENSION(PyObject *get_data() const); INLINE size_t get_data_size() const; INLINE void clear(); public: + string read(size_t length); + string readline(); + INLINE const string &get_data() const; + size_t _pos; string _data; + + friend class Extension; }; #include "ramfile.I" diff --git a/panda/src/express/ramfile_ext.cxx b/panda/src/express/ramfile_ext.cxx index 366395df8d..e2082d4948 100644 --- a/panda/src/express/ramfile_ext.cxx +++ b/panda/src/express/ramfile_ext.cxx @@ -16,6 +16,49 @@ #ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: Ramfile::read +// Access: Published +// Description: Extracts the indicated number of bytes in the +// stream and returns them as a string (or bytes, +// in Python 3). Returns empty string at end-of-file. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +read(size_t length) { + size_t data_length = _this->get_data_size(); + const char *data = _this->_data.data() + _this->_pos; + length = min(length, data_length - _this->_pos); + _this->_pos = min(_this->_pos + length, data_length); + +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromStringAndSize((char *)data, length); +#else + return PyString_FromStringAndSize((char *)data, length); +#endif +} + +//////////////////////////////////////////////////////////////////// +// Function: Ramfile::readline +// Access: Published +// Description: Assumes the stream represents a text file, and +// extracts one line up to and including the trailing +// newline character. Returns empty string when the end +// of file is reached. +// +// The interface here is intentionally designed to be +// similar to that for Python's File.readline() +// function. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +readline() { + string line = _this->readline(); +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromStringAndSize(line.data(), line.size()); +#else + return PyString_FromStringAndSize(line.data(), line.size()); +#endif +} + //////////////////////////////////////////////////////////////////// // Function: Ramfile::readlines // Access: Published @@ -44,5 +87,19 @@ readlines() { return lst; } +//////////////////////////////////////////////////////////////////// +// Function: Ramfile::get_data +// Access: Published +// Description: Returns the entire buffer contents as a string, +// regardless of the current data pointer. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +get_data() const { +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromStringAndSize(_this->_data.data(), _this->_data.size()); +#else + return PyString_FromStringAndSize(_this->_data.data(), _this->_data.size()); #endif +} +#endif diff --git a/panda/src/express/ramfile_ext.h b/panda/src/express/ramfile_ext.h index 8f90eb52ad..6ece9d3d7c 100644 --- a/panda/src/express/ramfile_ext.h +++ b/panda/src/express/ramfile_ext.h @@ -32,7 +32,11 @@ template<> class Extension : public ExtensionBase { public: - BLOCKING PyObject *readlines(); + PyObject *read(size_t length); + PyObject *readline(); + PyObject *readlines(); + + PyObject *get_data() const; }; #endif // HAVE_PYTHON diff --git a/panda/src/express/streamReader_ext.cxx b/panda/src/express/streamReader_ext.cxx index c0aa00f26a..8adb05556c 100644 --- a/panda/src/express/streamReader_ext.cxx +++ b/panda/src/express/streamReader_ext.cxx @@ -16,6 +16,59 @@ #ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: StreamReader::extract_bytes +// Access: Published +// Description: Extracts the indicated number of bytes in the +// stream and returns them as a string (or bytes, +// in Python 3). Returns empty string at end-of-file. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +extract_bytes(size_t size) { + unsigned char *buffer = (unsigned char *)alloca(size); + size_t read_bytes = _this->extract_bytes(buffer, size); + +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromStringAndSize((char *)buffer, read_bytes); +#else + return PyString_FromStringAndSize((char *)buffer, read_bytes); +#endif +} + +//////////////////////////////////////////////////////////////////// +// Function: Extension::readline +// Access: Published +// Description: Assumes the stream represents a text file, and +// extracts one line up to and including the trailing +// newline character. Returns empty string when the end +// of file is reached. +// +// The interface here is intentionally designed to be +// similar to that for Python's File.readline() +// function. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +readline() { + istream *in = _this->get_istream(); + + string line; + int ch = in->get(); + while (!in->eof() && !in->fail()) { + line += ch; + if (ch == '\n') { + // Here's the newline character. + break; + } + ch = in->get(); + } + +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromStringAndSize(line.data(), line.size()); +#else + return PyString_FromStringAndSize(line.data(), line.size()); +#endif +} + //////////////////////////////////////////////////////////////////// // Function: StreamReader::readlines // Access: Published @@ -29,16 +82,17 @@ readlines() { return NULL; } - string line = _this->readline(); - while (!line.empty()) { -#if PY_MAJOR_VERSION >= 3 - PyObject *py_line = PyBytes_FromStringAndSize(line.data(), line.size()); -#else - PyObject *py_line = PyString_FromStringAndSize(line.data(), line.size()); -#endif + PyObject *py_line = readline(); +#if PY_MAJOR_VERSION >= 3 + while (PyBytes_GET_SIZE(py_line) > 0) { +#else + while (PyString_GET_SIZE(py_line) > 0) { +#endif PyList_Append(lst, py_line); Py_DECREF(py_line); + + py_line = readline(); } return lst; diff --git a/panda/src/express/streamReader_ext.h b/panda/src/express/streamReader_ext.h index dfc2e9f0b1..eb5877f321 100644 --- a/panda/src/express/streamReader_ext.h +++ b/panda/src/express/streamReader_ext.h @@ -32,7 +32,10 @@ template<> class Extension : public ExtensionBase { public: + BLOCKING PyObject *extract_bytes(size_t size); + BLOCKING PyObject *readline(); BLOCKING PyObject *readlines(); + BLOCKING PyObject *get_data() const; }; #endif // HAVE_PYTHON diff --git a/panda/src/express/virtualFile.h b/panda/src/express/virtualFile.h index 397d82664f..3b773cd10b 100644 --- a/panda/src/express/virtualFile.h +++ b/panda/src/express/virtualFile.h @@ -58,12 +58,12 @@ PUBLISHED: BLOCKING void ls(ostream &out = cout) const; BLOCKING void ls_all(ostream &out = cout) const; - BLOCKING INLINE string read_file(bool auto_unwrap) const; + EXTENSION(BLOCKING PyObject *read_file(bool auto_unwrap) const); BLOCKING virtual istream *open_read_file(bool auto_unwrap) const; BLOCKING virtual void close_read_file(istream *stream) const; virtual bool was_read_successful() const; - BLOCKING INLINE bool write_file(const string &data, bool auto_wrap); + EXTENSION(BLOCKING PyObject *write_file(PyObject *data, bool auto_wrap)); BLOCKING virtual ostream *open_write_file(bool auto_wrap, bool truncate); BLOCKING virtual ostream *open_append_file(); BLOCKING virtual void close_write_file(ostream *stream); @@ -82,6 +82,9 @@ public: virtual bool atomic_compare_and_exchange_contents(string &orig_contents, const string &old_contents, const string &new_contents); virtual bool atomic_read_contents(string &contents) const; + INLINE string read_file(bool auto_unwrap) const; + INLINE bool write_file(const string &data, bool auto_wrap); + INLINE void set_original_filename(const Filename &filename); bool read_file(string &result, bool auto_unwrap) const; virtual bool read_file(pvector &result, bool auto_unwrap) const; diff --git a/panda/src/express/virtualFile_ext.cxx b/panda/src/express/virtualFile_ext.cxx new file mode 100644 index 0000000000..3d1c738e8e --- /dev/null +++ b/panda/src/express/virtualFile_ext.cxx @@ -0,0 +1,83 @@ +// Filename: virtualFile_ext.cxx +// Created by: rdb (15Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "virtualFile_ext.h" +#include "vector_uchar.h" + +#ifdef HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: VirtualFile::read_file +// Access: Published +// Description: Convenience function; returns the entire contents of +// the indicated file as a string (or as a bytes object, +// in Python 3). +// +// This variant on read_file() is implemented directly +// for Python, as a small optimization, to avoid the +// double-construction of a string object that would be +// otherwise required for the return value. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +read_file(bool auto_unwrap) const { + vector_uchar pv; + bool okflag = _this->read_file(pv, auto_unwrap); + nassertr(okflag, NULL); + +#if PY_MAJOR_VERSION >= 3 + if (pv.empty()) { + return PyBytes_FromStringAndSize("", 0); + } else { + return PyBytes_FromStringAndSize((const char *)&pv[0], pv.size()); + } +#else + if (pv.empty()) { + return PyString_FromStringAndSize("", 0); + } else { + return PyString_FromStringAndSize((const char *)&pv[0], pv.size()); + } +#endif +} + +//////////////////////////////////////////////////////////////////// +// Function: VirtualFile::write_file +// Access: Published +// Description: Convenience function; writes the entire contents of +// the indicated file as a string. +// +// This variant on write_file() is implemented directly +// for Python, as a small optimization, to avoid the +// double-construction of a string object that would be +// otherwise required. +//////////////////////////////////////////////////////////////////// +PyObject *Extension:: +write_file(PyObject *data, bool auto_wrap) { + char *buffer; + Py_ssize_t length; + +#if PY_MAJOR_VERSION >= 3 + if (PyBytes_AsStringAndSize(data, &buffer, &length) == -1) { + return NULL; + } +#else + if (PyString_AsStringAndSize(data, &buffer, &length) == -1) { + return NULL; + } +#endif + + bool result = _this->write_file((const unsigned char *)buffer, length, auto_wrap); + return PyBool_FromLong(result); +} + +#endif // HAVE_PYTHON diff --git a/panda/src/express/virtualFile_ext.h b/panda/src/express/virtualFile_ext.h new file mode 100644 index 0000000000..dd6262067b --- /dev/null +++ b/panda/src/express/virtualFile_ext.h @@ -0,0 +1,42 @@ +// Filename: virtualFile_ext.h +// Created by: rdb (15Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef VIRTUALFILE_EXT_H +#define VIRTUALFILE_EXT_H + +#include "dtoolbase.h" + +#ifdef HAVE_PYTHON + +#include "extension.h" +#include "virtualFile.h" +#include "py_panda.h" + +//////////////////////////////////////////////////////////////////// +// Class : Extension +// Description : This class defines the extension methods for +// VirtualFile, which are called instead of +// any C++ methods with the same prototype. +//////////////////////////////////////////////////////////////////// +template<> +class Extension : public ExtensionBase { +public: + PyObject *read_file(bool auto_unwrap) const; + PyObject *write_file(PyObject *data, bool auto_wrap); +}; + +#endif // HAVE_PYTHON + +#endif // VIRTUALFILE_EXT_H + From 1d9aff0c48d22b9052164acbed5e736459cabd18 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 19 Sep 2015 14:50:59 +0200 Subject: [PATCH 179/203] Fix wrapper for operator bool of TypeHandle --- dtool/src/interrogate/functionRemap.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 2bf2fb06da..1b7315f1eb 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -146,20 +146,17 @@ call_function(ostream &out, int indent_level, bool convert_result, } else if (_type == T_typecast_method) { // A typecast method can be invoked implicitly. - string cast_expr = - "(" + _return_type->get_orig_type()->get_local_name(&parser) + ")"; + ostringstream cast_expr; + cast_expr << "(" + << _return_type->get_orig_type()->get_local_name(&parser) << ")"; - if (TypeManager::is_handle(_cpptype)) { - cast_expr += "(" + container + ")"; - } else { - cast_expr += "(*" + container + ")"; - } + _parameters[0]._remap->pass_parameter(cast_expr, container); if (!convert_result) { - return_expr = cast_expr; + return_expr = cast_expr.str(); } else { string new_str = - _return_type->prepare_return_expr(out, indent_level, cast_expr); + _return_type->prepare_return_expr(out, indent_level, cast_expr.str()); return_expr = _return_type->get_return_expr(new_str); } From 62217c652e5032e6e5cbf3e485e55d76e68023e8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 20 Sep 2015 01:37:49 +0200 Subject: [PATCH 180/203] Fix various link issues on Windows when building rtdist --- direct/src/plugin/p3dPythonRun.cxx | 6 ++++-- direct/src/stdpy/file.py | 1 + makepanda/makepanda.py | 2 ++ panda/src/downloader/stringStream.I | 4 ++-- panda/src/downloader/stringStream.cxx | 2 +- panda/src/downloader/stringStream.h | 3 ++- panda/src/downloader/stringStreamBuf.I | 4 ++-- panda/src/downloader/stringStreamBuf.h | 8 ++++---- panda/src/downloader/stringStream_ext.cxx | 2 +- panda/src/express/streamReader_ext.h | 1 - 10 files changed, 19 insertions(+), 14 deletions(-) diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 459d1015ce..3c8e8628c6 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -21,8 +21,10 @@ #include "py_panda.h" -// This has been compiled-in by the build system, if all is well. -extern struct _frozen _PyImport_FrozenModules[]; +extern "C" { + // This has been compiled-in by the build system, if all is well. + extern struct _frozen _PyImport_FrozenModules[]; +}; // There is only one P3DPythonRun object in any given process space. // Makes the statics easier to deal with, and we don't need multiple diff --git a/direct/src/stdpy/file.py b/direct/src/stdpy/file.py index c9524e845e..4321a01ed7 100644 --- a/direct/src/stdpy/file.py +++ b/direct/src/stdpy/file.py @@ -14,6 +14,7 @@ import panda3d._core as core import sys import os import io +import encodings _vfs = core.VirtualFileSystem.getGlobalPtr() diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 687aa70510..8e5017d4fa 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -5061,6 +5061,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER']) TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj') + TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj') TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb') TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll') @@ -5073,6 +5074,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx') TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj') TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj') + TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj') TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS) TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb') TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll') diff --git a/panda/src/downloader/stringStream.I b/panda/src/downloader/stringStream.I index 66481c69ee..5bb892f32f 100644 --- a/panda/src/downloader/stringStream.I +++ b/panda/src/downloader/stringStream.I @@ -63,7 +63,7 @@ get_data_size() { INLINE string StringStream:: get_data() { flush(); - const pvector &data = _buf.get_data(); + const vector_uchar &data = _buf.get_data(); if (!data.empty()) { return string((char *)&data[0], data.size()); } @@ -91,7 +91,7 @@ set_data(const string &data) { // internal buffer. //////////////////////////////////////////////////////////////////// INLINE void StringStream:: -swap_data(pvector &data) { +swap_data(vector_uchar &data) { flush(); _buf.swap_data(data); } diff --git a/panda/src/downloader/stringStream.cxx b/panda/src/downloader/stringStream.cxx index a15172ea08..1a72c17f6a 100644 --- a/panda/src/downloader/stringStream.cxx +++ b/panda/src/downloader/stringStream.cxx @@ -23,7 +23,7 @@ void StringStream:: set_data(const unsigned char *data, size_t size) { _buf.clear(); - pvector pv; + vector_uchar pv; pv.insert(pv.end(), data, data + size); _buf.swap_data(pv); } diff --git a/panda/src/downloader/stringStream.h b/panda/src/downloader/stringStream.h index cc295e5357..158f6194ca 100644 --- a/panda/src/downloader/stringStream.h +++ b/panda/src/downloader/stringStream.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "stringStreamBuf.h" +#include "vector_uchar.h" #include "extension.h" //////////////////////////////////////////////////////////////////// @@ -49,7 +50,7 @@ public: void set_data(const unsigned char *data, size_t size); #endif - INLINE void swap_data(pvector &data); + INLINE void swap_data(vector_uchar &data); private: StringStreamBuf _buf; diff --git a/panda/src/downloader/stringStreamBuf.I b/panda/src/downloader/stringStreamBuf.I index acd79da1d8..0c0a54bda6 100644 --- a/panda/src/downloader/stringStreamBuf.I +++ b/panda/src/downloader/stringStreamBuf.I @@ -21,7 +21,7 @@ // or the iostream buffer. //////////////////////////////////////////////////////////////////// INLINE void StringStreamBuf:: -swap_data(pvector &data) { +swap_data(vector_uchar &data) { _data.swap(data); } @@ -31,7 +31,7 @@ swap_data(pvector &data) { // Description: Returns a reference to the contents of the internal // buffer, without any of the iostream buffer. //////////////////////////////////////////////////////////////////// -INLINE const pvector &StringStreamBuf:: +INLINE const vector_uchar &StringStreamBuf:: get_data() const { return _data; } diff --git a/panda/src/downloader/stringStreamBuf.h b/panda/src/downloader/stringStreamBuf.h index 2fe5936a2f..ae42cf623d 100644 --- a/panda/src/downloader/stringStreamBuf.h +++ b/panda/src/downloader/stringStreamBuf.h @@ -16,7 +16,7 @@ #define STRINGSTREAMBUF_H #include "pandabase.h" -#include "pvector.h" +#include "vector_uchar.h" //////////////////////////////////////////////////////////////////// // Class : StringStreamBuf @@ -32,8 +32,8 @@ public: void clear(); - INLINE void swap_data(pvector &data); - INLINE const pvector &get_data() const; + INLINE void swap_data(vector_uchar &data); + INLINE const vector_uchar &get_data() const; size_t read_chars(char *start, size_t length); void write_chars(const char *start, size_t length); @@ -47,7 +47,7 @@ protected: virtual int underflow(); private: - pvector _data; + vector_uchar _data; char *_buffer; size_t _ppos; size_t _gpos; diff --git a/panda/src/downloader/stringStream_ext.cxx b/panda/src/downloader/stringStream_ext.cxx index a1c46d6cef..54c889d7e3 100644 --- a/panda/src/downloader/stringStream_ext.cxx +++ b/panda/src/downloader/stringStream_ext.cxx @@ -34,7 +34,7 @@ __init__(PyObject *source) { PyObject *Extension:: get_data() { _this->flush(); - const pvector &data = _this->_buf.get_data(); + const vector_uchar &data = _this->_buf.get_data(); if (!data.empty()) { #if PY_MAJOR_VERSION >= 3 return PyBytes_FromStringAndSize((char *)&data[0], data.size()); diff --git a/panda/src/express/streamReader_ext.h b/panda/src/express/streamReader_ext.h index eb5877f321..49edcd6426 100644 --- a/panda/src/express/streamReader_ext.h +++ b/panda/src/express/streamReader_ext.h @@ -35,7 +35,6 @@ public: BLOCKING PyObject *extract_bytes(size_t size); BLOCKING PyObject *readline(); BLOCKING PyObject *readlines(); - BLOCKING PyObject *get_data() const; }; #endif // HAVE_PYTHON From 6d4d23cf6c06b1278b029bf60798a1552a5f781c Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 20 Sep 2015 16:01:49 +0200 Subject: [PATCH 181/203] Fix some p3dCert issues --- direct/src/plugin/p3dCert_strings.cxx | 4 ++-- makepanda/makepanda.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/src/plugin/p3dCert_strings.cxx b/direct/src/plugin/p3dCert_strings.cxx index bd191768e0..307c9b7f44 100644 --- a/direct/src/plugin/p3dCert_strings.cxx +++ b/direct/src/plugin/p3dCert_strings.cxx @@ -82,7 +82,7 @@ no_cert_title[LI_COUNT] = { "Keine Signatur!", "Sin firma!", "Nessuna firma!", - "Ne subskribo!", + "Neniu subskribo!", "\320\235\320\265\321\202 \320\277\320\276\320\264\320\277\320\270\321\201" "\320\270!", }; @@ -157,7 +157,7 @@ self_signed_cert_text[LI_COUNT] = { // epo "\304\210i tiu aplika\304\265o de Panda3D uzas memsubskribitan ateston. " - "Tio signifas ke la nomo de la verkanto ne povas esti kontrolita, kaj vi " + "Tio signifas ke la nomo de la verkanto ne povas esti kontrolita, kaj vi " "ne havas certan scimanieron pri la vera verkanto de la aplika\304\265o.\n" "\n" "Ni rekomendas ke vi premas la butonon 'Nuligi' por eviti lan\304\211on de " diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 6e3f367be3..b1c31930ea 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -4925,7 +4925,7 @@ if (RTDIST or RUNTIME): OPTS += ['OPT:2'] TargetAdd('p3dcert.exe', opts=OPTS) elif (PkgSkip("WX")==0): - OPTS.append("WX") + OPTS += ["WX", "RTTI"] TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx') TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj') TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj') From 49088fb7ce86d058b61642cbebef7d76b09156b6 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 21 Sep 2015 15:13:21 +0200 Subject: [PATCH 182/203] Fix some issues with new VFS open() implementation --- direct/src/directnotify/Notifier.py | 2 +- direct/src/stdpy/file.py | 34 ++++++++++------ dtool/src/prc/streamWriter.I | 4 +- dtool/src/prc/streamWriter.h | 7 +++- panda/src/express/p3express_ext_composite.cxx | 1 + panda/src/express/streamWriter_ext.cxx | 39 ++++++++++++++++++ panda/src/express/streamWriter_ext.h | 40 +++++++++++++++++++ 7 files changed, 109 insertions(+), 18 deletions(-) create mode 100644 panda/src/express/streamWriter_ext.cxx create mode 100644 panda/src/express/streamWriter_ext.h diff --git a/direct/src/directnotify/Notifier.py b/direct/src/directnotify/Notifier.py index 816ab8c0df..a49bbf0d03 100644 --- a/direct/src/directnotify/Notifier.py +++ b/direct/src/directnotify/Notifier.py @@ -235,7 +235,7 @@ class Notifier: Prints the string to output followed by a newline. """ if self.streamWriter: - self.streamWriter.appendData(string + '\n') + self.streamWriter.write(string + '\n') else: print >> sys.stderr, string diff --git a/direct/src/stdpy/file.py b/direct/src/stdpy/file.py index 4321a01ed7..463eb8639c 100644 --- a/direct/src/stdpy/file.py +++ b/direct/src/stdpy/file.py @@ -61,20 +61,22 @@ def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, # We can also "open" a VirtualFile object for reading. vfile = file filename = vfile.getFilename() + elif isinstance(file, unicode): + # If a raw string is given, assume it's an os-specific + # filename. + filename = core.Filename.fromOsSpecificW(file) + elif isinstance(file, str): + filename = core.Filename.fromOsSpecific(file) + else: + # If a Filename is given, make a writable copy anyway. + filename = core.Filename(file) + + if binary or sys.version_info >= (3, 0): filename.setBinary() else: - # Otherwise, we must have been given a filename. Open it. - if isinstance(file, unicode): - # If a raw string is given, assume it's an os-specific - # filename. - filename = core.Filename.fromOsSpecificW(file) - elif isinstance(file, str): - filename = core.Filename.fromOsSpecific(file) - else: - # If a Filename is given, make a writable copy anyway. - filename = core.Filename(file) + filename.setText() - filename.setBinary() + if not vfile: vfile = _vfs.getFile(filename) if not vfile: @@ -108,7 +110,7 @@ def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, if updating: stream = vfile.openReadWriteFile(True) else: - stream = vfile.openWriteFile(False) + stream = vfile.openWriteFile(False, True) if not stream: raise IOError("Could not open %s for writing" % (filename)) @@ -133,6 +135,10 @@ def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, if binary: return raw + # If we're in Python 2, we don't decode unicode strings by default. + if not encoding and sys.version_info < (3, 0): + return raw + line_buffering = False if buffering == 1: line_buffering = True @@ -165,7 +171,7 @@ class StreamIOWrapper(io.IOBase): self.__lastWrite = False if isinstance(stream, core.Istream): - self.__reader = core.StreamReader(self.__stream, False) + self.__reader = core.StreamReader(stream, False) if isinstance(stream, core.Ostream): self.__writer = core.StreamWriter(stream, False) @@ -226,6 +232,8 @@ class StreamIOWrapper(io.IOBase): result += self.__reader.extractBytes(512) return result + read1 = read + def readline(self, size=-1): if not self.__reader: if not self.__writer: diff --git a/dtool/src/prc/streamWriter.I b/dtool/src/prc/streamWriter.I index ce4500a475..4c388c387f 100644 --- a/dtool/src/prc/streamWriter.I +++ b/dtool/src/prc/streamWriter.I @@ -395,7 +395,7 @@ add_fixed_string(const string &str, size_t size) { //////////////////////////////////////////////////////////////////// // Function: StreamWriter::append_data -// Access: Published +// Access: Public // Description: Appends some more raw data to the end of the // streamWriter. //////////////////////////////////////////////////////////////////// @@ -406,7 +406,7 @@ append_data(const void *data, size_t size) { //////////////////////////////////////////////////////////////////// // Function: StreamWriter::append_data -// Access: Published +// Access: Public // Description: Appends some more raw data to the end of the // streamWriter. //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/prc/streamWriter.h b/dtool/src/prc/streamWriter.h index b63feaf6b1..eb1f3bcf67 100644 --- a/dtool/src/prc/streamWriter.h +++ b/dtool/src/prc/streamWriter.h @@ -71,13 +71,16 @@ PUBLISHED: BLOCKING INLINE void add_fixed_string(const string &str, size_t size); BLOCKING void pad_bytes(size_t size); - BLOCKING INLINE void append_data(const void *data, size_t size); - BLOCKING INLINE void append_data(const string &data); + EXTENSION(void append_data(PyObject *data)); BLOCKING INLINE void flush(); BLOCKING INLINE void write(const string &str); +public: + BLOCKING INLINE void append_data(const void *data, size_t size); + BLOCKING INLINE void append_data(const string &data); + private: ostream *_out; bool _owns_stream; diff --git a/panda/src/express/p3express_ext_composite.cxx b/panda/src/express/p3express_ext_composite.cxx index 1dab5d4477..e034261ae3 100644 --- a/panda/src/express/p3express_ext_composite.cxx +++ b/panda/src/express/p3express_ext_composite.cxx @@ -3,6 +3,7 @@ #include "memoryUsagePointers_ext.cxx" #include "ramfile_ext.cxx" #include "streamReader_ext.cxx" +#include "streamWriter_ext.cxx" #include "typeHandle_ext.cxx" #include "virtualFileSystem_ext.cxx" #include "virtualFile_ext.cxx" diff --git a/panda/src/express/streamWriter_ext.cxx b/panda/src/express/streamWriter_ext.cxx new file mode 100644 index 0000000000..552b2a7dbd --- /dev/null +++ b/panda/src/express/streamWriter_ext.cxx @@ -0,0 +1,39 @@ +// Filename: streamWriter_ext.cxx +// Created by: rdb (19Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "streamWriter_ext.h" + +#ifdef HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: StreamWriter::append_data +// Access: Published +// Description: Appends some more raw data to the end of the +// StreamWriter. +//////////////////////////////////////////////////////////////////// +void Extension:: +append_data(PyObject *data) { + cerr << "getting here: " << data << "\n"; + Py_buffer view; + if (PyObject_GetBuffer(data, &view, PyBUF_CONTIG_RO) == -1) { + //PyErr_SetString(PyExc_TypeError, + // "append_data() requires a contiguous buffer"); + return; + } + + _this->append_data(view.buf, view.len); + PyBuffer_Release(&view); +} + +#endif diff --git a/panda/src/express/streamWriter_ext.h b/panda/src/express/streamWriter_ext.h new file mode 100644 index 0000000000..e8e1b270cd --- /dev/null +++ b/panda/src/express/streamWriter_ext.h @@ -0,0 +1,40 @@ +// Filename: streamWriter_ext.h +// Created by: rdb (19Sep15) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef STREAMWRITER_EXT_H +#define STREAMWRITER_EXT_H + +#include "dtoolbase.h" + +#ifdef HAVE_PYTHON + +#include "extension.h" +#include "streamWriter.h" +#include "py_panda.h" + +//////////////////////////////////////////////////////////////////// +// Class : Extension +// Description : This class defines the extension methods for +// StreamWriter, which are called instead of +// any C++ methods with the same prototype. +//////////////////////////////////////////////////////////////////// +template<> +class Extension : public ExtensionBase { +public: + void append_data(PyObject *data); +}; + +#endif // HAVE_PYTHON + +#endif // STREAMWriter_EXT_H From 532bee3b9ef50c5080797f9454fa86767d9ad361 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 23 Sep 2015 11:57:55 +0200 Subject: [PATCH 183/203] More fixes to Python 3 rtdist, frozen p3dpython building, new open --- direct/src/showbase/VFSImporter.py | 48 ++++++++++------------ direct/src/showutil/FreezeTool.py | 4 ++ makepanda/makepanda.py | 6 ++- makepanda/makepandacore.py | 56 ++++++++++++++------------ panda/src/express/streamWriter_ext.cxx | 5 +-- 5 files changed, 64 insertions(+), 55 deletions(-) diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index e7be781c45..e092775e6e 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -25,12 +25,6 @@ sharedPackages = {} vfs = VirtualFileSystem.getGlobalPtr() -# Possible file types. -FTPythonSource = 0 -FTPythonCompiled = 1 -FTExtensionModule = 2 -FTFrozenModule = 3 - compiledExtensions = [ 'pyc', 'pyo' ] if not __debug__: # In optimized mode, we prefer loading .pyo files over .pyc files. @@ -44,7 +38,10 @@ class VFSImporter: (among other places). """ def __init__(self, path): - self.dir_path = Filename.fromOsSpecific(path) + if isinstance(path, Filename): + self.dir_path = Filename(path) + else: + self.dir_path = Filename.fromOsSpecific(path) def find_module(self, fullname, path = None): if path is None: @@ -60,7 +57,8 @@ class VFSImporter: filename.setExtension('py') vfile = vfs.getFile(filename, True) if vfile: - return VFSLoader(dir_path, vfile, filename, FTPythonSource) + return VFSLoader(dir_path, vfile, filename, + desc=('.py', 'U', imp.PY_SOURCE)) # If there's no .py file, but there's a .pyc file, load that # anyway. @@ -69,7 +67,8 @@ class VFSImporter: filename.setExtension(ext) vfile = vfs.getFile(filename, True) if vfile: - return VFSLoader(dir_path, vfile, filename, FTPythonCompiled) + return VFSLoader(dir_path, vfile, filename, + desc=('.'+ext, 'rb', imp.PY_COMPILED)) # Look for a C/C++ extension module. for desc in imp.get_suffixes(): @@ -79,22 +78,21 @@ class VFSImporter: filename = Filename(path + desc[0]) vfile = vfs.getFile(filename, True) if vfile: - return VFSLoader(dir_path, vfile, filename, FTExtensionModule, - desc = desc) + return VFSLoader(dir_path, vfile, filename, desc=desc) # Finally, consider a package, i.e. a directory containing # __init__.py. filename = Filename(path, '__init__.py') vfile = vfs.getFile(filename, True) if vfile: - return VFSLoader(dir_path, vfile, filename, FTPythonSource, - packagePath = path) + return VFSLoader(dir_path, vfile, filename, packagePath=path, + desc=('.py', 'U', imp.PY_SOURCE)) for ext in compiledExtensions: filename = Filename(path, '__init__.' + ext) vfile = vfs.getFile(filename, True) if vfile: - return VFSLoader(dir_path, vfile, filename, FTPythonCompiled, - packagePath = path) + return VFSLoader(dir_path, vfile, filename, packagePath=path, + desc=('.'+ext, 'rb', imp.PY_COMPILED)) #print >>sys.stderr, "not found." return None @@ -103,22 +101,20 @@ class VFSLoader: """ The second part of VFSImporter, this is created for a particular .py file or directory. """ - def __init__(self, dir_path, vfile, filename, fileType, - desc = None, packagePath = None): + def __init__(self, dir_path, vfile, filename, desc, packagePath=None): self.dir_path = dir_path self.timestamp = None if vfile: self.timestamp = vfile.getTimestamp() self.filename = filename - self.fileType = fileType self.desc = desc self.packagePath = packagePath def load_module(self, fullname, loadingShared = False): #print >>sys.stderr, "load_module(%s), dir_path = %s, filename = %s" % (fullname, self.dir_path, self.filename) - if self.fileType == FTFrozenModule: + if self.desc[2] == imp.PY_FROZEN: return self._import_frozen_module(fullname) - if self.fileType == FTExtensionModule: + if self.desc[2] == imp.C_EXTENSION: return self._import_extension_module(fullname) # Check if this is a child of a shared package. @@ -152,7 +148,7 @@ class VFSLoader: path = Filename(self.dir_path, Filename.fromOsSpecific(path)) vfile = vfs.getFile(path) if not vfile: - raise IOError + raise IOError("Could not find '%s'" % (path)) return vfile.readFile(True) def is_package(self, fullname): @@ -171,8 +167,8 @@ class VFSLoader: """ Returns the Python source for this file, if it is available, or None if it is not. May raise IOError. """ - if self.fileType == FTPythonCompiled or \ - self.fileType == FTExtensionModule: + if self.desc[2] == imp.PY_COMPILED or \ + self.desc[2] == imp.C_EXTENSION: return None filename = Filename(self.filename) @@ -180,7 +176,7 @@ class VFSLoader: filename.setText() vfile = vfs.getFile(filename) if not vfile: - raise IOError + raise IOError("Could not find '%s'" % (filename)) return vfile.readFile(True) def _import_extension_module(self, fullname): @@ -242,14 +238,14 @@ class VFSLoader: ValueError, SyntaxError, or a number of other errors generated by the low-level system. """ - if self.fileType == FTPythonCompiled: + if self.desc[2] == imp.PY_COMPILED: # It's a pyc file; just read it directly. pycVfile = vfs.getFile(self.filename, False) if pycVfile: return self._loadPyc(pycVfile, None) raise IOError('Could not read %s' % (self.filename)) - elif self.fileType == FTExtensionModule: + elif self.desc[2] == imp.C_EXTENSION: return None # It's a .py file (or an __init__.py file; same thing). Read diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index cd303697f2..4b186d1eeb 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -1386,6 +1386,10 @@ class PandaModuleFinder(modulefinder.ModuleFinder): modulefinder.ModuleFinder.__init__(self, *args, **kw) def find_module(self, name, path, *args, **kwargs): + if imp.is_frozen(name): + # Don't pick up modules that are frozen into p3dpython. + raise ImportError("'%s' is a frozen module" % (name)) + try: return modulefinder.ModuleFinder.find_module(self, name, path, *args, **kwargs) except ImportError: diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 464f798ced..b536140238 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -5049,7 +5049,11 @@ if (RTDIST or RUNTIME): TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj') if (PkgSkip("PYTHON")==0 and RTDIST): - TargetAdd('p3dpython_frozen.obj', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'], input='VFSImporter.py') + # Freeze VFSImporter and its dependency modules into p3dpython. + # Mark panda3d.core as a dependency to make sure to build that first. + TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP']) + TargetAdd('p3dpython_frozen.obj', dep='panda3d/core.py') + TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx') TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx') TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj') diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index e5913a1c84..c9639ab1c7 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -2302,7 +2302,9 @@ def SetupBuildEnvironment(compiler): print("Target arch: %s" % GetTargetArch()) # Set to English so we can safely parse the result of gcc commands. - os.environ["LC_ALL"] = "C" + # Setting it to UTF-8 is necessary for Python 3 modules to import + # correctly. + os.environ["LC_ALL"] = "en_US.UTF-8" if compiler == "MSVC": # Add the visual studio tools to PATH et al. @@ -2842,11 +2844,11 @@ class Target: TARGET_LIST = [] TARGET_TABLE = {} -def TargetAdd(target, dummy=0, opts=0, input=0, dep=0, ipath=0, winrc=0): +def TargetAdd(target, dummy=0, opts=[], input=[], dep=[], ipath=None, winrc=None): if (dummy != 0): exit("Syntax error in TargetAdd "+target) - if (ipath == 0): ipath = opts - if (ipath == 0): ipath = [] + if ipath is None: ipath = opts + if not ipath: ipath = [] if (type(input) == str): input = [input] if (type(dep) == str): dep = [dep] @@ -2867,30 +2869,34 @@ def TargetAdd(target, dummy=0, opts=0, input=0, dep=0, ipath=0, winrc=0): else: t = TARGET_TABLE[full] - if opts != 0: - for x in opts: - if (t.opts.count(x)==0): - t.opts.append(x) + for x in opts: + if x not in t.opts: + t.opts.append(x) ipath = [OUTPUTDIR + "/tmp"] + GetListOption(ipath, "DIR:") + [OUTPUTDIR+"/include"] - if input != 0: - for x in input: - fullinput = FindLocation(x, ipath) - t.inputs.append(fullinput) - # Don't re-link a library or binary if just its dependency dlls have been altered. - # This should work out fine in most cases, and often reduces recompilation time. - if (os.path.splitext(x)[-1] not in SUFFIX_DLL): - t.deps[fullinput] = 1 - (base,suffix) = os.path.splitext(x) - if (SUFFIX_INC.count(suffix)): - for d in CxxCalcDependencies(fullinput, ipath, []): - t.deps[d] = 1 - if dep != 0: - for x in dep: - fulldep = FindLocation(x, ipath) - t.deps[fulldep] = 1 + for x in input: + fullinput = FindLocation(x, ipath) + t.inputs.append(fullinput) + # Don't re-link a library or binary if just its dependency dlls have been altered. + # This should work out fine in most cases, and often reduces recompilation time. + if (os.path.splitext(x)[-1] not in SUFFIX_DLL): + t.deps[fullinput] = 1 + (base,suffix) = os.path.splitext(x) + if (SUFFIX_INC.count(suffix)): + for d in CxxCalcDependencies(fullinput, ipath, []): + t.deps[d] = 1 - if winrc != 0 and GetTarget() == 'windows': + if x.endswith(".in"): + # Mark the _igate.cxx file as a dependency also. + outbase = os.path.basename(x)[:-3] + woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx" + t.deps[woutc] = 1 + + for x in dep: + fulldep = FindLocation(x, ipath) + t.deps[fulldep] = 1 + + if winrc and GetTarget() == 'windows': TargetAdd(target, input=WriteResourceFile(target.split("/")[-1].split(".")[0], **winrc)) if target.endswith(".in"): diff --git a/panda/src/express/streamWriter_ext.cxx b/panda/src/express/streamWriter_ext.cxx index 552b2a7dbd..68d7d39bc0 100644 --- a/panda/src/express/streamWriter_ext.cxx +++ b/panda/src/express/streamWriter_ext.cxx @@ -24,11 +24,10 @@ //////////////////////////////////////////////////////////////////// void Extension:: append_data(PyObject *data) { - cerr << "getting here: " << data << "\n"; Py_buffer view; if (PyObject_GetBuffer(data, &view, PyBUF_CONTIG_RO) == -1) { - //PyErr_SetString(PyExc_TypeError, - // "append_data() requires a contiguous buffer"); + PyErr_SetString(PyExc_TypeError, + "append_data() requires a contiguous buffer"); return; } From fcd3bfd15ce941771367e44f7092468659011df9 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 28 Sep 2015 13:08:38 +0200 Subject: [PATCH 184/203] Fix interrogate issues with long, streampos, streamoff, streamsize and ptrdiff_t --- .../interfaceMakerPythonNative.cxx | 50 +++++++++++-------- dtool/src/interrogate/typeManager.cxx | 39 ++++++++++++++- dtool/src/interrogate/typeManager.h | 1 + dtool/src/interrogatedb/py_panda.h | 2 + dtool/src/parser-inc/iostream | 8 +++ dtool/src/parser-inc/stdint.h | 2 +- 6 files changed, 80 insertions(+), 22 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 1078582d53..5a2dd24e41 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -4848,17 +4848,32 @@ write_function_instance(ostream &out, FunctionRemap *remap, // Windows, where longs are the same size as ints. // BUG: does not catch negative values on Windows when going through // the PyArg_ParseTuple case. - extra_convert - << "#if (SIZEOF_LONG > SIZEOF_INT) && !defined(NDEBUG)\n" - << "if (" << param_name << " > UINT_MAX) {\n"; + if (!TypeManager::is_long(type)) { + extra_convert + << "#if (SIZEOF_LONG > SIZEOF_INT) && !defined(NDEBUG)\n" + << "if (" << param_name << " > UINT_MAX) {\n"; - error_raise_return(extra_convert, 2, return_flags, "OverflowError", - "value %lu out of range for unsigned integer", - param_name); - extra_convert - << "}\n" - << "#endif\n"; + error_raise_return(extra_convert, 2, return_flags, "OverflowError", + "value %lu out of range for unsigned integer", + param_name); + extra_convert + << "}\n" + << "#endif\n"; + } + expected_params += "int"; + only_pyobjects = false; + + } else if (TypeManager::is_long(type)) { + // Signed longs are equivalent to Python's int type. + if (args_type == AT_single_arg) { + pexpr_string = "PyLongOrInt_AS_LONG(arg)"; + type_check = "PyLongOrInt_Check(arg)"; + } else { + indent(out, indent_level) << "long " << param_name << default_expr << ";\n"; + format_specifiers += "l"; + parameter_list += ", &" + param_name; + } expected_params += "int"; only_pyobjects = false; @@ -4877,6 +4892,7 @@ write_function_instance(ostream &out, FunctionRemap *remap, error_raise_return(extra_convert, 2, return_flags, "OverflowError", "value %ld out of range for signed integer", "arg_val"); + extra_convert << "}\n" << "#endif\n"; @@ -5934,6 +5950,10 @@ pack_return_value(ostream &out, int indent_level, FunctionRemap *remap, indent(out, indent_level) << "return PyBool_FromLong(" << return_expr << ");\n"; + } else if (TypeManager::is_ssize(type)) { + indent(out, indent_level) + << "return PyLongOrInt_FromSsize_t(" << return_expr << ");\n"; + } else if (TypeManager::is_size(type)) { indent(out, indent_level) << "return PyLongOrInt_FromSize_t(" << return_expr << ");\n"; @@ -5960,22 +5980,12 @@ pack_return_value(ostream &out, int indent_level, FunctionRemap *remap, << "return PyLong_FromLongLong(" << return_expr << ");\n"; } else if (TypeManager::is_unsigned_integer(type)){ - out << "#if PY_MAJOR_VERSION >= 3\n"; - indent(out, indent_level) - << "return PyLong_FromUnsignedLong(" << return_expr << ");\n"; - out << "#else\n"; indent(out, indent_level) << "return PyLongOrInt_FromUnsignedLong(" << return_expr << ");\n"; - out << "#endif\n"; } else if (TypeManager::is_integer(type)) { - out << "#if PY_MAJOR_VERSION >= 3\n"; indent(out, indent_level) - << "return PyLong_FromLong(" << return_expr << ");\n"; - out << "#else\n"; - indent(out, indent_level) - << "return PyInt_FromLong(" << return_expr << ");\n"; - out << "#endif\n"; + << "return PyLongOrInt_FromLong(" << return_expr << ");\n"; } else if (TypeManager::is_float(type)) { indent(out, indent_level) diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index fa78d89664..ab048b52c8 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -1142,6 +1142,9 @@ is_size(CPPType *type) { // Access: Public, Static // Description: Returns true if the indicated type is the "ssize_t" // type, or a const ssize_t, or a typedef to either. +// ptrdiff_t and streamsize are also accepted, since +// they are usually also defined as the signed +// counterpart to size_t. //////////////////////////////////////////////////////////////////// bool TypeManager:: is_ssize(CPPType *type) { @@ -1151,7 +1154,9 @@ is_ssize(CPPType *type) { case CPPDeclaration::ST_typedef: if (type->get_simple_name() == "Py_ssize_t" || - type->get_simple_name() == "ssize_t") { + type->get_simple_name() == "ssize_t" || + type->get_simple_name() == "ptrdiff_t" || + type->get_simple_name() == "streamsize") { return is_integer(type->as_typedef_type()->_type); } else { return is_ssize(type->as_typedef_type()->_type); @@ -1164,6 +1169,38 @@ is_ssize(CPPType *type) { return false; } +//////////////////////////////////////////////////////////////////// +// Function: TypeManager::is_long +// Access: Public, Static +// Description: Returns true if the indicated type is the "long" +// type, whether signed or unsigned. +//////////////////////////////////////////////////////////////////// +bool TypeManager:: +is_long(CPPType *type) { + switch (type->get_subtype()) { + case CPPDeclaration::ST_const: + return is_long(type->as_const_type()->_wrapped_around); + + case CPPDeclaration::ST_simple: + { + CPPSimpleType *simple_type = type->as_simple_type(); + if (simple_type != (CPPSimpleType *)NULL) { + return (simple_type->_type == CPPSimpleType::T_int && + (simple_type->_flags & CPPSimpleType::F_long) != 0); + } + } + break; + + case CPPDeclaration::ST_typedef: + return is_long(type->as_typedef_type()->_type); + + default: + break; + } + + return false; +} + //////////////////////////////////////////////////////////////////// // Function: TypeManager::is_short // Access: Public, Static diff --git a/dtool/src/interrogate/typeManager.h b/dtool/src/interrogate/typeManager.h index 16b9dfda22..4b29845971 100644 --- a/dtool/src/interrogate/typeManager.h +++ b/dtool/src/interrogate/typeManager.h @@ -89,6 +89,7 @@ public: static bool is_unsigned_integer(CPPType *type); static bool is_size(CPPType *type); static bool is_ssize(CPPType *type); + static bool is_long(CPPType *type); static bool is_short(CPPType *type); static bool is_unsigned_short(CPPType *type); static bool is_longlong(CPPType *type); diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 7ad2e5857a..0c4c47f3f3 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -112,6 +112,7 @@ inline PyObject* doPy_RETURN_FALSE() #define PyLongOrInt_Check(x) PyLong_Check(x) #define PyLongOrInt_FromSize_t PyLong_FromSize_t +#define PyLongOrInt_FromSsize_t PyLong_FromSsize_t #define PyLongOrInt_FromLong PyLong_FromLong #define PyLongOrInt_FromUnsignedLong PyLong_FromUnsignedLong #define PyLongOrInt_AS_LONG PyLong_AS_LONG @@ -122,6 +123,7 @@ inline PyObject* doPy_RETURN_FALSE() #define PyLongOrInt_Check(x) (PyInt_Check(x) || PyLong_Check(x)) // PyInt_FromSize_t automatically picks the right type. #define PyLongOrInt_FromSize_t PyInt_FromSize_t +#define PyLongOrInt_FromSsize_t PyInt_FromSsize_t #define PyLongOrInt_FromLong PyInt_FromLong #define PyLongOrInt_AS_LONG PyInt_AsLong diff --git a/dtool/src/parser-inc/iostream b/dtool/src/parser-inc/iostream index 87fd92ebcd..fac16148b4 100644 --- a/dtool/src/parser-inc/iostream +++ b/dtool/src/parser-inc/iostream @@ -47,8 +47,16 @@ __published: class ios : public ios_base { __published: typedef long fmtflags; +#ifdef _WIN64 + typedef unsigned __int64 streampos; + typedef __int64 streamoff; +#elif defined(_WIN32) typedef unsigned long streampos; typedef long streamoff; +#else + typedef unsigned long long streampos; + typedef long long streamoff; +#endif bool good() const; bool eof() const; diff --git a/dtool/src/parser-inc/stdint.h b/dtool/src/parser-inc/stdint.h index 060dbf82e7..11fba7a776 100644 --- a/dtool/src/parser-inc/stdint.h +++ b/dtool/src/parser-inc/stdint.h @@ -15,7 +15,7 @@ #ifndef _STDINT_H #define _STDINT_H -#ifdef _LP64 +#if defined(_LP64) || defined(_WIN64) #define __WORDSIZE 64 #else #define __WORDSIZE 32 From a902f1628b24a6123b9279333944585aa7689d80 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 28 Sep 2015 13:25:17 +0200 Subject: [PATCH 185/203] Fix Win64 compilation --- dtool/src/parser-inc/iostream | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dtool/src/parser-inc/iostream b/dtool/src/parser-inc/iostream index fac16148b4..296a324149 100644 --- a/dtool/src/parser-inc/iostream +++ b/dtool/src/parser-inc/iostream @@ -47,15 +47,13 @@ __published: class ios : public ios_base { __published: typedef long fmtflags; -#ifdef _WIN64 - typedef unsigned __int64 streampos; - typedef __int64 streamoff; -#elif defined(_WIN32) - typedef unsigned long streampos; - typedef long streamoff; -#else +#if defined(_WIN64) || !defined(_WIN32) typedef unsigned long long streampos; typedef long long streamoff; +#else + // 32-bit Windows uses 32-bit stream offsets. + typedef unsigned long streampos; + typedef long streamoff; #endif bool good() const; From 1ccf1cf29b73cc7d1817d90cda666a50ce7e4910 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 30 Sep 2015 14:06:12 +0200 Subject: [PATCH 186/203] Port pdeploy to Python 3 --- direct/src/p3d/DeploymentTools.py | 107 +++++++++++++++++------------- direct/src/p3d/HostInfo.py | 23 +++---- direct/src/p3d/PackageInfo.py | 3 +- direct/src/stdpy/file.py | 15 +---- 4 files changed, 75 insertions(+), 73 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 880a32f7f5..7f18bd10e7 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -5,7 +5,7 @@ to build for as many platforms as possible. """ __all__ = ["Standalone", "Installer"] import os, sys, subprocess, tarfile, shutil, time, zipfile, socket, getpass, struct -from cStringIO import StringIO +from io import BytesIO, TextIOWrapper from direct.directnotify.DirectNotifyGlobal import * from direct.showbase.AppRunnerGlobal import appRunner from panda3d.core import PandaSystem, HTTPClient, Filename, VirtualFileSystem, Multifile @@ -21,8 +21,8 @@ try: except ImportError: pwd = None -# Make sure this matches with the magic in p3dEmbed.cxx. -P3DEMBED_MAGIC = "\xFF\x3D\x3D\x00" +# Make sure this matches with the magic in p3dEmbedMain.cxx. +P3DEMBED_MAGIC = 0xFF3D3D00 # This filter function is used when creating # an archive that should be owned by root. @@ -161,10 +161,10 @@ class Standalone: # Find the magic size string and replace it with the real size, # regardless of the endianness of the p3dembed executable. - hex_size = hex(size)[2:].rjust(8, "0") - enc_size = "".join([chr(int(hex_size[i] + hex_size[i + 1], 16)) for i in range(0, len(hex_size), 2)]) - p3dembed_data = p3dembed_data.replace(P3DEMBED_MAGIC, enc_size) - p3dembed_data = p3dembed_data.replace(P3DEMBED_MAGIC[::-1], enc_size[::-1]) + p3dembed_data = p3dembed_data.replace(struct.pack('>I', P3DEMBED_MAGIC), + struct.pack('>I', size)) + p3dembed_data = p3dembed_data.replace(struct.pack('>controlfile, "Package: %s" % self.shortname.lower() - print >>controlfile, "Version: %s" % self.version - print >>controlfile, "Maintainer: %s <%s>" % (self.authorname, self.authoremail) - print >>controlfile, "Section: games" - print >>controlfile, "Priority: optional" - print >>controlfile, "Architecture: %s" % arch - print >>controlfile, "Installed-Size: %d" % -(-totsize / 1024) - print >>controlfile, "Description: %s" % self.fullname - print >>controlfile, "Depends: libc6, libgcc1, libstdc++6, libx11-6" + controlfile = BytesIO() + cout = TextIOWrapper(controlfile, encoding='utf-8', newline='') + cout.write(u"Package: %s\n" % self.shortname.lower()) + cout.write(u"Version: %s\n" % self.version) + cout.write(u"Maintainer: %s <%s>\n" % (self.authorname, self.authoremail)) + cout.write(u"Section: games\n") + cout.write(u"Priority: optional\n") + cout.write(u"Architecture: %s\n" % arch) + cout.write(u"Installed-Size: %d\n" % -(-totsize // 1024)) + cout.write(u"Description: %s\n" % self.fullname) + cout.write(u"Depends: libc6, libgcc1, libstdc++6, libx11-6\n") + cout.flush() controlinfo = TarInfoRoot("control") controlinfo.mtime = modtime controlinfo.size = controlfile.tell() @@ -820,33 +825,43 @@ class Installer: if output.exists(): output.unlink() debfile = open(output.toOsSpecific(), "wb") - debfile.write("!\x0A") - debfile.write("debian-binary %-12lu0 0 100644 %-10ld\x60\x0A" % (modtime, 4)) - debfile.write("2.0\x0A") + debfile.write(b"!\x0A") + pad_mtime = str(modtime).encode().ljust(12, b' ') - # Write the control.tar.gz to the archive. - debfile.write("control.tar.gz %-12lu0 0 100644 %-10ld\x60\x0A" % (modtime, 0)) + # The first entry is a special file that marks it a .deb. + debfile.write(b"debian-binary ") + debfile.write(pad_mtime) + debfile.write(b"0 0 100644 4 \x60\x0A") + debfile.write(b"2.0\x0A") + + # Write the control.tar.gz to the archive. We'll leave the + # size 0 for now, and go back and fill it in later. + debfile.write(b"control.tar.gz ") + debfile.write(pad_mtime) + debfile.write(b"0 0 100644 0 \x60\x0A") ctaroffs = debfile.tell() ctarfile = tarfile.open("control.tar.gz", "w:gz", debfile, tarinfo = TarInfoRoot) ctarfile.addfile(controlinfo, controlfile) ctarfile.close() ctarsize = debfile.tell() - ctaroffs - if (ctarsize & 1): debfile.write("\x0A") + if (ctarsize & 1): debfile.write(b"\x0A") - # Write the data.tar.gz to the archive. - debfile.write("data.tar.gz %-12lu0 0 100644 %-10ld\x60\x0A" % (modtime, 0)) + # Write the data.tar.gz to the archive. Again, leave size 0. + debfile.write(b"data.tar.gz ") + debfile.write(pad_mtime) + debfile.write(b"0 0 100644 0 \x60\x0A") dtaroffs = debfile.tell() dtarfile = tarfile.open("data.tar.gz", "w:gz", debfile, tarinfo = TarInfoRoot) dtarfile.add(Filename(tempdir, "usr").toOsSpecific(), "/usr") dtarfile.close() dtarsize = debfile.tell() - dtaroffs - if (dtarsize & 1): debfile.write("\x0A") + if (dtarsize & 1): debfile.write(b"\x0A") # Write the correct sizes of the archives. debfile.seek(ctaroffs - 12) - debfile.write("%-10ld" % ctarsize) + debfile.write(str(ctarsize).encode().ljust(10, b' ')) debfile.seek(dtaroffs - 12) - debfile.write("%-10ld" % dtarsize) + debfile.write(str(dtarsize).encode().ljust(10, b' ')) debfile.close() @@ -873,18 +888,20 @@ class Installer: tempdir, totsize = self.__buildTempLinux(platform) # Create a pkginfo file in memory. - pkginfo = StringIO() - print >>pkginfo, "# Generated using pdeploy" - print >>pkginfo, "# %s" % time.ctime(modtime) - print >>pkginfo, "pkgname = %s" % self.shortname.lower() - print >>pkginfo, "pkgver = %s" % pkgver - print >>pkginfo, "pkgdesc = %s" % self.fullname - print >>pkginfo, "builddate = %s" % modtime - print >>pkginfo, "packager = %s <%s>" % (self.authorname, self.authoremail) - print >>pkginfo, "size = %d" % totsize - print >>pkginfo, "arch = %s" % arch + pkginfo = BytesIO() + pout = TextIOWrapper(pkginfo, encoding='utf-8', newline='') + pout.write(u"# Generated using pdeploy\n") + pout.write(u"# %s\n" % time.ctime(modtime)) + pout.write(u"pkgname = %s\n" % self.shortname.lower()) + pout.write(u"pkgver = %s\n" % pkgver) + pout.write(u"pkgdesc = %s\n" % self.fullname) + pout.write(u"builddate = %s\n" % modtime) + pout.write(u"packager = %s <%s>\n" % (self.authorname, self.authoremail)) + pout.write(u"size = %d\n" % totsize) + pout.write(u"arch = %s\n" % arch) if self.licensename != "": - print >>pkginfo, "license = %s" % self.licensename + pout.write(u"license = %s\n" % self.licensename) + pout.flush() pkginfoinfo = TarInfoRoot(".PKGINFO") pkginfoinfo.mtime = modtime pkginfoinfo.size = pkginfo.tell() diff --git a/direct/src/p3d/HostInfo.py b/direct/src/p3d/HostInfo.py index da5d9723c4..ad9942c6a0 100644 --- a/direct/src/p3d/HostInfo.py +++ b/direct/src/p3d/HostInfo.py @@ -513,18 +513,15 @@ class HostInfo: PackageInfo, returns it. """ if not platform: - # Ensure that we're on the same page with non-specified - # platforms. We have to use the empty string, not None, - # since Python 3 can't sort lists with both strings and None. - platform = "" + platform = None - platforms = self.packages.setdefault((name, version), {}) - package = platforms.get(platform, None) + platforms = self.packages.setdefault((name, version or ""), {}) + package = platforms.get("", None) if not package: package = PackageInfo(self, name, version, platform = platform, solo = solo, asMirror = self.asMirror, perPlatform = perPlatform) - platforms[platform] = package + platforms[platform or ""] = package return package @@ -534,12 +531,12 @@ class HostInfo: platform, if one is provided by this host, or None if not. """ assert self.hasContentsFile - platforms = self.packages.get((name, version or None), {}) + platforms = self.packages.get((name, version or ""), {}) - if platform is not None: + if platform: # In this case, we are looking for a specific platform # only. - return platforms.get(platform or None, None) + return platforms.get(platform, None) # We are looking for one matching the current runtime # platform. First, look for a package matching the current @@ -548,7 +545,7 @@ class HostInfo: # If not found, look for one matching no particular platform. if not package: - package = platforms.get(None, None) + package = platforms.get("", None) return package @@ -564,7 +561,7 @@ class HostInfo: if name and pn != name: continue - if platform is None: + if not platform: for p2 in platforms: package = self.getPackage(pn, version, platform = p2) if package: @@ -596,7 +593,7 @@ class HostInfo: # current platform, or no particular platform. package = platforms.get(PandaSystem.getPlatform(), None) if not package: - package = platforms.get(None, None) + package = platforms.get("", None) if package: result.append(package) diff --git a/direct/src/p3d/PackageInfo.py b/direct/src/p3d/PackageInfo.py index b48392dd28..08a73365b8 100644 --- a/direct/src/p3d/PackageInfo.py +++ b/direct/src/p3d/PackageInfo.py @@ -523,7 +523,8 @@ class PackageInfo: # In case of unexpected failures on the internet, we will retry # the full download instead of just giving up. - for retry in range(core.ConfigVariableInt('package-full-dl-retries', 1)): + retries = core.ConfigVariableInt('package-full-dl-retries', 1).getValue() + for retry in range(retries): self.installPlans.append(planB[:]) pc.stop() diff --git a/direct/src/stdpy/file.py b/direct/src/stdpy/file.py index 463eb8639c..c7b198be50 100644 --- a/direct/src/stdpy/file.py +++ b/direct/src/stdpy/file.py @@ -15,6 +15,7 @@ import sys import os import io import encodings +from posixpath import join _vfs = core.VirtualFileSystem.getGlobalPtr() @@ -331,20 +332,6 @@ def walk(top, topdown = True, onerror = None, followlinks = True): if not topdown: yield (top, dirnames, filenames) -def join(path, *args): - for part in args: - if part == '': - continue - - if part.startswith('/'): - path = part - elif path.endswith('/'): - path = path + part - else: - path = '/'.join((path, part)) - - return path - def isfile(path): return _vfs.isRegularFile(core.Filename.fromOsSpecific(path)) From 30a26bc530bfe4a481219ec17fc211e18d29d734 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 30 Sep 2015 16:07:37 +0200 Subject: [PATCH 187/203] Match up interrogate standard typedefs better with gcc/msvc standard typedefs --- dtool/src/dtoolbase/dtoolbase_cc.h | 3 +-- dtool/src/parser-inc/iostream | 23 +++++++++++++---------- dtool/src/parser-inc/stdtypedefs.h | 19 ++++++++++++------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index 60ea4bd37f..a49d5b1477 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -48,7 +48,6 @@ using namespace std; // this maps to public. #define PUBLISHED __published -typedef int streamsize; typedef int ios_openmode; typedef int ios_fmtflags; typedef int ios_iostate; @@ -100,7 +99,7 @@ typedef basic_string wstring; #ifndef HAVE_STREAMSIZE // Some C++ libraries (Irix) don't define this. -typedef int streamsize; +typedef long streamsize; #endif #ifndef HAVE_IOS_TYPEDEFS diff --git a/dtool/src/parser-inc/iostream b/dtool/src/parser-inc/iostream index ea8ac836df..82357c0b96 100644 --- a/dtool/src/parser-inc/iostream +++ b/dtool/src/parser-inc/iostream @@ -20,6 +20,19 @@ #ifndef IOSTREAM_H #define IOSTREAM_H +#include + +#ifdef _WIN64 +typedef long long streamoff; +typedef long long streamsize; +#elif defined(_WIN32) +typedef long streamoff; +typedef int streamsize; +#else +typedef long long streamoff; +typedef ptrdiff_t streamsize; +#endif + // We don't care (much) about the actual definition of the various // iostream classes, but we do need to know the classnames that are // available. @@ -50,14 +63,6 @@ protected: class ios : public ios_base { __published: typedef long fmtflags; -#if defined(_WIN64) || !defined(_WIN32) - typedef unsigned long long streampos; - typedef long long streamoff; -#else - // 32-bit Windows uses 32-bit stream offsets. - typedef unsigned long streampos; - typedef long streamoff; -#endif bool good() const; bool eof() const; @@ -114,6 +119,4 @@ extern istream cin; extern ostream cout; extern ostream cerr; -typedef long streamoff; - #endif diff --git a/dtool/src/parser-inc/stdtypedefs.h b/dtool/src/parser-inc/stdtypedefs.h index 99280ebb4f..cae3ec4c04 100644 --- a/dtool/src/parser-inc/stdtypedefs.h +++ b/dtool/src/parser-inc/stdtypedefs.h @@ -19,25 +19,30 @@ #ifndef STDTYPEDEFS_H #define STDTYPEDEFS_H -#ifndef __APPLE__ -typedef unsigned long size_t; -typedef long ssize_t; typedef int off_t; -typedef unsigned int time_t; -typedef int clock_t; +typedef long time_t; +typedef long clock_t; struct FILE; namespace std { } -#endif -typedef int ptrdiff_t; typedef unsigned int uint; typedef unsigned long ulong; typedef unsigned short ushort; typedef unsigned char uchar; +#ifdef _WIN64 +typedef unsigned long long size_t; +typedef long long ssize_t; +typedef long long ptrdiff_t; +#else +typedef unsigned long size_t; +typedef long ssize_t; +typedef long ptrdiff_t; +#endif + #ifdef __cplusplus #define NULL 0L #else From 9bb968cc8b6869015b9751466fd7c280b85b5016 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 4 Oct 2015 12:56:45 +0200 Subject: [PATCH 188/203] Remove unused methods --- panda/src/pgraph/cullTraverser.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/panda/src/pgraph/cullTraverser.h b/panda/src/pgraph/cullTraverser.h index a174be5b3d..21aa8619d7 100644 --- a/panda/src/pgraph/cullTraverser.h +++ b/panda/src/pgraph/cullTraverser.h @@ -112,9 +112,6 @@ private: static CPT(RenderState) get_bounds_outer_viz_state(); static CPT(RenderState) get_bounds_inner_viz_state(); static CPT(RenderState) get_depth_offset_state(); - void start_decal(const CullTraverserData &data); - CullableObject *r_get_decals(CullTraverserData &data, - CullableObject *decals); GraphicsStateGuardianBase *_gsg; Thread *_current_thread; From 433ed001fa79c0456c7b0830d18ed9e07c67d58d Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 4 Oct 2015 13:00:25 +0200 Subject: [PATCH 189/203] Using strong CMPXCH seems necessary to avoid crash on ARM --- dtool/src/dtoolbase/atomicAdjustGccImpl.I | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolbase/atomicAdjustGccImpl.I b/dtool/src/dtoolbase/atomicAdjustGccImpl.I index 3e462f01cf..6831a16a1e 100644 --- a/dtool/src/dtoolbase/atomicAdjustGccImpl.I +++ b/dtool/src/dtoolbase/atomicAdjustGccImpl.I @@ -125,7 +125,7 @@ compare_and_exchange(TVOLATILE AtomicAdjustGccImpl::Integer &mem, AtomicAdjustGccImpl::Integer old_value, AtomicAdjustGccImpl::Integer new_value) { - __atomic_compare_exchange_n(&mem, &old_value, new_value, true, + __atomic_compare_exchange_n(&mem, &old_value, new_value, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); return old_value; } @@ -142,7 +142,7 @@ compare_and_exchange_ptr(TVOLATILE AtomicAdjustGccImpl::Pointer &mem, AtomicAdjustGccImpl::Pointer old_value, AtomicAdjustGccImpl::Pointer new_value) { - __atomic_compare_exchange_n(&mem, &old_value, new_value, true, + __atomic_compare_exchange_n(&mem, &old_value, new_value, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); return old_value; } From 893740478c1276f511d007d32838d45366a977df Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 4 Oct 2015 17:20:49 +0200 Subject: [PATCH 190/203] Fix sporadic interrogate parser issue --- dtool/src/cppparser/cppPreprocessor.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 4f6384e89d..decd7e30da 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -1469,7 +1469,7 @@ handle_include_directive(const string &args, int first_line, // Don't include it if we included it before and it had #pragma once. ParsedFiles::const_iterator it = _parsed_files.find(file); - if (it->_pragma_once) { + if (it != _parsed_files.end() && it->_pragma_once) { return; } From c6a1626cd3d1e63a86d8ff936b76f8382a15ce75 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 4 Oct 2015 20:20:10 +0200 Subject: [PATCH 191/203] Fix bug: x2egg replaced face normals with vertex normals --- pandatool/src/xfileegg/xFileMesh.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandatool/src/xfileegg/xFileMesh.cxx b/pandatool/src/xfileegg/xFileMesh.cxx index 73e473b087..979650d74e 100644 --- a/pandatool/src/xfileegg/xFileMesh.cxx +++ b/pandatool/src/xfileegg/xFileMesh.cxx @@ -212,6 +212,13 @@ add_material(EggPrimitive *egg_prim) { //////////////////////////////////////////////////////////////////// int XFileMesh:: add_vertex(XFileVertex *vertex) { + if (vertex->_has_color) { + _has_colors = true; + } + if (vertex->_has_uv) { + _has_uvs = true; + } + int next_index = _vertices.size(); _unique_vertices.insert(UniqueVertices::value_type(vertex, next_index)); _vertices.push_back(vertex); @@ -228,6 +235,10 @@ add_vertex(XFileVertex *vertex) { //////////////////////////////////////////////////////////////////// int XFileMesh:: add_normal(XFileNormal *normal) { + if (normal->_has_normal) { + _has_normals = true; + } + int next_index = _normals.size(); _unique_normals.insert(UniqueNormals::value_type(normal, next_index)); _normals.push_back(normal); @@ -244,6 +255,10 @@ add_normal(XFileNormal *normal) { //////////////////////////////////////////////////////////////////// int XFileMesh:: add_material(XFileMaterial *material) { + if (material->has_material()) { + _has_materials = true; + } + int next_index = _materials.size(); _unique_materials.insert(UniqueMaterials::value_type(material, next_index)); _materials.push_back(material); From cb7a0e25200783808e1dde6fee1b4efedc823f23 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 5 Oct 2015 00:45:55 +0200 Subject: [PATCH 192/203] Fix PandaSystem.getCompiler() for clang (it erroneously reported GCC) --- dtool/src/dtoolutil/pandaSystem.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dtool/src/dtoolutil/pandaSystem.cxx b/dtool/src/dtoolutil/pandaSystem.cxx index d54029ecf2..2663797172 100644 --- a/dtool/src/dtoolutil/pandaSystem.cxx +++ b/dtool/src/dtoolutil/pandaSystem.cxx @@ -270,6 +270,11 @@ get_compiler() { return strm.str(); +#elif defined(__clang__) + // Clang has this macro. This case has to go before __GNUC__ + // because that is also defined by clang. + return "Clang " __clang_version__; + #elif defined(__GNUC__) // GCC defines this simple macro. return "GCC " __VERSION__; From ca37b6b6c0a0a3d8307919fe1a2d24433b9deddc Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 5 Oct 2015 02:12:46 +0200 Subject: [PATCH 193/203] Fix VC2015 compile errors, allow selecting any WinSDK/MSVC version. All experimental, still. --- dtool/src/dtoolbase/dtoolbase.h | 2 + dtool/src/dtoolbase/dtoolbase_cc.h | 8 ++ dtool/src/dtoolbase/stl_compares.I | 4 + dtool/src/dtoolutil/lineStream.h | 4 + dtool/src/dtoolutil/pfstream.h | 8 ++ dtool/src/prc/encryptStream.h | 8 ++ makepanda/makepanda.py | 82 +++++++++------ makepanda/makepandacore.py | 118 ++++++++++++++++------ panda/src/downloader/httpDate.cxx | 9 +- panda/src/downloader/multiplexStream.h | 4 + panda/src/downloader/stringStream.h | 4 + panda/src/express/checksumHashGenerator.I | 4 + panda/src/express/subStream.h | 12 +++ panda/src/express/zStream.h | 12 ++- 14 files changed, 211 insertions(+), 68 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 4398036e3a..eee43d50de 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -55,6 +55,8 @@ #pragma warning (disable : 4355) /* C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data */ #pragma warning (disable : 4244) +/* C4577: 'noexcept' used with no exception handling mode specified */ +#pragma warning (disable : 4577) #if _MSC_VER >= 1300 #if _MSC_VER >= 1310 diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index a49d5b1477..abcf7ad3f5 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -166,6 +166,14 @@ typedef ios::seekdir ios_seekdir; # define FINAL final # define OVERRIDE override # define MOVE(x) move(x) +#elif defined(_MSC_VER) && _MSC_VER >= 1900 +// MSVC 2015 supports all of this goodness. +# define CONSTEXPR constexpr +# define NOEXCEPT noexcept +# define USE_MOVE_SEMANTICS +# define FINAL final +# define OVERRIDE override +# define MOVE(x) move(x) #elif defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC 2010 has move semantics. Not much else. # define CONSTEXPR INLINE diff --git a/dtool/src/dtoolbase/stl_compares.I b/dtool/src/dtoolbase/stl_compares.I index 31ac164cad..e0d51b74dd 100644 --- a/dtool/src/dtoolbase/stl_compares.I +++ b/dtool/src/dtoolbase/stl_compares.I @@ -132,7 +132,11 @@ add_hash(size_t hash, const Key &key) { INLINE size_t pointer_hash:: add_hash(size_t hash, const void *key) { // We don't mind if this loses precision. +#ifdef _MSC_VER + PN_uint32 key32 = PtrToUlong(key); +#else PN_uint32 key32 = (PN_uint32)reinterpret_cast(key); +#endif return AddHash::add_hash(hash, &key32, 1); } diff --git a/dtool/src/dtoolutil/lineStream.h b/dtool/src/dtoolutil/lineStream.h index 63358a18ac..fe0e271933 100644 --- a/dtool/src/dtoolutil/lineStream.h +++ b/dtool/src/dtoolutil/lineStream.h @@ -37,6 +37,10 @@ class EXPCL_DTOOL LineStream : public ostream { PUBLISHED: INLINE LineStream(); +#if _MSC_VER >= 1800 + INLINE LineStream(const LineStream ©) = delete; +#endif + INLINE bool is_text_available() const; INLINE string get_line(); INLINE bool has_newline() const; diff --git a/dtool/src/dtoolutil/pfstream.h b/dtool/src/dtoolutil/pfstream.h index d9875f9090..fb6d29f0aa 100644 --- a/dtool/src/dtoolutil/pfstream.h +++ b/dtool/src/dtoolutil/pfstream.h @@ -21,6 +21,10 @@ class EXPCL_DTOOL IPipeStream : public istream { PUBLISHED: INLINE IPipeStream(const std::string); +#if _MSC_VER >= 1800 + INLINE IPipeStream(const IPipeStream ©) = delete; +#endif + INLINE void flush(); private: @@ -33,6 +37,10 @@ class EXPCL_DTOOL OPipeStream : public ostream { PUBLISHED: INLINE OPipeStream(const std::string); +#if _MSC_VER >= 1800 + INLINE OPipeStream(const OPipeStream ©) = delete; +#endif + INLINE void flush(); private: diff --git a/dtool/src/prc/encryptStream.h b/dtool/src/prc/encryptStream.h index bca9c8dc4d..75787d26e8 100644 --- a/dtool/src/prc/encryptStream.h +++ b/dtool/src/prc/encryptStream.h @@ -40,6 +40,10 @@ PUBLISHED: INLINE IDecryptStream(istream *source, bool owns_source, const string &password); +#if _MSC_VER >= 1800 + INLINE IDecryptStream(const IDecryptStream ©) = delete; +#endif + INLINE IDecryptStream &open(istream *source, bool owns_source, const string &password); INLINE IDecryptStream &close(); @@ -69,6 +73,10 @@ PUBLISHED: INLINE OEncryptStream(ostream *dest, bool owns_dest, const string &password); +#if _MSC_VER >= 1800 + INLINE OEncryptStream(const OEncryptStream ©) = delete; +#endif + INLINE OEncryptStream &open(ostream *dest, bool owns_dest, const string &password); INLINE OEncryptStream &close(); diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index b536140238..77712197de 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -64,9 +64,10 @@ PLUGIN_VERSION=None OSXTARGET=None OSX_ARCHS=[] HOST_URL=None -global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER +global STRDXSDKVERSION, BOOUSEINTELCOMPILER STRDXSDKVERSION = 'default' -STRMSPLATFORMVERSION = 'default' +WINDOWS_SDK = None +MSVC_VERSION = None BOOUSEINTELCOMPILER = False OPENCV_VER_23 = False @@ -152,7 +153,8 @@ def usage(problem): print(" --nothing (disable every third-party lib)") print(" --everything (enable every third-party lib)") print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)") - print(" --platform-sdk=X (specify MSPlatSdk to use: win71, win61, win60A, winserver2003r2)") + print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)") + print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)") print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)") print("") print("The simplest way to compile panda is to just type:") @@ -165,13 +167,13 @@ def parseopts(args): global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX - global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER + global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER longopts = [ "help","distributor=","verbose","runtime","osxtarget=", "optimize=","everything","nothing","installer","rtdist","nocolor", "version=","lzma","no-python","threads=","outputdir=","override=", "static","host=","debversion=","rpmrelease=","p3dsuffix=", - "directx-sdk=", "platform-sdk=", "use-icl", + "directx-sdk=", "windows-sdk=", "msvc-version=", "use-icl", "universal", "target=", "arch=", "git-commit="] anything = 0 optimize = "" @@ -222,11 +224,10 @@ def parseopts(args): if STRDXSDKVERSION == '': print("No DirectX SDK version specified. Using 'default' DirectX SDK search") STRDXSDKVERSION = 'default' - elif (option=="--platform-sdk"): - STRMSPLATFORMVERSION = value.strip().lower() - if STRMSPLATFORMVERSION == '': - print("No MS Platform SDK version specified. Using 'default' MS Platform SDK search") - STRMSPLATFORMVERSION = 'default' + elif (option=="--windows-sdk"): + WINDOWS_SDK = value.strip().lower() + elif (option=="--msvc-version"): + MSVC_VERSION = value.strip().lower() elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True else: for pkg in PkgListGet(): @@ -302,17 +303,30 @@ def parseopts(args): if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT): usage("Invalid SHA-1 hash given for --git-commit option!") - is_win7 = False - if GetHost() == "windows": - if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']): - platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder") + if GetTarget() == 'windows': + if not MSVC_VERSION: + print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).") + MSVC_VERSION = 10 - if sys.platform == "win32": - # Note: not available in cygwin. - winver = sys.getwindowsversion() - if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1: - is_win7 = True - if RUNTIME or not is_win7: + try: + MSVC_VERSION = int(MSVC_VERSION) + except: + usage("Invalid setting for --msvc-version") + + if not WINDOWS_SDK: + print("No Windows SDK version specified. Defaulting to '7.1'.") + WINDOWS_SDK = '7.1' + + is_win7 = False + if sys.platform == 'win32': + # Note: not available in cygwin. + winver = sys.getwindowsversion() + if winver[0] >= 6 and winver[1] >= 1: + is_win7 = True + + if RUNTIME or not is_win7: + PkgDisable("TOUCHINPUT") + else: PkgDisable("TOUCHINPUT") parseopts(sys.argv[1:]) @@ -444,8 +458,8 @@ SdkLocateMaya() SdkLocateMax() SdkLocateMacOSX(OSXTARGET) SdkLocatePython(RTDIST) -SdkLocateVisualStudio() -SdkLocateMSPlatform(STRMSPLATFORMVERSION) +SdkLocateVisualStudio(MSVC_VERSION) +SdkLocateWindows(WINDOWS_SDK) SdkLocatePhysX() SdkLocateSpeedTree() SdkLocateAndroid() @@ -1050,6 +1064,10 @@ def CompileCxx(obj,src,opts): if GetTargetArch() == 'x64': cmd += " /DWIN64_VC /DWIN64" + if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > 10: + # To preserve Windows XP compatibility. + cmd += " /D_USING_V110_SDK71_" + cmd += " /W3 " + BracketNameWithQuotes(src) oscmd(cmd) else: @@ -1485,9 +1503,13 @@ def CompileLink(dll, obj, opts): cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO " cmd += ' /OUT:' + BracketNameWithQuotes(dll) - subsystem = GetValueOption(opts, "SUBSYSTEM:") - if subsystem: - cmd += " /SUBSYSTEM:" + subsystem + # Set the subsystem. Specify that we want to target Windows XP. + subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE" + cmd += " /SUBSYSTEM:" + subsystem + if GetTargetArch() == 'x64': + cmd += ",5.02" + else: + cmd += ",5.01" if dll.endswith(".dll"): cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib" @@ -5096,7 +5118,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj') - OPTS=['OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS'] + OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS'] if GetTarget() == 'darwin': OPTS += ['OPT:2'] TargetAdd('p3dcert.exe', opts=OPTS) @@ -5106,7 +5128,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj') TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj') TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj') - OPTS=['OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG'] + OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG'] if GetTarget() == "darwin": OPTS += ['GL', 'OPT:2'] TargetAdd('p3dcert.exe', opts=OPTS) @@ -5236,7 +5258,7 @@ if (RUNTIME): TargetAdd('panda3dw.exe', input='libp3dtool.dll') TargetAdd('panda3dw.exe', input='libp3pystub.lib') TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb') - TargetAdd('panda3dw.exe', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) + TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON']) if (RTDIST): OPTS=['BUILDING:P3D_PLUGIN', 'DIR:direct/src/plugin_standalone', 'DIR:direct/src/plugin', 'DIR:dtool/src/dtoolbase', 'DIR:dtool/src/dtoolutil', 'DIR:dtool/src/pystub', 'DIR:dtool/src/prc', 'DIR:dtool/src/dconfig', 'DIR:panda/src/express', 'DIR:panda/src/downloader', 'RUNTIME', 'P3DEMBED', 'OPENSSL', 'ZLIB'] @@ -5312,7 +5334,7 @@ if (RTDIST): TargetAdd('p3dembedw.exe', input='plugin_common.obj') TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb') TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb') - TargetAdd('p3dembedw.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL']) + TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL']) # # DIRECTORY: pandatool/src/pandatoolbase/ @@ -6041,7 +6063,7 @@ if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0) TargetAdd('pstats.exe', input='libp3pandatoolbase.lib') TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS) TargetAdd('pstats.exe', input='libp3pystub.lib') - TargetAdd('pstats.exe', opts=['WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2']) + TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2']) # # DIRECTORY: pandatool/src/xfileprogs/ diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index c9639ab1c7..7d921ee9d2 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -531,10 +531,12 @@ def oscmd(cmd, ignoreError = False): if res != 0 and not ignoreError: if "interrogate" in cmd.split(" ", 1)[0] and GetVerbose(): print(ColorText("red", "Interrogate failed, retrieving debug output...")) + sys.stdout.flush() + verbose_cmd = cmd.split(" ", 1)[0] + " -vv " + cmd.split(" ", 1)[1] if sys.platform == "win32": - os.spawnl(os.P_WAIT, exe, cmd.split(" ", 1)[0] + " -vv " + cmd.split(" ", 1)[1]) + os.spawnl(os.P_WAIT, exe_path, verbose_cmd) else: - os.system(cmd.split(" ", 1)[0] + " -vv " + cmd.split(" ", 1)[1]) + os.system(verbose_cmd) exit("The following command returned a non-zero value: " + str(cmd)) return res @@ -1946,18 +1948,21 @@ def SdkLocatePython(prefer_thirdparty_python=False): else: print("Using Python %s" % (SDK["PYTHONVERSION"][6:9])) -def SdkLocateVisualStudio(): +def SdkLocateVisualStudio(version=10): if (GetHost() != "windows"): return - vcdir = GetRegistryKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", "10.0") + + version = str(version) + '.0' + + vcdir = GetRegistryKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", version) if (vcdir != 0) and (vcdir[-4:] == "\\VC\\"): vcdir = vcdir[:-3] SDK["VISUALSTUDIO"] = vcdir - elif (os.path.isfile("C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\bin\\cl.exe")): - SDK["VISUALSTUDIO"] = "C:\\Program Files\\Microsoft Visual Studio 10.0\\" + elif (os.path.isfile("C:\\Program Files\\Microsoft Visual Studio %s\\VC\\bin\\cl.exe" % (version))): + SDK["VISUALSTUDIO"] = "C:\\Program Files\\Microsoft Visual Studio %s\\" % (version) - elif (os.path.isfile("C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\cl.exe")): - SDK["VISUALSTUDIO"] = "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\" + elif (os.path.isfile("C:\\Program Files (x86)\\Microsoft Visual Studio %s\\VC\\bin\\cl.exe")): + SDK["VISUALSTUDIO"] = "C:\\Program Files (x86)\\Microsoft Visual Studio %s\\" % (version) elif "VCINSTALLDIR" in os.environ: vcdir = os.environ["VCINSTALLDIR"] @@ -1968,26 +1973,49 @@ def SdkLocateVisualStudio(): SDK["VISUALSTUDIO"] = vcdir -def SdkLocateMSPlatform(strMode = 'default'): + else: + exit("Couldn't find Visual Studio %s. To use a different version, use the --msvc-version option." % version) + + SDK["VISUALSTUDIO_VERSION"] = version + + if GetVerbose(): + print("Using Visual Studio %s located at %s" % (version, SDK["VISUALSTUDIO"])) + else: + print("Using Visual Studio %s" % (version)) + +def SdkLocateWindows(version = '7.1'): if (GetHost() != "windows"): return - platsdk = None - platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder") - if (platsdk and not os.path.isdir(platsdk)): - platsdk = None + version = version.upper() - if not platsdk: - # Most common location. Worth a try. - platsdk = "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1" - if not os.path.isdir(platsdk): - platsdk = None + if version == '10': + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + elif version == '8.0': + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot") + else: + platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v" + version, "InstallationFolder") - if not platsdk: - exit("Couldn't find Windows SDK v7.1") + if not platsdk or not os.path.isdir(platsdk): + # Most common location. Worth a try. + platsdk = GetProgramFiles() + "\\Microsoft SDKs\\Windows\\v" + version + if not os.path.isdir(platsdk): + if not version.endswith('A'): + # Try the stripped-down version that is bundled with Visual Studio. + return SdkLocateWindows(version + 'A') + platsdk = None + + if not platsdk or not os.path.isdir(platsdk): + exit("Couldn't find Windows SDK version %s. To use a different version, use the --windows-sdk option." % (version)) if not platsdk.endswith("\\"): platsdk += "\\" SDK["MSPLATFORM"] = platsdk + SDK["MSPLATFORM_VERSION"] = version + + if GetVerbose(): + print("Using Windows SDK %s located at %s" % (version, platsdk)) + else: + print("Using Windows SDK %s" % (version)) def SdkLocateMacOSX(osxtarget = None): if (GetHost() != "darwin"): return @@ -2225,20 +2253,44 @@ def SetupVisualStudioEnviron(): AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\include") AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib\\" + libdir) AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\lib\\" + libdir) - AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin") - AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include") - AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl") - AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc") - if (arch != 'x64'): - AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib") - AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT") - AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC") - elif (os.path.isdir(SDK["MSPLATFORM"] + "lib\\x64")): - AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\x64") - elif (os.path.isdir(SDK["MSPLATFORM"] + "lib\\amd64")): - AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\amd64") + + if SDK["MSPLATFORM_VERSION"] == '10': + AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin\\" + arch) + + # Windows Kit 10 introduces the "universal CRT". + inc_dir = SDK["MSPLATFORM"] + "Include\\10.0.10240.0\\" + lib_dir = SDK["MSPLATFORM"] + "Lib\\10.0.10240.0\\" + AddToPathEnv("INCLUDE", inc_dir + "shared") + AddToPathEnv("INCLUDE", inc_dir + "ucrt") + AddToPathEnv("INCLUDE", inc_dir + "um") + AddToPathEnv("LIB", lib_dir + "ucrt\\" + arch) + AddToPathEnv("LIB", lib_dir + "um\\" + arch) else: - exit("Could not locate 64-bits libraries in Platform SDK!") + AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin") + AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include") + AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl") + AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc") + + if arch != 'x64': + AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib") + AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT") + AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC") + + elif os.path.isdir(SDK["MSPLATFORM"] + "lib\\x64"): + AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\x64") + + elif os.path.isdir(SDK["MSPLATFORM"] + "lib\\amd64"): + AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib\\amd64") + + else: + exit("Could not locate 64-bits libraries in Windows SDK directory!\nUsing directory: %s" % SDK["MSPLATFORM"]) + + # Targeting the 7.1 SDK (which is the only way to have Windows XP support) + # with Visual Studio 2015 requires use of the Universal CRT. + if SDK["MSPLATFORM_VERSION"] == '7.1' and SDK["VISUALSTUDIO_VERSION"] == '14.0': + win_kit = GetRegistryKey("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", "KitsRoot10") + AddToPathEnv("LIB", win_kit + "Lib\\10.0.10150.0\\ucrt\\" + arch) + AddToPathEnv("INCLUDE", win_kit + "Include\\10.0.10150.0\\ucrt") ######################################################################## # diff --git a/panda/src/downloader/httpDate.cxx b/panda/src/downloader/httpDate.cxx index ea143e0bfa..726306e8ae 100644 --- a/panda/src/downloader/httpDate.cxx +++ b/panda/src/downloader/httpDate.cxx @@ -223,14 +223,17 @@ HTTPDate(const string &format) { if (_time != (time_t)-1) { // Unfortunately, mktime() assumes local time; convert this back // to GMT. -#ifdef IS_FREEBSD +#if defined(IS_FREEBSD) time_t now = time(NULL); struct tm *tp = localtime(&now); _time -= tp->tm_gmtoff; -#else /* IS_FREEBSD */ +#elif defined(_WIN32) + extern long int _timezone; + _time -= _timezone; +#else extern long int timezone; _time -= timezone; -#endif /* IS_FREEBSD */ +#endif } #endif // __GNUC__ } diff --git a/panda/src/downloader/multiplexStream.h b/panda/src/downloader/multiplexStream.h index 1b4a5e8fc5..a82ed96233 100644 --- a/panda/src/downloader/multiplexStream.h +++ b/panda/src/downloader/multiplexStream.h @@ -36,6 +36,10 @@ class EXPCL_PANDAEXPRESS MultiplexStream : public ostream { PUBLISHED: INLINE MultiplexStream(); +#if _MSC_VER >= 1800 + INLINE MultiplexStream(const MultiplexStream ©) = delete; +#endif + INLINE void add_ostream(ostream *out, bool delete_later = false); INLINE bool add_stdio_file(FILE *file, bool close_when_done); INLINE void add_standard_output(); diff --git a/panda/src/downloader/stringStream.h b/panda/src/downloader/stringStream.h index 158f6194ca..6970887a25 100644 --- a/panda/src/downloader/stringStream.h +++ b/panda/src/downloader/stringStream.h @@ -35,6 +35,10 @@ PUBLISHED: EXTENSION(StringStream(PyObject *source)); INLINE StringStream(); +#if _MSC_VER >= 1800 + INLINE StringStream(const StringStream ©) = delete; +#endif + INLINE void clear_data(); INLINE size_t get_data_size(); diff --git a/panda/src/express/checksumHashGenerator.I b/panda/src/express/checksumHashGenerator.I index 63f31897c5..2a094eda4c 100644 --- a/panda/src/express/checksumHashGenerator.I +++ b/panda/src/express/checksumHashGenerator.I @@ -68,5 +68,9 @@ add_fp(double number, double threshold) { //////////////////////////////////////////////////////////////////// INLINE void ChecksumHashGenerator:: add_pointer(void *ptr) { +#ifdef _WIN32 + add_int(PtrToLong(ptr)); +#else add_int((long)ptr); +#endif } diff --git a/panda/src/express/subStream.h b/panda/src/express/subStream.h index 71171f350a..7dbfab475f 100644 --- a/panda/src/express/subStream.h +++ b/panda/src/express/subStream.h @@ -36,6 +36,10 @@ PUBLISHED: INLINE ISubStream(); INLINE ISubStream(IStreamWrapper *source, streampos start, streampos end); +#if _MSC_VER >= 1800 + INLINE ISubStream(const ISubStream ©) = delete; +#endif + INLINE ISubStream &open(IStreamWrapper *source, streampos start, streampos end); INLINE ISubStream &close(); @@ -60,6 +64,10 @@ PUBLISHED: INLINE OSubStream(); INLINE OSubStream(OStreamWrapper *dest, streampos start, streampos end, bool append = false); +#if _MSC_VER >= 1800 + INLINE OSubStream(const OSubStream ©) = delete; +#endif + INLINE OSubStream &open(OStreamWrapper *dest, streampos start, streampos end, bool append = false); INLINE OSubStream &close(); @@ -77,6 +85,10 @@ PUBLISHED: INLINE SubStream(); INLINE SubStream(StreamWrapper *nested, streampos start, streampos end, bool append = false); +#if _MSC_VER >= 1800 + INLINE SubStream(const SubStream ©) = delete; +#endif + INLINE SubStream &open(StreamWrapper *nested, streampos start, streampos end, bool append = false); INLINE SubStream &close(); diff --git a/panda/src/express/zStream.h b/panda/src/express/zStream.h index 1df8aa6416..1f4289bc2a 100644 --- a/panda/src/express/zStream.h +++ b/panda/src/express/zStream.h @@ -39,6 +39,10 @@ PUBLISHED: INLINE IDecompressStream(); INLINE IDecompressStream(istream *source, bool owns_source); +#if _MSC_VER >= 1800 + INLINE IDecompressStream(const IDecompressStream ©) = delete; +#endif + INLINE IDecompressStream &open(istream *source, bool owns_source); INLINE IDecompressStream &close(); @@ -61,10 +65,14 @@ private: class EXPCL_PANDAEXPRESS OCompressStream : public ostream { PUBLISHED: INLINE OCompressStream(); - INLINE OCompressStream(ostream *dest, bool owns_dest, + INLINE OCompressStream(ostream *dest, bool owns_dest, int compression_level = 6); - INLINE OCompressStream &open(ostream *dest, bool owns_dest, +#if _MSC_VER >= 1800 + INLINE OCompressStream(const OCompressStream ©) = delete; +#endif + + INLINE OCompressStream &open(ostream *dest, bool owns_dest, int compression_level = 6); INLINE OCompressStream &close(); From 7f3f546cdd2b8fe5602e34446a010305773c26bf Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 5 Oct 2015 02:56:40 +0200 Subject: [PATCH 194/203] Interrogate now parses "volatile" qualifier in instance identifiers correctly --- dtool/src/cppparser/cppBison.yxx | 20 +++++++++++++++++++ dtool/src/cppparser/cppInstanceIdentifier.cxx | 5 +++++ dtool/src/cppparser/cppInstanceIdentifier.h | 1 + makepanda/makepanda.py | 2 +- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 644fcac1de..7fd639d497 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -1233,6 +1233,11 @@ instance_identifier: { $$ = $2; $$->add_modifier(IIT_const); +} + | KW_VOLATILE instance_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_volatile); } | '*' instance_identifier %prec UNARY { @@ -1435,6 +1440,11 @@ not_paren_formal_parameter_identifier: { $$ = $2; $$->add_modifier(IIT_const); +} + | KW_VOLATILE not_paren_formal_parameter_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_volatile); } | '*' not_paren_formal_parameter_identifier %prec UNARY { @@ -1480,6 +1490,11 @@ formal_parameter_identifier: { $$ = $2; $$->add_modifier(IIT_const); +} + | KW_VOLATILE formal_parameter_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_volatile); } | '*' formal_parameter_identifier %prec UNARY { @@ -1528,6 +1543,11 @@ empty_instance_identifier: { $$ = $2; $$->add_modifier(IIT_const); +} + | KW_VOLATILE empty_instance_identifier %prec UNARY +{ + $$ = $2; + $$->add_modifier(IIT_volatile); } | '*' empty_instance_identifier %prec UNARY { diff --git a/dtool/src/cppparser/cppInstanceIdentifier.cxx b/dtool/src/cppparser/cppInstanceIdentifier.cxx index 45379e5f70..ffef7523b9 100644 --- a/dtool/src/cppparser/cppInstanceIdentifier.cxx +++ b/dtool/src/cppparser/cppInstanceIdentifier.cxx @@ -286,6 +286,11 @@ r_unroll_type(CPPType *start_type, result = new CPPConstType(r_unroll_type(start_type, mi)); break; + case IIT_volatile: + // Just pass it through for now. + result = r_unroll_type(start_type, mi); + break; + case IIT_paren: result = r_unroll_type(start_type, mi); break; diff --git a/dtool/src/cppparser/cppInstanceIdentifier.h b/dtool/src/cppparser/cppInstanceIdentifier.h index b906a4f386..3efe9fc1b3 100644 --- a/dtool/src/cppparser/cppInstanceIdentifier.h +++ b/dtool/src/cppparser/cppInstanceIdentifier.h @@ -36,6 +36,7 @@ enum CPPInstanceIdentifierType { IIT_scoped_pointer, IIT_array, IIT_const, + IIT_volatile, IIT_paren, IIT_func, IIT_initializer, diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 77712197de..9a077f6f58 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1354,7 +1354,7 @@ def CompileIgate(woutd,wsrc,opts): # Assume that interrogate is on the PATH somewhere. cmd = 'interrogate' - cmd += ' -srcdir %s -I%s -Dvolatile -Dmutable' % (srcdir, srcdir) + cmd += ' -srcdir %s -I%s' % (srcdir, srcdir) cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L' if (COMPILER=="MSVC"): cmd += ' -D__inline -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32' From 43958e820cf26005000ae425b9b5bfec03e9abde Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Mon, 5 Oct 2015 20:42:16 -0700 Subject: [PATCH 195/203] Assimp: Add support for skinned meshes (no animations yet). --- pandatool/src/assimp/assimpLoader.cxx | 153 +++++++++++++++++++++++++- pandatool/src/assimp/assimpLoader.h | 18 +++ 2 files changed, 169 insertions(+), 2 deletions(-) diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index a198a29121..258e160c77 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -31,12 +31,24 @@ #include "pointLight.h" #include "look_at.h" #include "texturePool.h" +#include "character.h" +#include "pvector.h" #include "pandaIOSystem.h" #include "pandaLogger.h" #include "assimp/postprocess.h" +struct BoneWeight { + CPT(JointVertexTransform) joint_vertex_xform; + float weight; + + BoneWeight(CPT(JointVertexTransform) joint_vertex_xform, float weight) + : joint_vertex_xform(joint_vertex_xform), weight(weight) + {} +}; +typedef pvector BoneWeightList; + //////////////////////////////////////////////////////////////////// // Function: AssimpLoader::Constructor // Access: Public @@ -156,6 +168,29 @@ build_graph() { delete[] _geom_matindices; } +//////////////////////////////////////////////////////////////////// +// Function: AssimpLoader::find_ndoe +// Access: Private +// Description: Finds a node by name. +//////////////////////////////////////////////////////////////////// +const aiNode *AssimpLoader:: +find_node(const aiNode &root, const aiString &name) { + const aiNode *node; + + if (root.mName == name) { + return &root; + } else { + for (size_t i = 0; i < root.mNumChildren; ++i) { + node = find_node(*root.mChildren[i], name); + if (node) { + return node; + } + } + } + + return NULL; +} + //////////////////////////////////////////////////////////////////// // Function: AssimpLoader::load_texture // Access: Private @@ -377,6 +412,28 @@ load_material(size_t index) { _mat_states[index] = state; } +//////////////////////////////////////////////////////////////////// +// Function: AssimpLoader::create_joint +// Access: Private +// Description: Creates a CharacterJoint from an aiNode +//////////////////////////////////////////////////////////////////// +void AssimpLoader:: +create_joint(PT(Character) character, PT(CharacterJointBundle) bundle, PartGroup *parent, const aiNode &node) +{ + const aiMatrix4x4 &t = node.mTransformation; + LMatrix4 mat(t.a1, t.b1, t.c1, t.d1, + t.a2, t.b2, t.c2, t.d2, + t.a3, t.b3, t.c3, t.d3, + t.a4, t.b4, t.c4, t.d4); + PT(CharacterJoint) joint = new CharacterJoint(character, bundle, parent, node.mName.C_Str(), mat); + + for (size_t i = 0; i < node.mNumChildren; ++i) { + if (_bonemap.find(node.mChildren[i]->mName.C_Str()) != _bonemap.end()) { + create_joint(character, bundle, joint, *node.mChildren[i]); + } + } +} + //////////////////////////////////////////////////////////////////// // Function: AssimpLoader::load_mesh // Access: Private @@ -386,6 +443,48 @@ void AssimpLoader:: load_mesh(size_t index) { const aiMesh &mesh = *_scene->mMeshes[index]; + // Check if we need to make a Character + PT(Character) character = NULL; + if (mesh.HasBones()) { + assimp_cat.debug() + << "Creating character for " << mesh.mName.C_Str() << "\n"; + + // Find and add all bone nodes to the bone map + for (size_t i = 0; i < mesh.mNumBones; ++i) { + const aiBone &bone = *mesh.mBones[i]; + const aiNode *node = find_node(*_scene->mRootNode, bone.mName); + _bonemap[bone.mName.C_Str()] = node; + } + + // Find the root bone node + const aiNode *root = _bonemap[mesh.mBones[0]->mName.C_Str()]; + while (root->mParent && _bonemap.find(root->mParent->mName.C_Str()) != _bonemap.end()) { + root = root->mParent; + } + + // Now create a character from the bones + character = new Character(mesh.mName.C_Str()); + PT(CharacterJointBundle) bundle = character->get_bundle(0); + PT(PartGroup) skeleton = new PartGroup(bundle, ""); + create_joint(character, bundle, skeleton, *root); + } + + // Create transform blend table + PT(TransformBlendTable) tbtable = new TransformBlendTable; + pvector bone_weights(mesh.mNumVertices); + if (character) { + for (size_t i = 0; i < mesh.mNumBones; ++i) { + const aiBone &bone = *mesh.mBones[i]; + CPT(JointVertexTransform) jvt = new JointVertexTransform(character->find_joint(bone.mName.C_Str())); + + for (size_t j = 0; j < bone.mNumWeights; ++j) { + const aiVertexWeight &weight = bone.mWeights[j]; + + bone_weights[weight.mVertexId].push_back(BoneWeight(jvt, weight.mWeight)); + } + } + } + // Create the vertex format. PT(GeomVertexArrayFormat) aformat = new GeomVertexArrayFormat; aformat->add_column(InternalName::get_vertex(), 3, Geom::NT_stdfloat, Geom::C_point); @@ -405,14 +504,28 @@ load_mesh(size_t index) { aformat->add_column(InternalName::get_texcoord_name(out.str()), 3, Geom::NT_stdfloat, Geom::C_texcoord); } } + + PT(GeomVertexArrayFormat) tb_aformat = new GeomVertexArrayFormat; + tb_aformat->add_column(InternalName::make("transform_blend"), 1, Geom::NT_uint16, Geom::C_index); + //TODO: if there is only one UV set, hackily iterate over the texture stages and clear the texcoord name things PT(GeomVertexFormat) format = new GeomVertexFormat; format->add_array(aformat); + if (character) { + format->add_array(tb_aformat); + + GeomVertexAnimationSpec aspec; + aspec.set_panda(); + format->set_animation(aspec); + } // Create the GeomVertexData. string name (mesh.mName.data, mesh.mName.length); PT(GeomVertexData) vdata = new GeomVertexData(name, GeomVertexFormat::register_format(format), Geom::UH_static); + if (character) { + vdata->set_transform_blend_table(tbtable); + } vdata->unclean_set_num_rows(mesh.mNumVertices); // Read out the vertices. @@ -459,6 +572,22 @@ load_mesh(size_t index) { } } + // Now the transform blend table + if (character) { + GeomVertexWriter transform_blend (vdata, InternalName::get_transform_blend()); + + for (size_t i = 0; i < mesh.mNumVertices; ++i) { + TransformBlend tblend; + + for (size_t j = 0; j < bone_weights[i].size(); ++j) { + tblend.add_transform(bone_weights[i][j].joint_vertex_xform, bone_weights[i][j].weight); + } + transform_blend.add_data1i(tbtable->add_blend(tblend)); + } + + tbtable->set_rows(SparseArray::lower_on(vdata->get_num_rows())); + } + // Now read out the primitives. // Keep in mind that we called ReadFile with the aiProcess_Triangulate // flag earlier, so we don't have to worry about polygons. @@ -501,6 +630,10 @@ load_mesh(size_t index) { _geoms[index] = geom; _geom_matindices[index] = mesh.mMaterialIndex; + + if (character) { + _charmap[mesh.mName.C_Str()] = character; + } } //////////////////////////////////////////////////////////////////// @@ -511,6 +644,12 @@ load_mesh(size_t index) { void AssimpLoader:: load_node(const aiNode &node, PandaNode *parent) { PT(PandaNode) pnode; + PT(Character) character; + + // Skip nodes we've converted to joints + if (_bonemap.find(node.mName.C_Str()) != _bonemap.end()) { + return; + } // Create the node and give it a name. string name (node.mName.data, node.mName.length); @@ -519,7 +658,13 @@ load_node(const aiNode &node, PandaNode *parent) { } else { pnode = new PandaNode(name); } - parent->add_child(pnode); + + if (_charmap.find(node.mName.C_Str()) != _charmap.end()) { + character = _charmap[node.mName.C_Str()]; + parent->add_child(character); + } else { + parent->add_child(pnode); + } // Load in the transformation matrix. const aiMatrix4x4 &t = node.mTransformation; @@ -545,7 +690,6 @@ load_node(const aiNode &node, PandaNode *parent) { meshIndex = node.mMeshes[0]; gnode->add_geom(_geoms[meshIndex]); gnode->set_state(_mat_states[_geom_matindices[meshIndex]]); - } else { for (size_t i = 0; i < node.mNumMeshes; ++i) { meshIndex = node.mMeshes[i]; @@ -553,6 +697,11 @@ load_node(const aiNode &node, PandaNode *parent) { _mat_states[_geom_matindices[meshIndex]]); } } + + if (character) { + assimp_cat.debug() << "Adding char to geom\n"; + character->add_child(gnode); + } } } diff --git a/pandatool/src/assimp/assimpLoader.h b/pandatool/src/assimp/assimpLoader.h index 3c8391b324..851ccc3a24 100644 --- a/pandatool/src/assimp/assimpLoader.h +++ b/pandatool/src/assimp/assimpLoader.h @@ -19,10 +19,23 @@ #include "filename.h" #include "modelRoot.h" #include "texture.h" +#include "pmap.h" #include "assimp/scene.h" #include "assimp/Importer.hpp" +class Character; +class CharacterJointBundle; +class PartGroup; + +struct char_cmp { + bool operator () (const char *a, const char *b) const { + return strcmp(a,b) < 0; + } +}; +typedef phash_map BoneMap; +typedef phash_map CharacterMap; + //////////////////////////////////////////////////////////////////// // Class : AssimpLoader // Description : Class that interfaces with Assimp and builds Panda @@ -54,10 +67,15 @@ private: CPT(RenderState) *_mat_states; PT(Geom) *_geoms; unsigned int *_geom_matindices; + BoneMap _bonemap; + CharacterMap _charmap; + + const aiNode *find_node(const aiNode &root, const aiString &name); void load_texture(size_t index); void load_texture_stage(const aiMaterial &mat, const aiTextureType &ttype, CPT(TextureAttrib) &tattr); void load_material(size_t index); + void create_joint(PT(Character) character, PT(CharacterJointBundle) bundle, PartGroup *parent, const aiNode &node); void load_mesh(size_t index); void load_node(const aiNode &node, PandaNode *parent); void load_light(const aiLight &light); From 706f6f7de531692c4346ad5be8f7555a1b8e23df Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 6 Oct 2015 17:05:40 +0200 Subject: [PATCH 196/203] Squelch some of the type conversion warnings in MSVC --- dtool/src/dconfig/dconfig.I | 2 +- dtool/src/dtoolbase/cmath.I | 2 +- dtool/src/dtoolbase/dtoolbase.h | 2 ++ dtool/src/dtoolbase/typeRegistry.I | 2 +- dtool/src/prc/configVariable.I | 2 +- panda/src/display/drawableRegion.I | 6 ++--- panda/src/express/datagram.I | 4 ++-- panda/src/express/memoryUsage.I | 16 ++++++------- panda/src/gobj/shader.I | 4 ++-- panda/src/linmath/configVariableColor.I | 28 ++++++++++++---------- panda/src/linmath/lcast_to_src.I | 32 ++++++++++++------------- panda/src/linmath/lvector3_src.I | 2 +- 12 files changed, 54 insertions(+), 48 deletions(-) diff --git a/dtool/src/dconfig/dconfig.I b/dtool/src/dconfig/dconfig.I index c7575db59e..ffa809820e 100644 --- a/dtool/src/dconfig/dconfig.I +++ b/dtool/src/dconfig/dconfig.I @@ -28,7 +28,7 @@ GetInt(const string &sym, int def) { float DConfig:: GetFloat(const string &sym, float def) { ConfigVariableDouble var(sym, def, "DConfig", ConfigFlags::F_dconfig); - return var.get_value(); + return (float)var.get_value(); } double DConfig:: diff --git a/dtool/src/dtoolbase/cmath.I b/dtool/src/dtoolbase/cmath.I index 03b03f5640..6e8ed6e618 100644 --- a/dtool/src/dtoolbase/cmath.I +++ b/dtool/src/dtoolbase/cmath.I @@ -142,7 +142,7 @@ cacos(float v) { //////////////////////////////////////////////////////////////////// INLINE float cmod(float x, float y) { - return x - cfloor(x / y) * y; + return x - floor(x / y) * y; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 4c8b9b28cb..2c883f8220 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -55,6 +55,8 @@ #pragma warning (disable : 4355) /* C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data */ #pragma warning (disable : 4244) +/* C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data */ +#pragma warning (disable : 4267) #if _MSC_VER >= 1300 #if _MSC_VER >= 1310 diff --git a/dtool/src/dtoolbase/typeRegistry.I b/dtool/src/dtoolbase/typeRegistry.I index 21f15f1f1d..3ba8796c45 100644 --- a/dtool/src/dtoolbase/typeRegistry.I +++ b/dtool/src/dtoolbase/typeRegistry.I @@ -64,5 +64,5 @@ look_up(TypeHandle handle, TypedObject *object) const { return look_up_invalid(handle, object); } #endif - return _handle_registry[handle._index]; + return _handle_registry[(size_t)handle._index]; } diff --git a/dtool/src/prc/configVariable.I b/dtool/src/prc/configVariable.I index 42500be57f..2b50e2a542 100644 --- a/dtool/src/prc/configVariable.I +++ b/dtool/src/prc/configVariable.I @@ -311,7 +311,7 @@ set_int_word(int n, int value) { INLINE void ConfigVariable:: set_int64_word(int n, PN_int64 value) { nassertv(is_constructed()); - _core->make_local_value()->set_int_word(n, value); + _core->make_local_value()->set_int64_word(n, value); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/drawableRegion.I b/panda/src/display/drawableRegion.I index 269c02c1a1..6383b5a40f 100644 --- a/panda/src/display/drawableRegion.I +++ b/panda/src/display/drawableRegion.I @@ -240,7 +240,7 @@ set_clear_stencil(const unsigned int stencil) { //////////////////////////////////////////////////////////////////// INLINE unsigned int DrawableRegion:: get_clear_stencil() const { - return (int)(get_clear_value(RTP_stencil)[0]); + return (unsigned int)(get_clear_value(RTP_stencil)[0]); } //////////////////////////////////////////////////////////////////// @@ -306,9 +306,9 @@ INLINE void DrawableRegion:: update_pixel_factor() { PN_stdfloat new_pixel_factor; if (supports_pixel_zoom()) { - new_pixel_factor = 1.0 / sqrt(max(_pixel_zoom, (PN_stdfloat)1.0)); + new_pixel_factor = (PN_stdfloat)1 / sqrt(max(_pixel_zoom, (PN_stdfloat)1.0)); } else { - new_pixel_factor = 1.0; + new_pixel_factor = 1; } if (new_pixel_factor != _pixel_factor) { _pixel_factor = new_pixel_factor; diff --git a/panda/src/express/datagram.I b/panda/src/express/datagram.I index 123d428b1b..2853fe6447 100644 --- a/panda/src/express/datagram.I +++ b/panda/src/express/datagram.I @@ -353,7 +353,7 @@ add_string(const string &str) { nassertv(str.length() <= (PN_uint16)0xffff); // Strings always are preceded by their length - add_uint16(str.length()); + add_uint16((PN_uint16)str.length()); // Add the string append_data(str); @@ -368,7 +368,7 @@ add_string(const string &str) { INLINE void Datagram:: add_string32(const string &str) { // Strings always are preceded by their length - add_uint32(str.length()); + add_uint32((PN_uint32)str.length()); // Add the string append_data(str); diff --git a/panda/src/express/memoryUsage.I b/panda/src/express/memoryUsage.I index 8f52d9172d..ba2f8c197e 100644 --- a/panda/src/express/memoryUsage.I +++ b/panda/src/express/memoryUsage.I @@ -133,7 +133,7 @@ get_total_cpp_size() { //////////////////////////////////////////////////////////////////// INLINE size_t MemoryUsage:: get_panda_heap_single_size() { - return AtomicAdjust::get(get_global_ptr()->_total_heap_single_size); + return (size_t)AtomicAdjust::get(get_global_ptr()->_total_heap_single_size); } //////////////////////////////////////////////////////////////////// @@ -144,7 +144,7 @@ get_panda_heap_single_size() { //////////////////////////////////////////////////////////////////// INLINE size_t MemoryUsage:: get_panda_heap_array_size() { - return AtomicAdjust::get(get_global_ptr()->_total_heap_array_size); + return (size_t)AtomicAdjust::get(get_global_ptr()->_total_heap_array_size); } //////////////////////////////////////////////////////////////////// @@ -159,7 +159,7 @@ INLINE size_t MemoryUsage:: get_panda_heap_overhead() { #if defined(USE_MEMORY_DLMALLOC) || defined(USE_MEMORY_PTMALLOC2) MemoryUsage *mu = get_global_ptr(); - return AtomicAdjust::get(mu->_requested_heap_size) - AtomicAdjust::get(mu->_total_heap_single_size) - AtomicAdjust::get(mu->_total_heap_array_size); + return (size_t)(AtomicAdjust::get(mu->_requested_heap_size) - AtomicAdjust::get(mu->_total_heap_single_size) - AtomicAdjust::get(mu->_total_heap_array_size)); #else return 0; #endif @@ -173,7 +173,7 @@ get_panda_heap_overhead() { //////////////////////////////////////////////////////////////////// INLINE size_t MemoryUsage:: get_panda_mmap_size() { - return AtomicAdjust::get(get_global_ptr()->_total_mmap_size); + return (size_t)AtomicAdjust::get(get_global_ptr()->_total_mmap_size); } //////////////////////////////////////////////////////////////////// @@ -206,7 +206,7 @@ get_external_size() { #else // Without alternative malloc, the Panda allocated memory is also // included in total_size, so we have to subtract it out. - return mu->_total_size - mu->_total_heap_single_size - mu->_total_heap_array_size; + return mu->_total_size - (size_t)mu->_total_heap_single_size - (size_t)mu->_total_heap_array_size; #endif } else { return 0; @@ -223,12 +223,12 @@ INLINE size_t MemoryUsage:: get_total_size() { MemoryUsage *mu = get_global_ptr(); if (mu->_count_memory_usage) { - return mu->_total_size + mu->_requested_heap_size; + return mu->_total_size + (size_t)mu->_requested_heap_size; } else { #if defined(USE_MEMORY_DLMALLOC) || defined(USE_MEMORY_PTMALLOC2) - return mu->_requested_heap_size; + return (size_t)mu->_requested_heap_size; #else - return AtomicAdjust::get(mu->_total_heap_single_size) + AtomicAdjust::get(mu->_total_heap_array_size); + return (size_t)(AtomicAdjust::get(mu->_total_heap_single_size) + AtomicAdjust::get(mu->_total_heap_array_size)); #endif } } diff --git a/panda/src/gobj/shader.I b/panda/src/gobj/shader.I index 1c00d40197..a381cfffdd 100644 --- a/panda/src/gobj/shader.I +++ b/panda/src/gobj/shader.I @@ -682,7 +682,7 @@ ShaderPtrData(const LVecBase2i &vec) : INLINE void Shader::ShaderPtrData:: write_datagram(Datagram &dg) const { dg.add_uint8(_type); - dg.add_uint32(_size); + dg.add_uint32((PN_uint32)_size); if (_type == SPT_double) { const double *data = (const double *) _ptr; @@ -867,7 +867,7 @@ get_filename_from_index(int index, ShaderType type) const { } } else if (glsl_preprocess && index >= 2048 && (index - 2048) < (int)_included_files.size()) { - return _included_files[index - 2048]; + return _included_files[(size_t)index - 2048]; } // Must be a mistake. Quietly put back the integer. char str[32]; diff --git a/panda/src/linmath/configVariableColor.I b/panda/src/linmath/configVariableColor.I index a686c988c5..1c5031bfb3 100644 --- a/panda/src/linmath/configVariableColor.I +++ b/panda/src/linmath/configVariableColor.I @@ -126,19 +126,23 @@ get_value() const { switch (get_num_words()) { case 1: - _cache.set(get_double_word(0), get_double_word(0), get_double_word(0), 1); + _cache.set((PN_stdfloat)get_double_word(0), (PN_stdfloat)get_double_word(0), + (PN_stdfloat)get_double_word(0), 1); break; case 2: - _cache.set(get_double_word(0), get_double_word(0), get_double_word(0), get_double_word(1)); + _cache.set((PN_stdfloat)get_double_word(0), (PN_stdfloat)get_double_word(0), + (PN_stdfloat)get_double_word(0), (PN_stdfloat)get_double_word(1)); break; case 3: - _cache.set(get_double_word(0), get_double_word(1), get_double_word(2), 1); + _cache.set((PN_stdfloat)get_double_word(0), (PN_stdfloat)get_double_word(1), + (PN_stdfloat)get_double_word(2), 1); break; case 4: - _cache.set(get_double_word(0), get_double_word(1), get_double_word(2), get_double_word(3)); + _cache.set((PN_stdfloat)get_double_word(0), (PN_stdfloat)get_double_word(1), + (PN_stdfloat)get_double_word(2), (PN_stdfloat)get_double_word(3)); break; default: @@ -161,17 +165,17 @@ get_default_value() const { if (decl != (ConfigDeclaration *)NULL) { switch (decl->get_num_words()) { case 1: - return LColor(decl->get_double_word(0), decl->get_double_word(0), - decl->get_double_word(0), 1); + return LColor((PN_stdfloat)decl->get_double_word(0), (PN_stdfloat)decl->get_double_word(0), + (PN_stdfloat)decl->get_double_word(0), 1); case 2: - return LColor(decl->get_double_word(0), decl->get_double_word(0), - decl->get_double_word(0), decl->get_double_word(1)); + return LColor((PN_stdfloat)decl->get_double_word(0), (PN_stdfloat)decl->get_double_word(0), + (PN_stdfloat)decl->get_double_word(0), (PN_stdfloat)decl->get_double_word(1)); case 3: - return LColor(decl->get_double_word(0), decl->get_double_word(1), - decl->get_double_word(2), 1); + return LColor((PN_stdfloat)decl->get_double_word(0), (PN_stdfloat)decl->get_double_word(1), + (PN_stdfloat)decl->get_double_word(2), 1); case 4: - return LColor(decl->get_double_word(0), decl->get_double_word(1), - decl->get_double_word(2), decl->get_double_word(3)); + return LColor((PN_stdfloat)decl->get_double_word(0), (PN_stdfloat)decl->get_double_word(1), + (PN_stdfloat)decl->get_double_word(2), (PN_stdfloat)decl->get_double_word(3)); default: prc_cat->warning() << "Invalid default color value for ConfigVariable " diff --git a/panda/src/linmath/lcast_to_src.I b/panda/src/linmath/lcast_to_src.I index acfcad19d5..9c4f83ca3e 100644 --- a/panda/src/linmath/lcast_to_src.I +++ b/panda/src/linmath/lcast_to_src.I @@ -74,47 +74,47 @@ lcast_to(FLOATTYPE *, const FLOATNAME(LMatrix4) &source) { INLINE_LINMATH FLOATNAME2(LVecBase2) lcast_to(FLOATTYPE2 *, const FLOATNAME(LVecBase2) &source) { - return FLOATNAME2(LVecBase2)(source[0], source[1]); + return FLOATNAME2(LVecBase2)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1]); } INLINE_LINMATH FLOATNAME2(LVecBase3) lcast_to(FLOATTYPE2 *, const FLOATNAME(LVecBase3) &source) { - return FLOATNAME2(LVecBase3)(source[0], source[1], source[2]); + return FLOATNAME2(LVecBase3)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2]); } INLINE_LINMATH FLOATNAME2(LVecBase4) lcast_to(FLOATTYPE2 *, const FLOATNAME(LVecBase4) &source) { - return FLOATNAME2(LVecBase4)(source[0], source[1], source[2], source[3]); + return FLOATNAME2(LVecBase4)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2], (FLOATTYPE2)source[3]); } INLINE_LINMATH FLOATNAME2(LVector2) lcast_to(FLOATTYPE2 *, const FLOATNAME(LVector2) &source) { - return FLOATNAME2(LVector2)(source[0], source[1]); + return FLOATNAME2(LVector2)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1]); } INLINE_LINMATH FLOATNAME2(LVector3) lcast_to(FLOATTYPE2 *, const FLOATNAME(LVector3) &source) { - return FLOATNAME2(LVector3)(source[0], source[1], source[2]); + return FLOATNAME2(LVector3)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2]); } INLINE_LINMATH FLOATNAME2(LVector4) lcast_to(FLOATTYPE2 *, const FLOATNAME(LVector4) &source) { - return FLOATNAME2(LVector4)(source[0], source[1], source[2], source[3]); + return FLOATNAME2(LVector4)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2], (FLOATTYPE2)source[3]); } INLINE_LINMATH FLOATNAME2(LPoint2) lcast_to(FLOATTYPE2 *, const FLOATNAME(LPoint2) &source) { - return FLOATNAME2(LPoint2)(source[0], source[1]); + return FLOATNAME2(LPoint2)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1]); } INLINE_LINMATH FLOATNAME2(LPoint3) lcast_to(FLOATTYPE2 *, const FLOATNAME(LPoint3) &source) { - return FLOATNAME2(LPoint3)(source[0], source[1], source[2]); + return FLOATNAME2(LPoint3)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2]); } INLINE_LINMATH FLOATNAME2(LPoint4) lcast_to(FLOATTYPE2 *, const FLOATNAME(LPoint4) &source) { - return FLOATNAME2(LPoint4)(source[0], source[1], source[2], source[3]); + return FLOATNAME2(LPoint4)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2], (FLOATTYPE2)source[3]); } INLINE_LINMATH FLOATNAME2(LQuaternion) @@ -125,16 +125,16 @@ lcast_to(FLOATTYPE2 *, const FLOATNAME(LQuaternion) &c) { INLINE_LINMATH FLOATNAME2(LMatrix3) lcast_to(FLOATTYPE2 *, const FLOATNAME(LMatrix3) &source) { return FLOATNAME2(LMatrix3) - (source(0, 0), source(0, 1), source(0, 2), - source(1, 0), source(1, 1), source(1, 2), - source(2, 0), source(2, 1), source(2, 2)); + ((FLOATTYPE2)source(0, 0), (FLOATTYPE2)source(0, 1), (FLOATTYPE2)source(0, 2), + (FLOATTYPE2)source(1, 0), (FLOATTYPE2)source(1, 1), (FLOATTYPE2)source(1, 2), + (FLOATTYPE2)source(2, 0), (FLOATTYPE2)source(2, 1), (FLOATTYPE2)source(2, 2)); } INLINE_LINMATH FLOATNAME2(LMatrix4) lcast_to(FLOATTYPE2 *, const FLOATNAME(LMatrix4) &source) { return FLOATNAME2(LMatrix4) - (source(0, 0), source(0, 1), source(0, 2), source(0, 3), - source(1, 0), source(1, 1), source(1, 2), source(1, 3), - source(2, 0), source(2, 1), source(2, 2), source(2, 3), - source(3, 0), source(3, 1), source(3, 2), source(3, 3)); + ((FLOATTYPE2)source(0, 0), (FLOATTYPE2)source(0, 1), (FLOATTYPE2)source(0, 2), (FLOATTYPE2)source(0, 3), + (FLOATTYPE2)source(1, 0), (FLOATTYPE2)source(1, 1), (FLOATTYPE2)source(1, 2), (FLOATTYPE2)source(1, 3), + (FLOATTYPE2)source(2, 0), (FLOATTYPE2)source(2, 1), (FLOATTYPE2)source(2, 2), (FLOATTYPE2)source(2, 3), + (FLOATTYPE2)source(3, 0), (FLOATTYPE2)source(3, 1), (FLOATTYPE2)source(3, 2), (FLOATTYPE2)source(3, 3)); } diff --git a/panda/src/linmath/lvector3_src.I b/panda/src/linmath/lvector3_src.I index 5a23e12c43..318d32d2c9 100644 --- a/panda/src/linmath/lvector3_src.I +++ b/panda/src/linmath/lvector3_src.I @@ -319,7 +319,7 @@ relative_angle_rad(const FLOATNAME(LVector3) &other) const { //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATTYPE FLOATNAME(LVector3):: relative_angle_deg(const FLOATNAME(LVector3) &other) const { - return relative_angle_rad(other)*180/3.1415926535; + return relative_angle_rad(other) * FLOATCONST(180.0) / FLOATCONST(3.1415926535); } #endif // FLOATTYPE_IS_INT From 45e1f4d25ef736f025fafe535c7451ae6da07924 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Tue, 6 Oct 2015 20:41:16 -0700 Subject: [PATCH 197/203] Assimp: Cleanup skeletal mesh code. * Use pmap instead of phash_map * Remove PT() in create_joint() function header --- pandatool/src/assimp/assimpLoader.cxx | 2 +- pandatool/src/assimp/assimpLoader.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandatool/src/assimp/assimpLoader.cxx b/pandatool/src/assimp/assimpLoader.cxx index 258e160c77..f0322dc506 100644 --- a/pandatool/src/assimp/assimpLoader.cxx +++ b/pandatool/src/assimp/assimpLoader.cxx @@ -418,7 +418,7 @@ load_material(size_t index) { // Description: Creates a CharacterJoint from an aiNode //////////////////////////////////////////////////////////////////// void AssimpLoader:: -create_joint(PT(Character) character, PT(CharacterJointBundle) bundle, PartGroup *parent, const aiNode &node) +create_joint(Character *character, CharacterJointBundle *bundle, PartGroup *parent, const aiNode &node) { const aiMatrix4x4 &t = node.mTransformation; LMatrix4 mat(t.a1, t.b1, t.c1, t.d1, diff --git a/pandatool/src/assimp/assimpLoader.h b/pandatool/src/assimp/assimpLoader.h index 851ccc3a24..f9544d2ed5 100644 --- a/pandatool/src/assimp/assimpLoader.h +++ b/pandatool/src/assimp/assimpLoader.h @@ -33,8 +33,8 @@ struct char_cmp { return strcmp(a,b) < 0; } }; -typedef phash_map BoneMap; -typedef phash_map CharacterMap; +typedef pmap BoneMap; +typedef pmap CharacterMap; //////////////////////////////////////////////////////////////////// // Class : AssimpLoader @@ -75,7 +75,7 @@ private: void load_texture(size_t index); void load_texture_stage(const aiMaterial &mat, const aiTextureType &ttype, CPT(TextureAttrib) &tattr); void load_material(size_t index); - void create_joint(PT(Character) character, PT(CharacterJointBundle) bundle, PartGroup *parent, const aiNode &node); + void create_joint(Character *character, CharacterJointBundle *bundle, PartGroup *parent, const aiNode &node); void load_mesh(size_t index); void load_node(const aiNode &node, PandaNode *parent); void load_light(const aiLight &light); From 9543d0800de26cc61b56ee7eab26bce283113313 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 7 Oct 2015 15:41:18 +0200 Subject: [PATCH 198/203] Don't add -pyX.Y suffix to runtime installer on Windows --- makepanda/makepanda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 9a077f6f58..3d379ecdeb 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -7033,7 +7033,7 @@ try: fn += VERSION - if SDK["PYTHONVERSION"] != "python2.7": + if not RUNTIME and SDK["PYTHONVERSION"] != "python2.7": fn += '-py' + SDK["PYTHONVERSION"][6:] if GetOptimize() <= 2: From 389d73a485337c68f5982da41df5287c39ea70c1 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 7 Oct 2015 15:51:56 +0200 Subject: [PATCH 199/203] Include Eigen headers in Windows SDK to prevent people from having to grab the thirdparty packages --- makepanda/makepanda.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index b1c31930ea..8c28cc20cc 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2676,6 +2676,11 @@ if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")): CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw') ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */') +# Since Eigen is included by all sorts of core headers, as a convenience +# to C++ users on Windows, we include it in the Panda include directory. +if not PkgSkip("EIGEN") and GetTarget() == "windows" and GetThirdpartyDir(): + CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen') + ######################################################################## # # Copy header files to the built/include/parser-inc directory. From 18ad6d1543db352107f808ed725bc4df722635a8 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 7 Oct 2015 18:58:26 +0200 Subject: [PATCH 200/203] Replace many int params with size_t params where appropriate, and work towards fixing type conversion warnings --- dtool/src/dtoolbase/indent.I | 4 +- dtool/src/dtoolbase/typeHandle.cxx | 2 +- dtool/src/dtoolbase/typeHandle.h | 4 +- dtool/src/dtoolbase/typeRegistry.cxx | 12 +++--- dtool/src/dtoolbase/typeRegistryNode.cxx | 2 +- dtool/src/dtoolutil/dSearchPath.I | 4 +- dtool/src/dtoolutil/dSearchPath.cxx | 18 ++++---- dtool/src/dtoolutil/dSearchPath.h | 14 +++---- dtool/src/dtoolutil/executionEnvironment.I | 4 +- dtool/src/dtoolutil/executionEnvironment.cxx | 10 ++--- dtool/src/dtoolutil/executionEnvironment.h | 8 ++-- dtool/src/dtoolutil/filename.I | 4 +- dtool/src/dtoolutil/filename.cxx | 18 ++++---- dtool/src/dtoolutil/filename.h | 2 +- dtool/src/dtoolutil/lineStreamBuf.I | 2 +- dtool/src/dtoolutil/lineStreamBuf.cxx | 4 +- dtool/src/dtoolutil/lineStreamBuf.h | 2 +- dtool/src/dtoolutil/pandaSystem.cxx | 6 +-- dtool/src/dtoolutil/pandaSystem.h | 4 +- dtool/src/dtoolutil/textEncoder.I | 14 +++---- dtool/src/dtoolutil/textEncoder.h | 10 ++--- dtool/src/dtoolutil/unicodeLatinMap.cxx | 4 +- .../interfaceMakerPythonNative.cxx | 26 ++++++------ dtool/src/prc/configDeclaration.I | 24 +++++------ dtool/src/prc/configDeclaration.cxx | 24 +++++------ dtool/src/prc/configDeclaration.h | 42 +++++++++---------- dtool/src/prc/configPage.cxx | 22 +++++----- dtool/src/prc/configPage.h | 12 +++--- dtool/src/prc/configPageManager.I | 30 ++++++------- dtool/src/prc/configPageManager.h | 20 ++++----- dtool/src/prc/configVariable.I | 32 +++++++------- dtool/src/prc/configVariable.h | 32 +++++++------- dtool/src/prc/configVariableBool.I | 8 ++-- dtool/src/prc/configVariableBool.h | 8 ++-- dtool/src/prc/configVariableCore.I | 20 ++++----- dtool/src/prc/configVariableCore.cxx | 6 +-- dtool/src/prc/configVariableCore.h | 16 +++---- dtool/src/prc/configVariableDouble.I | 8 ++-- dtool/src/prc/configVariableDouble.h | 8 ++-- dtool/src/prc/configVariableEnum.I | 8 ++-- dtool/src/prc/configVariableEnum.h | 8 ++-- dtool/src/prc/configVariableFilename.I | 6 +-- dtool/src/prc/configVariableFilename.h | 6 +-- dtool/src/prc/configVariableInt.I | 8 ++-- dtool/src/prc/configVariableInt.h | 8 ++-- dtool/src/prc/configVariableInt64.I | 20 ++++----- dtool/src/prc/configVariableInt64.h | 16 +++---- dtool/src/prc/configVariableList.I | 12 +++--- dtool/src/prc/configVariableList.cxx | 8 ++-- dtool/src/prc/configVariableList.h | 12 +++--- dtool/src/prc/configVariableManager.I | 6 +-- dtool/src/prc/configVariableManager.cxx | 28 ++++++------- dtool/src/prc/configVariableManager.h | 8 ++-- dtool/src/prc/configVariableSearchPath.I | 6 +-- dtool/src/prc/configVariableSearchPath.cxx | 4 +- dtool/src/prc/configVariableSearchPath.h | 8 ++-- dtool/src/prc/configVariableString.I | 8 ++-- dtool/src/prc/configVariableString.h | 6 +-- dtool/src/prc/encryptStreamBuf.cxx | 14 +++---- dtool/src/prc/notify.cxx | 2 +- dtool/src/prc/notifyCategory.cxx | 6 +-- dtool/src/prc/notifyCategory.h | 5 ++- dtool/src/prc/prcKeyRegistry.cxx | 22 +++++----- dtool/src/prc/prcKeyRegistry.h | 15 +++---- dtool/src/prc/streamReader.cxx | 4 +- dtool/src/prc/streamWriter.I | 4 +- dtool/src/prckeys/makePrcKey.cxx | 10 ++--- panda/src/display/windowProperties.h | 2 +- panda/src/express/datagram.cxx | 4 +- panda/src/express/datagramIterator.I | 4 +- panda/src/express/datagramIterator.cxx | 8 ++-- panda/src/express/datagramIterator.h | 2 +- panda/src/express/hashVal.cxx | 4 +- panda/src/express/memoryUsagePointers.cxx | 22 +++++----- panda/src/express/memoryUsagePointers.h | 14 +++---- panda/src/express/memoryUsagePointers_ext.cxx | 2 +- panda/src/express/memoryUsagePointers_ext.h | 2 +- panda/src/express/multifile.cxx | 2 +- panda/src/express/nodeReferenceCount.I | 2 +- panda/src/express/referenceCount.I | 2 +- panda/src/express/virtualFileList.I | 12 +++--- panda/src/express/virtualFileList.h | 8 ++-- panda/src/gobj/adaptiveLru.h | 2 +- panda/src/gobj/geomPrimitive.cxx | 2 +- panda/src/gobj/geomVertexArrayData.I | 4 +- panda/src/gobj/geomVertexArrayData.h | 4 +- panda/src/gobj/geomVertexArrayFormat.I | 8 ++-- panda/src/gobj/geomVertexArrayFormat.h | 4 +- panda/src/gobj/geomVertexData.cxx | 2 +- panda/src/gobj/geomVertexFormat.I | 38 ++++++++--------- panda/src/gobj/geomVertexFormat.cxx | 38 ++++++++--------- panda/src/gobj/geomVertexFormat.h | 40 +++++++++--------- panda/src/gobj/lens.I | 4 +- panda/src/gobj/sliderTable.I | 10 ++--- panda/src/gobj/sliderTable.cxx | 18 ++++---- panda/src/gobj/sliderTable.h | 14 +++---- panda/src/gobj/texture.I | 2 +- panda/src/gobj/texture.cxx | 2 +- panda/src/gobj/texture.h | 2 +- panda/src/gobj/transformBlend.I | 18 ++++---- panda/src/gobj/transformBlend.h | 10 ++--- panda/src/gobj/transformBlendTable.I | 6 +-- panda/src/gobj/transformBlendTable.cxx | 22 +++++----- panda/src/gobj/transformBlendTable.h | 10 ++--- panda/src/gobj/transformTable.I | 6 +-- panda/src/gobj/transformTable.cxx | 12 +++--- panda/src/gobj/transformTable.h | 10 ++--- panda/src/gobj/vertexDataBook.I | 2 +- panda/src/gobj/vertexDataBook.h | 2 +- panda/src/linmath/lcast_to_src.I | 20 ++++----- panda/src/linmath/lorientation_src.I | 10 ++--- panda/src/linmath/lorientation_src.h | 2 +- panda/src/linmath/lquaternion_src.I | 6 +-- panda/src/linmath/lvecBase2_ext_src.I | 2 +- panda/src/linmath/lvecBase3_ext_src.I | 2 +- panda/src/linmath/lvecBase3_src.I | 2 + panda/src/linmath/lvecBase3_src.h | 2 + panda/src/linmath/lvecBase4_ext_src.I | 2 +- panda/src/nativenet/socket_address.I | 14 +++---- panda/src/nativenet/socket_address.h | 10 ++--- panda/src/nativenet/socket_portable.h | 10 ++--- panda/src/nativenet/time_clock.h | 10 ++--- panda/src/pgraph/renderAttribRegistry.I | 2 +- panda/src/pgraph/renderState.I | 16 +++---- panda/src/pgraph/renderState.h | 16 +++---- panda/src/pgraph/shaderAttrib.I | 2 +- panda/src/pgraph/transformState.I | 16 +++---- panda/src/pgraph/transformState.h | 16 +++---- panda/src/pgraphnodes/sceneGraphAnalyzer.I | 3 +- panda/src/pgraphnodes/sceneGraphAnalyzer.h | 2 +- panda/src/pnmimage/convert_srgb.I | 4 +- panda/src/pnmimage/pnmImage.I | 6 +-- panda/src/pstatclient/pStatClient.I | 4 +- panda/src/pstatclient/pStatFrameData.I | 25 ++++++----- panda/src/pstatclient/pStatFrameData.h | 14 +++---- panda/src/putil/bitArray.I | 11 +++-- panda/src/putil/bitArray.cxx | 8 ++-- panda/src/putil/bitArray.h | 8 ++-- panda/src/putil/buttonMap.I | 8 ++-- panda/src/putil/buttonMap.h | 8 ++-- .../putil/cachedTypedWritableReferenceCount.I | 2 +- panda/src/putil/nodeCachedReferenceCount.I | 2 +- panda/src/putil/pbitops.I | 6 +-- panda/src/putil/simpleHashMap.I | 6 +-- panda/src/putil/simpleHashMap.h | 4 +- panda/src/putil/sparseArray.I | 10 ++--- panda/src/putil/sparseArray.h | 6 +-- panda/src/putil/weakKeyHashMap.I | 6 +-- panda/src/putil/weakKeyHashMap.h | 4 +- 149 files changed, 721 insertions(+), 726 deletions(-) diff --git a/dtool/src/dtoolbase/indent.I b/dtool/src/dtoolbase/indent.I index 79e949c564..aeeaea1262 100644 --- a/dtool/src/dtoolbase/indent.I +++ b/dtool/src/dtoolbase/indent.I @@ -39,7 +39,7 @@ write_long_list(ostream &out, int indent_level, string str = item.str(); indent(out, indent_level) << first_prefix << str; - int col = indent_level + first_prefix.length() + str.length(); + int col = indent_level + (int)(first_prefix.length() + str.length()); ++first; @@ -52,7 +52,7 @@ write_long_list(ostream &out, int indent_level, if (col > max_col) { out << "\n"; indent(out, indent_level) << later_prefix << str; - col = indent_level + later_prefix.length() + str.length(); + col = indent_level + (int)(later_prefix.length() + str.length()); } else { out << " " << str; diff --git a/dtool/src/dtoolbase/typeHandle.cxx b/dtool/src/dtoolbase/typeHandle.cxx index d807a298b6..c5bb0a7005 100644 --- a/dtool/src/dtoolbase/typeHandle.cxx +++ b/dtool/src/dtoolbase/typeHandle.cxx @@ -28,7 +28,7 @@ TypeHandle TypeHandle::_none; // only updated if track-memory-usage is set true in // your Config.prc file. //////////////////////////////////////////////////////////////////// -int TypeHandle:: +size_t TypeHandle:: get_memory_usage(MemoryClass memory_class) const { assert((int)memory_class >= 0 && (int)memory_class < (int)MC_limit); if ((*this) == TypeHandle::none()) { diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index c05e25dd46..d7c211ff68 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -126,11 +126,11 @@ PUBLISHED: int get_best_parent_from_Set(const std::set< int > &legal_vals) const; #ifdef DO_MEMORY_USAGE - int get_memory_usage(MemoryClass memory_class) const; + size_t get_memory_usage(MemoryClass memory_class) const; void inc_memory_usage(MemoryClass memory_class, size_t size); void dec_memory_usage(MemoryClass memory_class, size_t size); #else - static CONSTEXPR int get_memory_usage(MemoryClass) { return 0; } + static CONSTEXPR size_t get_memory_usage(MemoryClass) { return 0; } INLINE void inc_memory_usage(MemoryClass, size_t) { } INLINE void dec_memory_usage(MemoryClass, size_t) { } #endif // DO_MEMORY_USAGE diff --git a/dtool/src/dtoolbase/typeRegistry.cxx b/dtool/src/dtoolbase/typeRegistry.cxx index f88f923f04..16d64830ee 100644 --- a/dtool/src/dtoolbase/typeRegistry.cxx +++ b/dtool/src/dtoolbase/typeRegistry.cxx @@ -59,7 +59,7 @@ register_type(TypeHandle &type_handle, const string &name) { // class has been defined. TypeHandle new_handle; - new_handle._index = _handle_registry.size(); + new_handle._index = (int)_handle_registry.size(); TypeRegistryNode *rnode = new TypeRegistryNode(new_handle, name, type_handle); _handle_registry.push_back(rnode); @@ -73,7 +73,7 @@ register_type(TypeHandle &type_handle, const string &name) { TypeRegistryNode *rnode = (*ri).second; assert(rnode->_name == (*ri).first); assert(rnode->_handle._index >= 0 && - rnode->_handle._index < (int)_handle_registry.size()); + rnode->_handle._index < (int)_handle_registry.size()); assert(_handle_registry[rnode->_handle._index] == rnode); assert(rnode->_handle._index != 0); @@ -137,7 +137,7 @@ register_dynamic_type(const string &name) { // has something unique to point to. This doesn't really mean // anything, though. TypeHandle *new_handle = new TypeHandle; - new_handle->_index = _handle_registry.size(); + new_handle->_index = (int)_handle_registry.size(); TypeRegistryNode *rnode = new TypeRegistryNode(*new_handle, name, *new_handle); _handle_registry.push_back(rnode); @@ -365,7 +365,7 @@ int TypeRegistry:: get_num_root_classes() { _lock->acquire(); freshen_derivations(); - int num_roots = _root_classes.size(); + int num_roots = (int)_root_classes.size(); _lock->release(); return num_roots; } @@ -410,7 +410,7 @@ get_num_parent_classes(TypeHandle child, TypedObject *child_object) const { _lock->acquire(); TypeRegistryNode *rnode = look_up(child, child_object); assert(rnode != (TypeRegistryNode *)NULL); - int num_parents = rnode->_parent_classes.size(); + int num_parents = (int)rnode->_parent_classes.size(); _lock->release(); return num_parents; } @@ -452,7 +452,7 @@ get_num_child_classes(TypeHandle child, TypedObject *child_object) const { _lock->acquire(); TypeRegistryNode *rnode = look_up(child, child_object); assert(rnode != (TypeRegistryNode *)NULL); - int num_children = rnode->_child_classes.size(); + int num_children = (int)rnode->_child_classes.size(); _lock->release(); return num_children; } diff --git a/dtool/src/dtoolbase/typeRegistryNode.cxx b/dtool/src/dtoolbase/typeRegistryNode.cxx index 09e36a7ceb..065cea8051 100644 --- a/dtool/src/dtoolbase/typeRegistryNode.cxx +++ b/dtool/src/dtoolbase/typeRegistryNode.cxx @@ -294,7 +294,7 @@ r_build_subtrees(TypeRegistryNode *top, int bit_count, // Now, how many more bits do we need to encode each of our // children? - int num_children = _child_classes.size(); + int num_children = (int)_child_classes.size(); int more_bits = 0; int i = num_children - 1; while (i > 0) { diff --git a/dtool/src/dtoolutil/dSearchPath.I b/dtool/src/dtoolutil/dSearchPath.I index 15bc87241b..5dc035a848 100644 --- a/dtool/src/dtoolutil/dSearchPath.I +++ b/dtool/src/dtoolutil/dSearchPath.I @@ -21,7 +21,7 @@ // list in Python. //////////////////////////////////////////////////////////////////// INLINE Filename DSearchPath::Results:: -operator [] (int n) const { +operator [] (size_t n) const { return get_file(n); } @@ -32,7 +32,7 @@ operator [] (int n) const { // is defined to make the Results object appear to be a // list in Python. //////////////////////////////////////////////////////////////////// -INLINE int DSearchPath::Results:: +INLINE size_t DSearchPath::Results:: size() const { return get_num_files(); } diff --git a/dtool/src/dtoolutil/dSearchPath.cxx b/dtool/src/dtoolutil/dSearchPath.cxx index 16984a48cf..89105253a7 100644 --- a/dtool/src/dtoolutil/dSearchPath.cxx +++ b/dtool/src/dtoolutil/dSearchPath.cxx @@ -72,7 +72,7 @@ clear() { // Access: Published // Description: Returns the number of files on the result list. //////////////////////////////////////////////////////////////////// -int DSearchPath::Results:: +size_t DSearchPath::Results:: get_num_files() const { return _files.size(); } @@ -83,8 +83,8 @@ get_num_files() const { // Description: Returns the nth file on the result list. //////////////////////////////////////////////////////////////////// const Filename &DSearchPath::Results:: -get_file(int n) const { - assert(n >= 0 && n < (int)_files.size()); +get_file(size_t n) const { + assert(n < _files.size()); return _files[n]; } @@ -299,7 +299,7 @@ is_empty() const { // Access: Published // Description: Returns the number of directories on the search list. //////////////////////////////////////////////////////////////////// -int DSearchPath:: +size_t DSearchPath:: get_num_directories() const { return _directories.size(); } @@ -310,8 +310,8 @@ get_num_directories() const { // Description: Returns the nth directory on the search list. //////////////////////////////////////////////////////////////////// const Filename &DSearchPath:: -get_directory(int n) const { - assert(n >= 0 && n < (int)_directories.size()); +get_directory(size_t n) const { + assert(n < _directories.size()); return _directories[n]; } @@ -368,10 +368,10 @@ find_file(const Filename &filename) const { // the results list first; otherwise, the newly-found // files will be appended to the list. //////////////////////////////////////////////////////////////////// -int DSearchPath:: +size_t DSearchPath:: find_all_files(const Filename &filename, DSearchPath::Results &results) const { - int num_added = 0; + size_t num_added = 0; if (filename.is_local()) { if (_directories.empty()) { @@ -446,5 +446,3 @@ write(ostream &out, int indent_level) const { out << (*di) << "\n"; } } - - diff --git a/dtool/src/dtoolutil/dSearchPath.h b/dtool/src/dtoolutil/dSearchPath.h index e61e4c5f41..3ae3fe6ac7 100644 --- a/dtool/src/dtoolutil/dSearchPath.h +++ b/dtool/src/dtoolutil/dSearchPath.h @@ -39,11 +39,11 @@ PUBLISHED: ~Results(); void clear(); - int get_num_files() const; - const Filename &get_file(int n) const; + size_t get_num_files() const; + const Filename &get_file(size_t n) const; - INLINE Filename operator [] (int n) const; - INLINE int size() const; + INLINE Filename operator [] (size_t n) const; + INLINE size_t size() const; void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; @@ -72,12 +72,12 @@ PUBLISHED: void prepend_path(const DSearchPath &path); bool is_empty() const; - int get_num_directories() const; - const Filename &get_directory(int n) const; + size_t get_num_directories() const; + const Filename &get_directory(size_t n) const; MAKE_SEQ(get_directories, get_num_directories, get_directory); Filename find_file(const Filename &filename) const; - int find_all_files(const Filename &filename, Results &results) const; + size_t find_all_files(const Filename &filename, Results &results) const; INLINE Results find_all_files(const Filename &filename) const; INLINE static Filename diff --git a/dtool/src/dtoolutil/executionEnvironment.I b/dtool/src/dtoolutil/executionEnvironment.I index 7c7fa57c33..518d0cee41 100644 --- a/dtool/src/dtoolutil/executionEnvironment.I +++ b/dtool/src/dtoolutil/executionEnvironment.I @@ -80,7 +80,7 @@ clear_shadow(const string &var) { // Description: Returns the number of command-line arguments // available, not counting arg 0, the binary name. //////////////////////////////////////////////////////////////////// -INLINE int ExecutionEnvironment:: +INLINE size_t ExecutionEnvironment:: get_num_args() { return get_ptr()->ns_get_num_args(); } @@ -94,7 +94,7 @@ get_num_args() { // parameter, not the binary name. //////////////////////////////////////////////////////////////////// INLINE string ExecutionEnvironment:: -get_arg(int n) { +get_arg(size_t n) { return get_ptr()->ns_get_arg(n); } diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index 8c67ace1c8..4117bbf86f 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -420,7 +420,7 @@ ns_clear_shadow(const string &var) { // available, not counting arg 0, the binary name. The // nonstatic implementation. //////////////////////////////////////////////////////////////////// -int ExecutionEnvironment:: +size_t ExecutionEnvironment:: ns_get_num_args() const { return _args.size(); } @@ -435,8 +435,8 @@ ns_get_num_args() const { // implementation. //////////////////////////////////////////////////////////////////// string ExecutionEnvironment:: -ns_get_arg(int n) const { - assert(n >= 0 && n < ns_get_num_args()); +ns_get_arg(size_t n) const { + assert(n < ns_get_num_args()); return _args[n]; } @@ -719,9 +719,9 @@ read_args() { if (_binary_name.empty()) { char readlinkbuf [PATH_MAX]; #ifdef HAVE_PROC_CURPROC_FILE - int pathlen = readlink("/proc/curproc/file", readlinkbuf, PATH_MAX - 1); + ssize_t pathlen = readlink("/proc/curproc/file", readlinkbuf, PATH_MAX - 1); #else - int pathlen = readlink("/proc/self/exe", readlinkbuf, PATH_MAX - 1); + ssize_t pathlen = readlink("/proc/self/exe", readlinkbuf, PATH_MAX - 1); #endif if (pathlen > 0) { readlinkbuf[pathlen] = 0; diff --git a/dtool/src/dtoolutil/executionEnvironment.h b/dtool/src/dtoolutil/executionEnvironment.h index bfbb6adf44..716b956258 100644 --- a/dtool/src/dtoolutil/executionEnvironment.h +++ b/dtool/src/dtoolutil/executionEnvironment.h @@ -44,8 +44,8 @@ PUBLISHED: static string expand_string(const string &str); - INLINE static int get_num_args(); - INLINE static string get_arg(int n); + INLINE static size_t get_num_args(); + INLINE static string get_arg(size_t n); INLINE static string get_binary_name(); INLINE static string get_dtool_name(); @@ -62,8 +62,8 @@ private: void ns_shadow_environment_variable(const string &var, const string &value); void ns_clear_shadow(const string &var); - int ns_get_num_args() const; - string ns_get_arg(int n) const; + size_t ns_get_num_args() const; + string ns_get_arg(size_t n) const; string ns_get_binary_name() const; string ns_get_dtool_name() const; diff --git a/dtool/src/dtoolutil/filename.I b/dtool/src/dtoolutil/filename.I index 3d91bb987a..f8fa8fff4e 100644 --- a/dtool/src/dtoolutil/filename.I +++ b/dtool/src/dtoolutil/filename.I @@ -332,8 +332,8 @@ length() const { // Description: //////////////////////////////////////////////////////////////////// INLINE char Filename:: -operator [] (int n) const { - assert(n >= 0 && n < (int)_filename.length()); +operator [] (size_t n) const { + assert(n < _filename.length()); return _filename[n]; } diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index a4152d5db1..143bbde0a3 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -728,7 +728,7 @@ set_dirname(const string &s) { // Remove the directory prefix altogether. _filename.replace(0, _basename_start, ""); - int length_change = - ((int)_basename_start); + ssize_t length_change = - ((ssize_t)_basename_start); _dirname_end = 0; _basename_start += length_change; @@ -746,7 +746,7 @@ set_dirname(const string &s) { ss = s+'/'; } - int length_change = ss.length() - _basename_start; + ssize_t length_change = ss.length() - _basename_start; _filename.replace(0, _basename_start, ss); @@ -791,7 +791,7 @@ set_basename(const string &s) { //////////////////////////////////////////////////////////////////// void Filename:: set_fullpath_wo_extension(const string &s) { - int length_change = s.length() - _basename_end; + ssize_t length_change = s.length() - _basename_end; _filename.replace(0, _basename_end, s); @@ -811,7 +811,7 @@ set_fullpath_wo_extension(const string &s) { //////////////////////////////////////////////////////////////////// void Filename:: set_basename_wo_extension(const string &s) { - int length_change = s.length() - (_basename_end - _basename_start); + ssize_t length_change = s.length() - (_basename_end - _basename_start); if (_basename_end == string::npos) { _filename.replace(_basename_start, string::npos, s); @@ -875,8 +875,8 @@ get_filename_index(int index) const { if (_hash_end != _hash_start) { ostringstream strm; - strm << _filename.substr(0, _hash_start) - << setw(_hash_end - _hash_start) << setfill('0') << index + strm << _filename.substr(0, _hash_start) + << setw((int)(_hash_end - _hash_start)) << setfill('0') << index << _filename.substr(_hash_end); file.set_fullpath(strm.str()); } @@ -1822,12 +1822,12 @@ find_on_searchpath(const DSearchPath &searchpath) { return -1; } - int num_directories = searchpath.get_num_directories(); - for (int i = 0; i < num_directories; i++) { + size_t num_directories = searchpath.get_num_directories(); + for (size_t i = 0; i < num_directories; ++i) { Filename directory = searchpath.get_directory(i); directory.make_absolute(); if (make_relative_to(directory, false)) { - return i; + return (int)i; } } diff --git a/dtool/src/dtoolutil/filename.h b/dtool/src/dtoolutil/filename.h index f01d03483e..127e9dcbcc 100644 --- a/dtool/src/dtoolutil/filename.h +++ b/dtool/src/dtoolutil/filename.h @@ -121,7 +121,7 @@ PUBLISHED: INLINE const char *c_str() const; INLINE bool empty() const; INLINE size_t length() const; - INLINE char operator [] (int n) const; + INLINE char operator [] (size_t n) const; EXTENSION(PyObject *__repr__() const); diff --git a/dtool/src/dtoolutil/lineStreamBuf.I b/dtool/src/dtoolutil/lineStreamBuf.I index 4d95406bc2..a1a8daf99e 100644 --- a/dtool/src/dtoolutil/lineStreamBuf.I +++ b/dtool/src/dtoolutil/lineStreamBuf.I @@ -41,7 +41,7 @@ has_newline() const { // into the memory buffer. //////////////////////////////////////////////////////////////////// INLINE void LineStreamBuf:: -write_chars(const char *start, int length) { +write_chars(const char *start, size_t length) { if (length > 0) { _data += string(start, length); } diff --git a/dtool/src/dtoolutil/lineStreamBuf.cxx b/dtool/src/dtoolutil/lineStreamBuf.cxx index 5e84ccb0d8..c1d35a42cb 100644 --- a/dtool/src/dtoolutil/lineStreamBuf.cxx +++ b/dtool/src/dtoolutil/lineStreamBuf.cxx @@ -84,7 +84,7 @@ int LineStreamBuf:: sync() { streamsize n = pptr() - pbase(); write_chars(pbase(), n); - pbump(-n); // Reset pptr(). + pbump(-(int)n); // Reset pptr(). return 0; // EOF to indicate write full. } @@ -104,7 +104,7 @@ overflow(int ch) { if (ch != EOF) { // Write one more character. - char c = ch; + char c = (char)ch; write_chars(&c, 1); } diff --git a/dtool/src/dtoolutil/lineStreamBuf.h b/dtool/src/dtoolutil/lineStreamBuf.h index 78106ce525..02c5b7e4b1 100644 --- a/dtool/src/dtoolutil/lineStreamBuf.h +++ b/dtool/src/dtoolutil/lineStreamBuf.h @@ -40,7 +40,7 @@ protected: virtual int sync(); private: - INLINE void write_chars(const char *start, int length); + INLINE void write_chars(const char *start, size_t length); string _data; bool _has_newline; diff --git a/dtool/src/dtoolutil/pandaSystem.cxx b/dtool/src/dtoolutil/pandaSystem.cxx index 2663797172..c4c94a59e1 100644 --- a/dtool/src/dtoolutil/pandaSystem.cxx +++ b/dtool/src/dtoolutil/pandaSystem.cxx @@ -349,7 +349,7 @@ has_system(const string &system) const { // get_system() to iterate through the entire list of // available Panda subsystems. //////////////////////////////////////////////////////////////////// -int PandaSystem:: +size_t PandaSystem:: get_num_systems() const { return _systems.size(); } @@ -362,8 +362,8 @@ get_num_systems() const { // order. //////////////////////////////////////////////////////////////////// string PandaSystem:: -get_system(int n) const { - if (n < 0 || n >= (int)_systems.size()) { +get_system(size_t n) const { + if (n >= _systems.size()) { return string(); } diff --git a/dtool/src/dtoolutil/pandaSystem.h b/dtool/src/dtoolutil/pandaSystem.h index f69b8adde1..2f100414fa 100644 --- a/dtool/src/dtoolutil/pandaSystem.h +++ b/dtool/src/dtoolutil/pandaSystem.h @@ -50,8 +50,8 @@ PUBLISHED: static string get_platform(); bool has_system(const string &system) const; - int get_num_systems() const; - string get_system(int n) const; + size_t get_num_systems() const; + string get_system(size_t n) const; MAKE_SEQ(get_systems, get_num_systems, get_system); string get_system_tag(const string &system, const string &tag) const; diff --git a/dtool/src/dtoolutil/textEncoder.I b/dtool/src/dtoolutil/textEncoder.I index aa0690337a..c8ef58751f 100644 --- a/dtool/src/dtoolutil/textEncoder.I +++ b/dtool/src/dtoolutil/textEncoder.I @@ -215,7 +215,7 @@ append_unicode_char(int character) { // This is a count of wide characters, after the string // has been decoded according to set_encoding(). //////////////////////////////////////////////////////////////////// -INLINE int TextEncoder:: +INLINE size_t TextEncoder:: get_num_chars() const { return get_wtext().length(); } @@ -229,9 +229,9 @@ get_num_chars() const { // according to set_encoding(). //////////////////////////////////////////////////////////////////// INLINE int TextEncoder:: -get_unicode_char(int index) const { +get_unicode_char(size_t index) const { get_wtext(); - if (index >= 0 && index < (int)_wtext.length()) { + if (index < _wtext.length()) { return _wtext[index]; } return 0; @@ -246,9 +246,9 @@ get_unicode_char(int index) const { // according to set_encoding(). //////////////////////////////////////////////////////////////////// INLINE void TextEncoder:: -set_unicode_char(int index, int character) { +set_unicode_char(size_t index, int character) { get_wtext(); - if (index >= 0 && index < (int)_wtext.length()) { + if (index < _wtext.length()) { _wtext[index] = character; _flags &= ~F_got_text; } @@ -261,7 +261,7 @@ set_unicode_char(int index, int character) { // two-, or three-byte encoded string. //////////////////////////////////////////////////////////////////// INLINE string TextEncoder:: -get_encoded_char(int index) const { +get_encoded_char(size_t index) const { return get_encoded_char(index, get_encoding()); } @@ -272,7 +272,7 @@ get_encoded_char(int index) const { // two-, or three-byte encoded string. //////////////////////////////////////////////////////////////////// INLINE string TextEncoder:: -get_encoded_char(int index, TextEncoder::Encoding encoding) const { +get_encoded_char(size_t index, TextEncoder::Encoding encoding) const { wstring wch(1, (wchar_t)get_unicode_char(index)); return encode_wtext(wch, encoding); } diff --git a/dtool/src/dtoolutil/textEncoder.h b/dtool/src/dtoolutil/textEncoder.h index 78499eaba6..5a8d7ecf9b 100644 --- a/dtool/src/dtoolutil/textEncoder.h +++ b/dtool/src/dtoolutil/textEncoder.h @@ -63,11 +63,11 @@ PUBLISHED: INLINE string get_text(Encoding encoding) const; INLINE void append_text(const string &text); INLINE void append_unicode_char(int character); - INLINE int get_num_chars() const; - INLINE int get_unicode_char(int index) const; - INLINE void set_unicode_char(int index, int character); - INLINE string get_encoded_char(int index) const; - INLINE string get_encoded_char(int index, Encoding encoding) const; + INLINE size_t get_num_chars() const; + INLINE int get_unicode_char(size_t index) const; + INLINE void set_unicode_char(size_t index, int character); + INLINE string get_encoded_char(size_t index) const; + INLINE string get_encoded_char(size_t index, Encoding encoding) const; INLINE string get_text_as_ascii() const; INLINE static string reencode_text(const string &text, Encoding from, Encoding to); diff --git a/dtool/src/dtoolutil/unicodeLatinMap.cxx b/dtool/src/dtoolutil/unicodeLatinMap.cxx index 5483df4138..b7348ff4e9 100644 --- a/dtool/src/dtoolutil/unicodeLatinMap.cxx +++ b/dtool/src/dtoolutil/unicodeLatinMap.cxx @@ -1299,7 +1299,7 @@ static const UnicodeLatinMap::Entry latin_map[] = { UnicodeLatinMap::AT_curl, 0 }, }; #ifndef CPPPARSER -static const int latin_map_length = sizeof(latin_map) / sizeof(UnicodeLatinMap::Entry); +static const size_t latin_map_length = sizeof(latin_map) / sizeof(UnicodeLatinMap::Entry); #endif @@ -1338,7 +1338,7 @@ void UnicodeLatinMap:: init() { if (!_initialized) { _by_character = new ByCharacter; - for (int i = 0; i < latin_map_length; i++) { + for (size_t i = 0; i < latin_map_length; i++) { const UnicodeLatinMap::Entry *entry = &latin_map[i]; // The first 256 characters are very common in Latin-alphabet diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 4c3dce249c..7f5859a233 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -3460,23 +3460,23 @@ write_function_for_name(ostream &out, Object *obj, if (map_sets.size() > 1) { switch (args_type) { case AT_keyword_args: - indent(out, 2) << "int parameter_count = PyTuple_Size(args);\n"; + indent(out, 2) << "Py_ssize_t parameter_count = PyTuple_Size(args);\n"; indent(out, 2) << "if (kwds != NULL) {\n"; indent(out, 2) << " parameter_count += PyDict_Size(kwds);\n"; indent(out, 2) << "}\n"; break; case AT_varargs: - indent(out, 2) << "int parameter_count = PyTuple_Size(args);\n"; + indent(out, 2) << "Py_ssize_t parameter_count = PyTuple_Size(args);\n"; break; case AT_single_arg: // It shouldn't get here, but we'll handle these cases nonetheless. - indent(out, 2) << "const int parameter_count = 1;\n"; + indent(out, 2) << "const Py_ssize_t parameter_count = 1;\n"; break; default: - indent(out, 2) << "const int parameter_count = 0;\n"; + indent(out, 2) << "const Py_ssize_t parameter_count = 0;\n"; break; } @@ -3571,19 +3571,19 @@ write_function_for_name(ostream &out, Object *obj, switch (args_type) { case AT_keyword_args: out << " if (PyTuple_Size(args) > 0 || (kwds != NULL && PyDict_Size(kwds) > 0)) {\n"; - out << " int parameter_count = PyTuple_Size(args);\n"; + out << " Py_ssize_t parameter_count = PyTuple_Size(args);\n"; out << " if (kwds != NULL) {\n"; out << " parameter_count += PyDict_Size(kwds);\n"; out << " }\n"; break; case AT_varargs: out << " if (PyTuple_Size(args) > 0) {\n"; - out << " const int parameter_count = PyTuple_GET_SIZE(args);\n"; + out << " const Py_ssize_t parameter_count = PyTuple_GET_SIZE(args);\n"; break; case AT_single_arg: // Shouldn't happen, but let's handle this case nonetheless. out << " {\n"; - out << " const int parameter_count = 1;\n"; + out << " const Py_ssize_t parameter_count = 1;\n"; break; case AT_no_args: break; @@ -3603,7 +3603,7 @@ write_function_for_name(ostream &out, Object *obj, } else if (args_type == AT_keyword_args && max_required_args == 1 && mii->first == 1) { // Check this to be sure, as we handle the case of only 1 keyword arg // in write_function_forset (not using ParseTupleAndKeywords). - out << " int parameter_count = PyTuple_Size(args);\n" + out << " Py_ssize_t parameter_count = PyTuple_Size(args);\n" " if (kwds != NULL) {\n" " parameter_count += PyDict_Size(kwds);\n" " }\n" @@ -3724,7 +3724,7 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { map_sets[i].insert(remap); } - int parameter_size = remap->_parameters.size(); + size_t parameter_size = remap->_parameters.size(); map_sets[parameter_size].insert(remap); } } @@ -3762,7 +3762,7 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) { map_sets[i].insert(remap); } - int parameter_size = remap->_parameters.size(); + size_t parameter_size = remap->_parameters.size(); map_sets[parameter_size].insert(remap); } } @@ -6679,7 +6679,7 @@ is_remap_legal(FunctionRemap *remap) { } // all non-optional params must be legal - for (int pn = 0; pn < (int)remap->_parameters.size(); pn++) { + for (size_t pn = 0; pn < remap->_parameters.size(); pn++) { ParameterRemap *param = remap->_parameters[pn]._remap; CPPType *orig_type = param->get_orig_type(); if (param->get_default_value() == NULL && !is_cpp_type_legal(orig_type)) { @@ -6767,12 +6767,12 @@ is_remap_coercion_possible(FunctionRemap *remap) { return false; } - int pn = 0; + size_t pn = 0; if (remap->_has_this) { // Skip the "this" parameter. It's never coercible. ++pn; } - while (pn < (int)remap->_parameters.size()) { + while (pn < remap->_parameters.size()) { CPPType *type = remap->_parameters[pn]._remap->get_new_type(); if (TypeManager::is_char_pointer(type)) { diff --git a/dtool/src/prc/configDeclaration.I b/dtool/src/prc/configDeclaration.I index bcb759c5d3..ac080d58ac 100644 --- a/dtool/src/prc/configDeclaration.I +++ b/dtool/src/prc/configDeclaration.I @@ -86,7 +86,7 @@ set_string_value(const string &string_value) { // value. A word is defined as a sequence of // non-whitespace characters delimited by whitespace. //////////////////////////////////////////////////////////////////// -INLINE int ConfigDeclaration:: +INLINE size_t ConfigDeclaration:: get_num_words() const { if (!_got_words) { ((ConfigDeclaration *)this)->get_words(); @@ -103,11 +103,11 @@ get_num_words() const { // the value. //////////////////////////////////////////////////////////////////// INLINE bool ConfigDeclaration:: -has_string_word(int n) const { +has_string_word(size_t n) const { if (!_got_words) { ((ConfigDeclaration *)this)->get_words(); } - return (n >= 0 && n < (int)_words.size()); + return (n < _words.size()); } //////////////////////////////////////////////////////////////////// @@ -117,7 +117,7 @@ has_string_word(int n) const { // boolean value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigDeclaration:: -has_bool_word(int n) const { +has_bool_word(size_t n) const { if (has_string_word(n)) { ((ConfigDeclaration *)this)->check_bool_word(n); return (_words[n]._flags & F_valid_bool) != 0; @@ -132,7 +132,7 @@ has_bool_word(int n) const { // integer value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigDeclaration:: -has_int_word(int n) const { +has_int_word(size_t n) const { if (has_string_word(n)) { ((ConfigDeclaration *)this)->check_int_word(n); return (_words[n]._flags & F_valid_int) != 0; @@ -147,7 +147,7 @@ has_int_word(int n) const { // int64 value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigDeclaration:: -has_int64_word(int n) const { +has_int64_word(size_t n) const { if (has_string_word(n)) { ((ConfigDeclaration *)this)->check_int64_word(n); return (_words[n]._flags & F_valid_int64) != 0; @@ -162,7 +162,7 @@ has_int64_word(int n) const { // integer value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigDeclaration:: -has_double_word(int n) const { +has_double_word(size_t n) const { if (has_string_word(n)) { ((ConfigDeclaration *)this)->check_double_word(n); return (_words[n]._flags & F_valid_double) != 0; @@ -178,7 +178,7 @@ has_double_word(int n) const { // nth value. See also has_string_word(). //////////////////////////////////////////////////////////////////// INLINE string ConfigDeclaration:: -get_string_word(int n) const { +get_string_word(size_t n) const { if (has_string_word(n)) { return _words[n]._str; } @@ -193,7 +193,7 @@ get_string_word(int n) const { // value. See also has_bool_word(). //////////////////////////////////////////////////////////////////// INLINE bool ConfigDeclaration:: -get_bool_word(int n) const { +get_bool_word(size_t n) const { // We use has_string_word() instead of has_bool_word(), so we can // return a partial answer if there was one. if (has_string_word(n)) { @@ -211,7 +211,7 @@ get_bool_word(int n) const { // See also has_int_word(). //////////////////////////////////////////////////////////////////// INLINE int ConfigDeclaration:: -get_int_word(int n) const { +get_int_word(size_t n) const { // We use has_string_word() instead of has_int_word(), so we can // return a partial answer if there was one. if (has_string_word(n)) { @@ -229,7 +229,7 @@ get_int_word(int n) const { // See also has_int64_word(). //////////////////////////////////////////////////////////////////// INLINE PN_int64 ConfigDeclaration:: -get_int64_word(int n) const { +get_int64_word(size_t n) const { // We use has_string_word() instead of has_int64_word(), so we can // return a partial answer if there was one. if (has_string_word(n)) { @@ -247,7 +247,7 @@ get_int64_word(int n) const { // See also has_double_word(). //////////////////////////////////////////////////////////////////// INLINE double ConfigDeclaration:: -get_double_word(int n) const { +get_double_word(size_t n) const { // We use has_string_word() instead of has_double_word(), so we can // return a partial answer if there was one. if (has_string_word(n)) { diff --git a/dtool/src/prc/configDeclaration.cxx b/dtool/src/prc/configDeclaration.cxx index 141c8d8adf..c2661e0035 100644 --- a/dtool/src/prc/configDeclaration.cxx +++ b/dtool/src/prc/configDeclaration.cxx @@ -58,7 +58,7 @@ ConfigDeclaration:: // affecting the other words. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -set_string_word(int n, const string &value) { +set_string_word(size_t n, const string &value) { if (!_got_words) { get_words(); } @@ -92,7 +92,7 @@ set_string_word(int n, const string &value) { // affecting the other words. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -set_bool_word(int n, bool value) { +set_bool_word(size_t n, bool value) { set_string_word(n, value ? "1" : "0"); _words[n]._flags |= (F_checked_bool | F_valid_bool); @@ -107,7 +107,7 @@ set_bool_word(int n, bool value) { // affecting the other words. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -set_int_word(int n, int value) { +set_int_word(size_t n, int value) { set_string_word(n, format_string(value)); _words[n]._flags |= (F_checked_int | F_valid_int); @@ -122,7 +122,7 @@ set_int_word(int n, int value) { // affecting the other words. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -set_int64_word(int n, PN_int64 value) { +set_int64_word(size_t n, PN_int64 value) { set_string_word(n, format_string(value)); _words[n]._flags |= (F_checked_int64 | F_valid_int64); @@ -137,7 +137,7 @@ set_int64_word(int n, PN_int64 value) { // affecting the other words. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -set_double_word(int n, double value) { +set_double_word(size_t n, double value) { set_string_word(n, format_string(value)); _words[n]._flags |= (F_checked_double | F_valid_double); @@ -202,7 +202,7 @@ get_words() { // boolean value. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -check_bool_word(int n) { +check_bool_word(size_t n) { if (!_got_words) { get_words(); } @@ -249,7 +249,7 @@ check_bool_word(int n) { // integer value. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -check_int_word(int n) { +check_int_word(size_t n) { if (!_got_words) { get_words(); } @@ -309,7 +309,7 @@ check_int_word(int n) { // integer value. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -check_int64_word(int n) { +check_int64_word(size_t n) { if (!_got_words) { get_words(); } @@ -367,7 +367,7 @@ check_int64_word(int n) { // floating-point value. //////////////////////////////////////////////////////////////////// void ConfigDeclaration:: -check_double_word(int n) { +check_double_word(size_t n) { if (!_got_words) { get_words(); } @@ -403,9 +403,9 @@ check_double_word(int n) { // // The return value is the number of words extracted. //////////////////////////////////////////////////////////////////// -int ConfigDeclaration:: +size_t ConfigDeclaration:: extract_words(const string &str, vector_string &words) { - int num_words = 0; + size_t num_words = 0; size_t pos = 0; while (pos < str.length() && isspace((unsigned int)str[pos])) { @@ -439,7 +439,7 @@ downcase(const string &s) { result.reserve(s.size()); string::const_iterator p; for (p = s.begin(); p != s.end(); ++p) { - result += tolower(*p); + result += (char)tolower(*p); } return result; } diff --git a/dtool/src/prc/configDeclaration.h b/dtool/src/prc/configDeclaration.h index 532b03f211..ecbabc92be 100644 --- a/dtool/src/prc/configDeclaration.h +++ b/dtool/src/prc/configDeclaration.h @@ -49,25 +49,25 @@ PUBLISHED: INLINE const string &get_string_value() const; INLINE void set_string_value(const string &value); - INLINE int get_num_words() const; + INLINE size_t get_num_words() const; - INLINE bool has_string_word(int n) const; - INLINE bool has_bool_word(int n) const; - INLINE bool has_int_word(int n) const; - INLINE bool has_int64_word(int n) const; - INLINE bool has_double_word(int n) const; + INLINE bool has_string_word(size_t n) const; + INLINE bool has_bool_word(size_t n) const; + INLINE bool has_int_word(size_t n) const; + INLINE bool has_int64_word(size_t n) const; + INLINE bool has_double_word(size_t n) const; - INLINE string get_string_word(int n) const; - INLINE bool get_bool_word(int n) const; - INLINE int get_int_word(int n) const; - INLINE PN_int64 get_int64_word(int n) const; - INLINE double get_double_word(int n) const; + INLINE string get_string_word(size_t n) const; + INLINE bool get_bool_word(size_t n) const; + INLINE int get_int_word(size_t n) const; + INLINE PN_int64 get_int64_word(size_t n) const; + INLINE double get_double_word(size_t n) const; - void set_string_word(int n, const string &value); - void set_bool_word(int n, bool value); - void set_int_word(int n, int value); - void set_int64_word(int n, PN_int64 value); - void set_double_word(int n, double value); + void set_string_word(size_t n, const string &value); + void set_bool_word(size_t n, bool value); + void set_int_word(size_t n, int value); + void set_int64_word(size_t n, PN_int64 value); + void set_double_word(size_t n, double value); INLINE int get_decl_seq() const; @@ -75,15 +75,15 @@ PUBLISHED: void write(ostream &out) const; public: - static int extract_words(const string &str, vector_string &words); + static size_t extract_words(const string &str, vector_string &words); static string downcase(const string &s); private: void get_words(); - void check_bool_word(int n); - void check_int_word(int n); - void check_int64_word(int n); - void check_double_word(int n); + void check_bool_word(size_t n); + void check_int_word(size_t n); + void check_int64_word(size_t n); + void check_double_word(size_t n); private: ConfigPage *_page; diff --git a/dtool/src/prc/configPage.cxx b/dtool/src/prc/configPage.cxx index 247ce864a2..4148c64ca7 100644 --- a/dtool/src/prc/configPage.cxx +++ b/dtool/src/prc/configPage.cxx @@ -321,7 +321,7 @@ delete_declaration(ConfigDeclaration *decl) { // Access: Published // Description: Returns the number of declarations on the page. //////////////////////////////////////////////////////////////////// -int ConfigPage:: +size_t ConfigPage:: get_num_declarations() const { return _declarations.size(); } @@ -332,8 +332,8 @@ get_num_declarations() const { // Description: Returns the nth declaration on the page. //////////////////////////////////////////////////////////////////// const ConfigDeclaration *ConfigPage:: -get_declaration(int n) const { - nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL); +get_declaration(size_t n) const { + nassertr(n < _declarations.size(), (ConfigDeclaration *)NULL); return _declarations[n]; } @@ -346,8 +346,8 @@ get_declaration(int n) const { // ConfigPage::write(). //////////////////////////////////////////////////////////////////// ConfigDeclaration *ConfigPage:: -modify_declaration(int n) { - nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL); +modify_declaration(size_t n) { + nassertr(n < _declarations.size(), (ConfigDeclaration *)NULL); return _declarations[n]; } @@ -358,8 +358,8 @@ modify_declaration(int n) { // the page. //////////////////////////////////////////////////////////////////// string ConfigPage:: -get_variable_name(int n) const { - nassertr(n >= 0 && n < (int)_declarations.size(), string()); +get_variable_name(size_t n) const { + nassertr(n < _declarations.size(), string()); return _declarations[n]->get_variable()->get_name(); } @@ -370,8 +370,8 @@ get_variable_name(int n) const { // the page. //////////////////////////////////////////////////////////////////// string ConfigPage:: -get_string_value(int n) const { - nassertr(n >= 0 && n < (int)_declarations.size(), string()); +get_string_value(size_t n) const { + nassertr(n < _declarations.size(), string()); return _declarations[n]->get_string_value(); } @@ -382,8 +382,8 @@ get_string_value(int n) const { // the page has been used by code, false otherwise. //////////////////////////////////////////////////////////////////// bool ConfigPage:: -is_variable_used(int n) const { - nassertr(n >= 0 && n < (int)_declarations.size(), false); +is_variable_used(size_t n) const { + nassertr(n < _declarations.size(), false); return _declarations[n]->get_variable()->is_used(); } diff --git a/dtool/src/prc/configPage.h b/dtool/src/prc/configPage.h index 62fb66f694..fe2ba92d4e 100644 --- a/dtool/src/prc/configPage.h +++ b/dtool/src/prc/configPage.h @@ -63,12 +63,12 @@ PUBLISHED: ConfigDeclaration *make_declaration(ConfigVariableCore *variable, const string &value); bool delete_declaration(ConfigDeclaration *decl); - int get_num_declarations() const; - const ConfigDeclaration *get_declaration(int n) const; - ConfigDeclaration *modify_declaration(int n); - string get_variable_name(int n) const; - string get_string_value(int n) const; - bool is_variable_used(int n) const; + size_t get_num_declarations() const; + const ConfigDeclaration *get_declaration(size_t n) const; + ConfigDeclaration *modify_declaration(size_t n); + string get_variable_name(size_t n) const; + string get_string_value(size_t n) const; + bool is_variable_used(size_t n) const; void output(ostream &out) const; void output_brief_signature(ostream &out) const; diff --git a/dtool/src/prc/configPageManager.I b/dtool/src/prc/configPageManager.I index f6ad1f78cc..9ca0abb8ca 100644 --- a/dtool/src/prc/configPageManager.I +++ b/dtool/src/prc/configPageManager.I @@ -66,7 +66,7 @@ get_search_path() { // specified with the PRC_FILENAME variable in // Config.pp. //////////////////////////////////////////////////////////////////// -INLINE int ConfigPageManager:: +INLINE size_t ConfigPageManager:: get_num_prc_patterns() const { return _prc_patterns.size(); } @@ -79,8 +79,8 @@ get_num_prc_patterns() const { // get_num_prc_patterns(). //////////////////////////////////////////////////////////////////// INLINE string ConfigPageManager:: -get_prc_pattern(int n) const { - nassertr(n >= 0 && n < (int)_prc_patterns.size(), string()); +get_prc_pattern(size_t n) const { + nassertr(n < _prc_patterns.size(), string()); return _prc_patterns[n].get_pattern(); } @@ -91,7 +91,7 @@ get_prc_pattern(int n) const { // are compiled in that will be searched for as special // config files that are understood to be encrypted. //////////////////////////////////////////////////////////////////// -INLINE int ConfigPageManager:: +INLINE size_t ConfigPageManager:: get_num_prc_encrypted_patterns() const { return _prc_encrypted_patterns.size(); } @@ -104,8 +104,8 @@ get_num_prc_encrypted_patterns() const { // file. See get_num_prc_encrypted_patterns(). //////////////////////////////////////////////////////////////////// INLINE string ConfigPageManager:: -get_prc_encrypted_pattern(int n) const { - nassertr(n >= 0 && n < (int)_prc_patterns.size(), string()); +get_prc_encrypted_pattern(size_t n) const { + nassertr(n < _prc_patterns.size(), string()); return _prc_encrypted_patterns[n].get_pattern(); } @@ -118,7 +118,7 @@ get_prc_encrypted_pattern(int n) const { // and their output taken to be input. This is normally // empty. //////////////////////////////////////////////////////////////////// -INLINE int ConfigPageManager:: +INLINE size_t ConfigPageManager:: get_num_prc_executable_patterns() const { return _prc_executable_patterns.size(); } @@ -131,8 +131,8 @@ get_num_prc_executable_patterns() const { // file. See get_num_prc_executable_patterns(). //////////////////////////////////////////////////////////////////// INLINE string ConfigPageManager:: -get_prc_executable_pattern(int n) const { - nassertr(n >= 0 && n < (int)_prc_patterns.size(), string()); +get_prc_executable_pattern(size_t n) const { + nassertr(n < _prc_patterns.size(), string()); return _prc_executable_patterns[n].get_pattern(); } @@ -144,7 +144,7 @@ get_prc_executable_pattern(int n) const { // were automatically discovered on the disk as .prc // files. //////////////////////////////////////////////////////////////////// -INLINE int ConfigPageManager:: +INLINE size_t ConfigPageManager:: get_num_implicit_pages() const { return _implicit_pages.size(); } @@ -156,9 +156,9 @@ get_num_implicit_pages() const { // See get_num_implicit_pages(). //////////////////////////////////////////////////////////////////// INLINE ConfigPage *ConfigPageManager:: -get_implicit_page(int n) const { +get_implicit_page(size_t n) const { check_sort_pages(); - nassertr(n >= 0 && n < (int)_implicit_pages.size(), (ConfigPage *)NULL); + nassertr(n < _implicit_pages.size(), (ConfigPage *)NULL); return _implicit_pages[n]; } @@ -170,7 +170,7 @@ get_implicit_page(int n) const { // were loaded dynamically at runtime by explicit calls // to ConfigPageManager::make_explicit_page(). //////////////////////////////////////////////////////////////////// -INLINE int ConfigPageManager:: +INLINE size_t ConfigPageManager:: get_num_explicit_pages() const { return _explicit_pages.size(); } @@ -182,9 +182,9 @@ get_num_explicit_pages() const { // See get_num_explicit_pages(). //////////////////////////////////////////////////////////////////// INLINE ConfigPage *ConfigPageManager:: -get_explicit_page(int n) const { +get_explicit_page(size_t n) const { check_sort_pages(); - nassertr(n >= 0 && n < (int)_explicit_pages.size(), (ConfigPage *)NULL); + nassertr(n < _explicit_pages.size(), (ConfigPage *)NULL); return _explicit_pages[n]; } diff --git a/dtool/src/prc/configPageManager.h b/dtool/src/prc/configPageManager.h index c3ce0a757c..acc5acd0e1 100644 --- a/dtool/src/prc/configPageManager.h +++ b/dtool/src/prc/configPageManager.h @@ -43,23 +43,23 @@ PUBLISHED: INLINE DSearchPath &get_search_path(); - INLINE int get_num_prc_patterns() const; - INLINE string get_prc_pattern(int n) const; + INLINE size_t get_num_prc_patterns() const; + INLINE string get_prc_pattern(size_t n) const; - INLINE int get_num_prc_encrypted_patterns() const; - INLINE string get_prc_encrypted_pattern(int n) const; + INLINE size_t get_num_prc_encrypted_patterns() const; + INLINE string get_prc_encrypted_pattern(size_t n) const; - INLINE int get_num_prc_executable_patterns() const; - INLINE string get_prc_executable_pattern(int n) const; + INLINE size_t get_num_prc_executable_patterns() const; + INLINE string get_prc_executable_pattern(size_t n) const; ConfigPage *make_explicit_page(const string &name); bool delete_explicit_page(ConfigPage *page); - INLINE int get_num_implicit_pages() const; - INLINE ConfigPage *get_implicit_page(int n) const; + INLINE size_t get_num_implicit_pages() const; + INLINE ConfigPage *get_implicit_page(size_t n) const; - INLINE int get_num_explicit_pages() const; - INLINE ConfigPage *get_explicit_page(int n) const; + INLINE size_t get_num_explicit_pages() const; + INLINE ConfigPage *get_explicit_page(size_t n) const; void output(ostream &out) const; void write(ostream &out) const; diff --git a/dtool/src/prc/configVariable.I b/dtool/src/prc/configVariable.I index 2b50e2a542..435233e459 100644 --- a/dtool/src/prc/configVariable.I +++ b/dtool/src/prc/configVariable.I @@ -122,7 +122,7 @@ clear_value() { // value. A word is defined as a sequence of // non-whitespace characters delimited by whitespace. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariable:: +INLINE size_t ConfigVariable:: get_num_words() const { nassertr(is_constructed(), 0); const ConfigDeclaration *decl = _core->get_declaration(0); @@ -138,7 +138,7 @@ get_num_words() const { // the value. //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariable:: -has_string_word(int n) const { +has_string_word(size_t n) const { nassertr(is_constructed(), false); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->has_string_word(n); @@ -151,7 +151,7 @@ has_string_word(int n) const { // boolean value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariable:: -has_bool_word(int n) const { +has_bool_word(size_t n) const { nassertr(is_constructed(), false); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->has_bool_word(n); @@ -164,7 +164,7 @@ has_bool_word(int n) const { // integer value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariable:: -has_int_word(int n) const { +has_int_word(size_t n) const { nassertr(is_constructed(), false); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->has_int_word(n); @@ -177,7 +177,7 @@ has_int_word(int n) const { // 64-bit integer value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariable:: -has_int64_word(int n) const { +has_int64_word(size_t n) const { nassertr(is_constructed(), false); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->has_int64_word(n); @@ -190,7 +190,7 @@ has_int64_word(int n) const { // integer value for the nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariable:: -has_double_word(int n) const { +has_double_word(size_t n) const { nassertr(is_constructed(), false); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->has_double_word(n); @@ -204,7 +204,7 @@ has_double_word(int n) const { // nth value. See also has_string_word(). //////////////////////////////////////////////////////////////////// INLINE string ConfigVariable:: -get_string_word(int n) const { +get_string_word(size_t n) const { nassertr(is_constructed(), string()); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->get_string_word(n); @@ -218,7 +218,7 @@ get_string_word(int n) const { // value. See also has_bool_word(). //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariable:: -get_bool_word(int n) const { +get_bool_word(size_t n) const { nassertr(is_constructed(), false); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->get_bool_word(n); @@ -232,7 +232,7 @@ get_bool_word(int n) const { // See also has_int_word(). //////////////////////////////////////////////////////////////////// INLINE int ConfigVariable:: -get_int_word(int n) const { +get_int_word(size_t n) const { nassertr(is_constructed(), 0); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->get_int_word(n); @@ -246,7 +246,7 @@ get_int_word(int n) const { // See also has_int_word(). //////////////////////////////////////////////////////////////////// INLINE PN_int64 ConfigVariable:: -get_int64_word(int n) const { +get_int64_word(size_t n) const { nassertr(is_constructed(), 0); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->get_int64_word(n); @@ -260,7 +260,7 @@ get_int64_word(int n) const { // See also has_double_word(). //////////////////////////////////////////////////////////////////// INLINE double ConfigVariable:: -get_double_word(int n) const { +get_double_word(size_t n) const { nassertr(is_constructed(), 0.0); const ConfigDeclaration *decl = _core->get_declaration(0); return decl->get_double_word(n); @@ -273,7 +273,7 @@ get_double_word(int n) const { // affecting the other words. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariable:: -set_string_word(int n, const string &value) { +set_string_word(size_t n, const string &value) { nassertv(is_constructed()); _core->make_local_value()->set_string_word(n, value); } @@ -285,7 +285,7 @@ set_string_word(int n, const string &value) { // affecting the other words. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariable:: -set_bool_word(int n, bool value) { +set_bool_word(size_t n, bool value) { nassertv(is_constructed()); _core->make_local_value()->set_bool_word(n, value); } @@ -297,7 +297,7 @@ set_bool_word(int n, bool value) { // affecting the other words. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariable:: -set_int_word(int n, int value) { +set_int_word(size_t n, int value) { nassertv(is_constructed()); _core->make_local_value()->set_int_word(n, value); } @@ -309,7 +309,7 @@ set_int_word(int n, int value) { // affecting the other words. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariable:: -set_int64_word(int n, PN_int64 value) { +set_int64_word(size_t n, PN_int64 value) { nassertv(is_constructed()); _core->make_local_value()->set_int64_word(n, value); } @@ -321,7 +321,7 @@ set_int64_word(int n, PN_int64 value) { // affecting the other words. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariable:: -set_double_word(int n, double value) { +set_double_word(size_t n, double value) { nassertv(is_constructed()); _core->make_local_value()->set_double_word(n, value); } diff --git a/dtool/src/prc/configVariable.h b/dtool/src/prc/configVariable.h index abc8575412..17e251a307 100644 --- a/dtool/src/prc/configVariable.h +++ b/dtool/src/prc/configVariable.h @@ -48,25 +48,25 @@ PUBLISHED: INLINE void set_string_value(const string &value); INLINE void clear_value(); - INLINE int get_num_words() const; + INLINE size_t get_num_words() const; - INLINE bool has_string_word(int n) const; - INLINE bool has_bool_word(int n) const; - INLINE bool has_int_word(int n) const; - INLINE bool has_int64_word(int n) const; - INLINE bool has_double_word(int n) const; + INLINE bool has_string_word(size_t n) const; + INLINE bool has_bool_word(size_t n) const; + INLINE bool has_int_word(size_t n) const; + INLINE bool has_int64_word(size_t n) const; + INLINE bool has_double_word(size_t n) const; - INLINE string get_string_word(int n) const; - INLINE bool get_bool_word(int n) const; - INLINE int get_int_word(int n) const; - INLINE PN_int64 get_int64_word(int n) const; - INLINE double get_double_word(int n) const; + INLINE string get_string_word(size_t n) const; + INLINE bool get_bool_word(size_t n) const; + INLINE int get_int_word(size_t n) const; + INLINE PN_int64 get_int64_word(size_t n) const; + INLINE double get_double_word(size_t n) const; - INLINE void set_string_word(int n, const string &value); - INLINE void set_bool_word(int n, bool value); - INLINE void set_int_word(int n, int value); - INLINE void set_int64_word(int n, PN_int64 value); - INLINE void set_double_word(int n, double value); + INLINE void set_string_word(size_t n, const string &value); + INLINE void set_bool_word(size_t n, bool value); + INLINE void set_int_word(size_t n, int value); + INLINE void set_int64_word(size_t n, PN_int64 value); + INLINE void set_double_word(size_t n, double value); protected: INLINE bool is_constructed() const; diff --git a/dtool/src/prc/configVariableBool.I b/dtool/src/prc/configVariableBool.I index 717ae70033..7336bb44ba 100644 --- a/dtool/src/prc/configVariableBool.I +++ b/dtool/src/prc/configVariableBool.I @@ -89,7 +89,7 @@ operator bool () const { // Access: Published // Description: Returns the number of unique words in the variable. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableBool:: +INLINE size_t ConfigVariableBool:: size() const { return get_num_words(); } @@ -100,7 +100,7 @@ size() const { // Description: Returns the value of the variable's nth word. //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariableBool:: -operator [] (int n) const { +operator [] (size_t n) const { return get_word(n); } @@ -150,7 +150,7 @@ get_default_value() const { // Description: Returns the variable's nth value. //////////////////////////////////////////////////////////////////// INLINE bool ConfigVariableBool:: -get_word(int n) const { +get_word(size_t n) const { return get_bool_word(n); } @@ -161,6 +161,6 @@ get_word(int n) const { // local copy of the variable's overall value. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariableBool:: -set_word(int n, bool value) { +set_word(size_t n, bool value) { set_bool_word(n, value); } diff --git a/dtool/src/prc/configVariableBool.h b/dtool/src/prc/configVariableBool.h index 433c2ebccc..4dbeeaee2e 100644 --- a/dtool/src/prc/configVariableBool.h +++ b/dtool/src/prc/configVariableBool.h @@ -34,15 +34,15 @@ PUBLISHED: INLINE void operator = (bool value); INLINE operator bool () const; - INLINE int size() const; - INLINE bool operator [] (int n) const; + INLINE size_t size() const; + INLINE bool operator [] (size_t n) const; INLINE void set_value(bool value); INLINE bool get_value() const; INLINE bool get_default_value() const; - INLINE bool get_word(int n) const; - INLINE void set_word(int n, bool value); + INLINE bool get_word(size_t n) const; + INLINE void set_word(size_t n, bool value); private: AtomicAdjust::Integer _local_modified; diff --git a/dtool/src/prc/configVariableCore.I b/dtool/src/prc/configVariableCore.I index faa68c8c88..2512a4e7bb 100644 --- a/dtool/src/prc/configVariableCore.I +++ b/dtool/src/prc/configVariableCore.I @@ -166,7 +166,7 @@ has_local_value() const { // variable. This is not exactly the same as the number // of declarations; see get_reference(). //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableCore:: +INLINE size_t ConfigVariableCore:: get_num_references() const { check_sort_declarations(); return _declarations.size(); @@ -184,9 +184,9 @@ get_num_references() const { // untrusted files. //////////////////////////////////////////////////////////////////// INLINE const ConfigDeclaration *ConfigVariableCore:: -get_reference(int n) const { +get_reference(size_t n) const { check_sort_declarations(); - nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL); + nassertr(n < _declarations.size(), (ConfigDeclaration *)NULL); return _declarations[n]; } @@ -197,7 +197,7 @@ get_reference(int n) const { // reference this variable. See also // get_num_references(). //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableCore:: +INLINE size_t ConfigVariableCore:: get_num_trusted_references() const { check_sort_declarations(); return _trusted_declarations.size(); @@ -218,9 +218,9 @@ get_num_trusted_references() const { // untrusted ones. //////////////////////////////////////////////////////////////////// INLINE const ConfigDeclaration *ConfigVariableCore:: -get_trusted_reference(int n) const { +get_trusted_reference(size_t n) const { check_sort_declarations(); - nassertr(n >= 0 && n < (int)_trusted_declarations.size(), (ConfigDeclaration *)NULL); + nassertr(n < _trusted_declarations.size(), (ConfigDeclaration *)NULL); return _trusted_declarations[n]; } @@ -230,7 +230,7 @@ get_trusted_reference(int n) const { // Description: Returns the number of trusted, unique (by string // value) values there exist for this variable. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableCore:: +INLINE size_t ConfigVariableCore:: get_num_unique_references() const { check_sort_declarations(); return _unique_declarations.size(); @@ -245,9 +245,9 @@ get_num_unique_references() const { // are removed. //////////////////////////////////////////////////////////////////// INLINE const ConfigDeclaration *ConfigVariableCore:: -get_unique_reference(int n) const { +get_unique_reference(size_t n) const { check_sort_declarations(); - nassertr(n >= 0 && n < (int)_unique_declarations.size(), (ConfigDeclaration *)NULL); + nassertr(n < _unique_declarations.size(), (ConfigDeclaration *)NULL); return _unique_declarations[n]; } @@ -263,7 +263,7 @@ check_sort_declarations() const { // loaded. This may unsort the list by adding a bunch more // declarations. ConfigPageManager::get_global_ptr()->load_implicit_pages(); - + // Then sort the list if it needs it. if (!_declarations_sorted) { ((ConfigVariableCore *)this)->sort_declarations(); diff --git a/dtool/src/prc/configVariableCore.cxx b/dtool/src/prc/configVariableCore.cxx index a511efd8bf..ce8c32a669 100644 --- a/dtool/src/prc/configVariableCore.cxx +++ b/dtool/src/prc/configVariableCore.cxx @@ -318,7 +318,7 @@ has_value() const { // defined, this will always be at least 1 (for the // default value, at least). //////////////////////////////////////////////////////////////////// -int ConfigVariableCore:: +size_t ConfigVariableCore:: get_num_declarations() const { if (has_local_value()) { return 1; @@ -343,7 +343,7 @@ get_num_declarations() const { // variable. //////////////////////////////////////////////////////////////////// const ConfigDeclaration *ConfigVariableCore:: -get_declaration(int n) const { +get_declaration(size_t n) const { ((ConfigVariableCore *)this)->_value_queried = true; if (_default_value == (ConfigDeclaration *)NULL) { prc_cat->warning() @@ -356,7 +356,7 @@ get_declaration(int n) const { return _local_value; } check_sort_declarations(); - if (n >= 0 && n < (int)_trusted_declarations.size()) { + if (n < _trusted_declarations.size()) { return _trusted_declarations[n]; } return _default_value; diff --git a/dtool/src/prc/configVariableCore.h b/dtool/src/prc/configVariableCore.h index 96cf536c8f..e8b74bc59a 100644 --- a/dtool/src/prc/configVariableCore.h +++ b/dtool/src/prc/configVariableCore.h @@ -64,20 +64,20 @@ PUBLISHED: INLINE bool has_local_value() const; bool has_value() const; - int get_num_declarations() const; - const ConfigDeclaration *get_declaration(int n) const; + size_t get_num_declarations() const; + const ConfigDeclaration *get_declaration(size_t n) const; MAKE_SEQ(get_declarations, get_num_declarations, get_declaration); - INLINE int get_num_references() const; - INLINE const ConfigDeclaration *get_reference(int n) const; + INLINE size_t get_num_references() const; + INLINE const ConfigDeclaration *get_reference(size_t n) const; MAKE_SEQ(get_references, get_num_references, get_reference); - INLINE int get_num_trusted_references() const; - INLINE const ConfigDeclaration *get_trusted_reference(int n) const; + INLINE size_t get_num_trusted_references() const; + INLINE const ConfigDeclaration *get_trusted_reference(size_t n) const; MAKE_SEQ(get_trusted_references, get_num_trusted_references, get_trusted_reference); - INLINE int get_num_unique_references() const; - INLINE const ConfigDeclaration *get_unique_reference(int n) const; + INLINE size_t get_num_unique_references() const; + INLINE const ConfigDeclaration *get_unique_reference(size_t n) const; MAKE_SEQ(get_unique_references, get_num_unique_references, get_unique_reference); void output(ostream &out) const; diff --git a/dtool/src/prc/configVariableDouble.I b/dtool/src/prc/configVariableDouble.I index 561fb46fae..2daafb82a3 100644 --- a/dtool/src/prc/configVariableDouble.I +++ b/dtool/src/prc/configVariableDouble.I @@ -89,7 +89,7 @@ operator double () const { // Access: Published // Description: Returns the number of unique words in the variable. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableDouble:: +INLINE size_t ConfigVariableDouble:: size() const { return get_num_words(); } @@ -100,7 +100,7 @@ size() const { // Description: Returns the value of the variable's nth word. //////////////////////////////////////////////////////////////////// INLINE double ConfigVariableDouble:: -operator [] (int n) const { +operator [] (size_t n) const { return get_word(n); } @@ -150,7 +150,7 @@ get_default_value() const { // Description: Returns the variable's nth value. //////////////////////////////////////////////////////////////////// INLINE double ConfigVariableDouble:: -get_word(int n) const { +get_word(size_t n) const { return get_double_word(n); } @@ -161,6 +161,6 @@ get_word(int n) const { // local copy of the variable's overall value. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariableDouble:: -set_word(int n, double value) { +set_word(size_t n, double value) { set_double_word(n, value); } diff --git a/dtool/src/prc/configVariableDouble.h b/dtool/src/prc/configVariableDouble.h index 17ad4bb235..9a55c98357 100644 --- a/dtool/src/prc/configVariableDouble.h +++ b/dtool/src/prc/configVariableDouble.h @@ -36,15 +36,15 @@ PUBLISHED: INLINE void operator = (double value); INLINE operator double () const; - INLINE int size() const; - INLINE double operator [] (int n) const; + INLINE size_t size() const; + INLINE double operator [] (size_t n) const; INLINE void set_value(double value); INLINE double get_value() const; INLINE double get_default_value() const; - INLINE double get_word(int n) const; - INLINE void set_word(int n, double value); + INLINE double get_word(size_t n) const; + INLINE void set_word(size_t n, double value); private: void set_default_value(double default_value); diff --git a/dtool/src/prc/configVariableEnum.I b/dtool/src/prc/configVariableEnum.I index cd0883eea5..a65d6e18d6 100644 --- a/dtool/src/prc/configVariableEnum.I +++ b/dtool/src/prc/configVariableEnum.I @@ -95,7 +95,7 @@ operator EnumType () const { // Description: Returns the number of unique words in the variable. //////////////////////////////////////////////////////////////////// template -INLINE int ConfigVariableEnum:: +INLINE size_t ConfigVariableEnum:: size() const { return get_num_words(); } @@ -107,7 +107,7 @@ size() const { //////////////////////////////////////////////////////////////////// template INLINE EnumType ConfigVariableEnum:: -operator [] (int n) const { +operator [] (size_t n) const { return get_word(n); } @@ -163,7 +163,7 @@ get_default_value() const { //////////////////////////////////////////////////////////////////// template INLINE EnumType ConfigVariableEnum:: -get_word(int n) const { +get_word(size_t n) const { return (EnumType)parse_string(get_string_word(n)); } @@ -175,7 +175,7 @@ get_word(int n) const { //////////////////////////////////////////////////////////////////// template INLINE void ConfigVariableEnum:: -set_word(int n, EnumType value) { +set_word(size_t n, EnumType value) { set_string_word(n, format_enum(value)); } diff --git a/dtool/src/prc/configVariableEnum.h b/dtool/src/prc/configVariableEnum.h index 5bbb9433d9..b8dbfd2860 100644 --- a/dtool/src/prc/configVariableEnum.h +++ b/dtool/src/prc/configVariableEnum.h @@ -45,15 +45,15 @@ public: INLINE void operator = (EnumType value); INLINE operator EnumType () const; - INLINE int size() const; - INLINE EnumType operator [] (int n) const; + INLINE size_t size() const; + INLINE EnumType operator [] (size_t n) const; INLINE void set_value(EnumType value); INLINE EnumType get_value() const; INLINE EnumType get_default_value() const; - INLINE EnumType get_word(int n) const; - INLINE void set_word(int n, EnumType value); + INLINE EnumType get_word(size_t n) const; + INLINE void set_word(size_t n, EnumType value); private: INLINE EnumType parse_string(const string &value) const; diff --git a/dtool/src/prc/configVariableFilename.I b/dtool/src/prc/configVariableFilename.I index e6e4fc0778..e1cec7974c 100644 --- a/dtool/src/prc/configVariableFilename.I +++ b/dtool/src/prc/configVariableFilename.I @@ -101,7 +101,7 @@ length() const { // Description: //////////////////////////////////////////////////////////////////// INLINE char ConfigVariableFilename:: -operator [] (int n) const { +operator [] (size_t n) const { return get_ref_value()[n]; } @@ -254,7 +254,7 @@ get_default_value() const { // Description: Returns the variable's nth value. //////////////////////////////////////////////////////////////////// INLINE Filename ConfigVariableFilename:: -get_word(int n) const { +get_word(size_t n) const { return Filename::expand_from(get_string_word(n)); } @@ -265,7 +265,7 @@ get_word(int n) const { // local copy of the variable's overall value. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariableFilename:: -set_word(int n, const Filename &value) { +set_word(size_t n, const Filename &value) { set_string_word(n, value); } diff --git a/dtool/src/prc/configVariableFilename.h b/dtool/src/prc/configVariableFilename.h index 6fb450aa5f..b6dc02ea5e 100644 --- a/dtool/src/prc/configVariableFilename.h +++ b/dtool/src/prc/configVariableFilename.h @@ -41,7 +41,7 @@ PUBLISHED: INLINE const char *c_str() const; INLINE bool empty() const; INLINE size_t length() const; - INLINE char operator [] (int n) const; + INLINE char operator [] (size_t n) const; INLINE string get_fullpath() const; INLINE string get_dirname() const; @@ -59,8 +59,8 @@ PUBLISHED: INLINE Filename get_value() const; INLINE Filename get_default_value() const; - INLINE Filename get_word(int n) const; - INLINE void set_word(int n, const Filename &value); + INLINE Filename get_word(size_t n) const; + INLINE void set_word(size_t n, const Filename &value); private: void reload_cache(); diff --git a/dtool/src/prc/configVariableInt.I b/dtool/src/prc/configVariableInt.I index 17383bebe4..8d56e00c52 100644 --- a/dtool/src/prc/configVariableInt.I +++ b/dtool/src/prc/configVariableInt.I @@ -89,7 +89,7 @@ operator int () const { // Access: Published // Description: Returns the number of unique words in the variable. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableInt:: +INLINE size_t ConfigVariableInt:: size() const { return get_num_words(); } @@ -100,7 +100,7 @@ size() const { // Description: Returns the value of the variable's nth word. //////////////////////////////////////////////////////////////////// INLINE int ConfigVariableInt:: -operator [] (int n) const { +operator [] (size_t n) const { return get_word(n); } @@ -150,7 +150,7 @@ get_default_value() const { // Description: Returns the variable's nth value. //////////////////////////////////////////////////////////////////// INLINE int ConfigVariableInt:: -get_word(int n) const { +get_word(size_t n) const { return get_int_word(n); } @@ -161,7 +161,7 @@ get_word(int n) const { // local copy of the variable's overall value. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariableInt:: -set_word(int n, int value) { +set_word(size_t n, int value) { set_int_word(n, value); } diff --git a/dtool/src/prc/configVariableInt.h b/dtool/src/prc/configVariableInt.h index c84031f0b0..508d6ba358 100644 --- a/dtool/src/prc/configVariableInt.h +++ b/dtool/src/prc/configVariableInt.h @@ -36,15 +36,15 @@ PUBLISHED: INLINE void operator = (int value); INLINE operator int () const; - INLINE int size() const; - INLINE int operator [] (int n) const; + INLINE size_t size() const; + INLINE int operator [] (size_t n) const; INLINE void set_value(int value); INLINE int get_value() const; INLINE int get_default_value() const; - INLINE int get_word(int n) const; - INLINE void set_word(int n, int value); + INLINE int get_word(size_t n) const; + INLINE void set_word(size_t n, int value); private: void set_default_value(int default_value); diff --git a/dtool/src/prc/configVariableInt64.I b/dtool/src/prc/configVariableInt64.I index b026e74625..d45511df4d 100644 --- a/dtool/src/prc/configVariableInt64.I +++ b/dtool/src/prc/configVariableInt64.I @@ -29,11 +29,11 @@ ConfigVariableInt64(const string &name) : //////////////////////////////////////////////////////////////////// // Function: ConfigVariableInt64::Constructor // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE ConfigVariableInt64:: -ConfigVariableInt64(const string &name, PN_int64 default_value, - const string &description, PN_int64 flags) : +ConfigVariableInt64(const string &name, PN_int64 default_value, + const string &description, int flags) : #ifdef PRC_SAVE_DESCRIPTIONS ConfigVariable(name, ConfigVariableCore::VT_int64, description, flags), #else @@ -48,11 +48,11 @@ ConfigVariableInt64(const string &name, PN_int64 default_value, //////////////////////////////////////////////////////////////////// // Function: ConfigVariableInt64::Constructor // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// INLINE ConfigVariableInt64:: -ConfigVariableInt64(const string &name, const string &default_value, - const string &description, PN_int64 flags) : +ConfigVariableInt64(const string &name, const string &default_value, + const string &description, int flags) : #ifdef PRC_SAVE_DESCRIPTIONS ConfigVariable(name, ConfigVariableCore::VT_int64, description, flags), #else @@ -89,7 +89,7 @@ operator PN_int64 () const { // Access: Published // Description: Returns the number of unique words in the variable. //////////////////////////////////////////////////////////////////// -INLINE PN_int64 ConfigVariableInt64:: +INLINE size_t ConfigVariableInt64:: size() const { return get_num_words(); } @@ -100,7 +100,7 @@ size() const { // Description: Returns the value of the variable's nth word. //////////////////////////////////////////////////////////////////// INLINE PN_int64 ConfigVariableInt64:: -operator [] (int n) const { +operator [] (size_t n) const { return get_word(n); } @@ -150,7 +150,7 @@ get_default_value() const { // Description: Returns the variable's nth value. //////////////////////////////////////////////////////////////////// INLINE PN_int64 ConfigVariableInt64:: -get_word(int n) const { +get_word(size_t n) const { return get_int64_word(n); } @@ -161,7 +161,7 @@ get_word(int n) const { // local copy of the variable's overall value. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariableInt64:: -set_word(int n, PN_int64 value) { +set_word(size_t n, PN_int64 value) { set_int64_word(n, value); } diff --git a/dtool/src/prc/configVariableInt64.h b/dtool/src/prc/configVariableInt64.h index 07cb78e336..d108fb701a 100644 --- a/dtool/src/prc/configVariableInt64.h +++ b/dtool/src/prc/configVariableInt64.h @@ -28,24 +28,24 @@ class EXPCL_DTOOLCONFIG ConfigVariableInt64 : public ConfigVariable { PUBLISHED: INLINE ConfigVariableInt64(const string &name); INLINE ConfigVariableInt64(const string &name, PN_int64 default_value, - const string &description = string(), - PN_int64 flags = 0); + const string &description = string(), + int flags = 0); INLINE ConfigVariableInt64(const string &name, const string &default_value, - const string &description = string(), - PN_int64 flags = 0); + const string &description = string(), + int flags = 0); INLINE void operator = (PN_int64 value); INLINE operator PN_int64 () const; - INLINE PN_int64 size() const; - INLINE PN_int64 operator [] (int n) const; + INLINE size_t size() const; + INLINE PN_int64 operator [] (size_t n) const; INLINE void set_value(PN_int64 value); INLINE PN_int64 get_value() const; INLINE PN_int64 get_default_value() const; - INLINE PN_int64 get_word(int n) const; - INLINE void set_word(int n, PN_int64 value); + INLINE PN_int64 get_word(size_t n) const; + INLINE void set_word(size_t n, PN_int64 value); private: void set_default_value(PN_int64 default_value); diff --git a/dtool/src/prc/configVariableList.I b/dtool/src/prc/configVariableList.I index 740b846ead..0b89f3855d 100644 --- a/dtool/src/prc/configVariableList.I +++ b/dtool/src/prc/configVariableList.I @@ -50,7 +50,7 @@ ConfigVariableList(const string &name, // Access: Published // Description: Returns the number of values in the variable. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableList:: +INLINE size_t ConfigVariableList:: get_num_values() const { nassertr(_core != (ConfigVariableCore *)NULL, 0); return _core->get_num_trusted_references(); @@ -62,7 +62,7 @@ get_num_values() const { // Description: Returns the nth value of the variable. //////////////////////////////////////////////////////////////////// INLINE string ConfigVariableList:: -get_string_value(int n) const { +get_string_value(size_t n) const { nassertr(_core != (ConfigVariableCore *)NULL, string()); const ConfigDeclaration *decl = _core->get_trusted_reference(n); if (decl != (ConfigDeclaration *)NULL) { @@ -76,7 +76,7 @@ get_string_value(int n) const { // Access: Published // Description: Returns the number of unique values in the variable. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableList:: +INLINE size_t ConfigVariableList:: get_num_unique_values() const { nassertr(_core != (ConfigVariableCore *)NULL, 0); return _core->get_num_unique_references(); @@ -88,7 +88,7 @@ get_num_unique_values() const { // Description: Returns the nth unique value of the variable. //////////////////////////////////////////////////////////////////// INLINE string ConfigVariableList:: -get_unique_value(int n) const { +get_unique_value(size_t n) const { nassertr(_core != (ConfigVariableCore *)NULL, string()); const ConfigDeclaration *decl = _core->get_unique_reference(n); if (decl != (ConfigDeclaration *)NULL) { @@ -102,7 +102,7 @@ get_unique_value(int n) const { // Access: Published // Description: Returns the number of unique values of the variable. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableList:: +INLINE size_t ConfigVariableList:: size() const { return get_num_unique_values(); } @@ -116,7 +116,7 @@ size() const { // get_num_unique_values(). //////////////////////////////////////////////////////////////////// INLINE string ConfigVariableList:: -operator [] (int n) const { +operator [] (size_t n) const { return get_unique_value(n); } diff --git a/dtool/src/prc/configVariableList.cxx b/dtool/src/prc/configVariableList.cxx index 33503c98f6..bc0f10c1e5 100644 --- a/dtool/src/prc/configVariableList.cxx +++ b/dtool/src/prc/configVariableList.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// // Function: ConfigVariableList::output // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// void ConfigVariableList:: output(ostream &out) const { @@ -27,12 +27,12 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// // Function: ConfigVariableList::write // Access: Published -// Description: +// Description: //////////////////////////////////////////////////////////////////// void ConfigVariableList:: write(ostream &out) const { - int num_values = get_num_values(); - for (int i = 0; i < num_values; ++i) { + size_t num_values = get_num_values(); + for (size_t i = 0; i < num_values; ++i) { out << get_string_value(i) << "\n"; } } diff --git a/dtool/src/prc/configVariableList.h b/dtool/src/prc/configVariableList.h index 601e52664d..69a289b119 100644 --- a/dtool/src/prc/configVariableList.h +++ b/dtool/src/prc/configVariableList.h @@ -39,14 +39,14 @@ PUBLISHED: int flags = 0); INLINE ~ConfigVariableList(); - INLINE int get_num_values() const; - INLINE string get_string_value(int n) const; + INLINE size_t get_num_values() const; + INLINE string get_string_value(size_t n) const; - INLINE int get_num_unique_values() const; - INLINE string get_unique_value(int n) const; + INLINE size_t get_num_unique_values() const; + INLINE string get_unique_value(size_t n) const; - INLINE int size() const; - INLINE string operator [] (int n) const; + INLINE size_t size() const; + INLINE string operator [] (size_t n) const; void output(ostream &out) const; void write(ostream &out) const; diff --git a/dtool/src/prc/configVariableManager.I b/dtool/src/prc/configVariableManager.I index c18e63d84a..11a6184c20 100644 --- a/dtool/src/prc/configVariableManager.I +++ b/dtool/src/prc/configVariableManager.I @@ -19,7 +19,7 @@ // Description: Returns the current number of active ConfigVariableCores in // the world. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableManager:: +INLINE size_t ConfigVariableManager:: get_num_variables() const { return _variables.size(); } @@ -30,8 +30,8 @@ get_num_variables() const { // Description: Returns the nth active ConfigVariableCore in the world. //////////////////////////////////////////////////////////////////// INLINE ConfigVariableCore *ConfigVariableManager:: -get_variable(int n) const { - nassertr(n >= 0 && n < (int)_variables.size(), (ConfigVariableCore *)NULL); +get_variable(size_t n) const { + nassertr(n < _variables.size(), (ConfigVariableCore *)NULL); return _variables[n]; } diff --git a/dtool/src/prc/configVariableManager.cxx b/dtool/src/prc/configVariableManager.cxx index ae41496eaf..e884f12b5c 100644 --- a/dtool/src/prc/configVariableManager.cxx +++ b/dtool/src/prc/configVariableManager.cxx @@ -178,8 +178,8 @@ make_variable_template(const string &pattern, // the list. //////////////////////////////////////////////////////////////////// string ConfigVariableManager:: -get_variable_name(int n) const { - if (n >= 0 && n < (int)_variables.size()) { +get_variable_name(size_t n) const { + if (n < _variables.size()) { return _variables[n]->get_name(); } return string(); @@ -192,8 +192,8 @@ get_variable_name(int n) const { // the list has been used by code, false otherwise. //////////////////////////////////////////////////////////////////// bool ConfigVariableManager:: -is_variable_used(int n) const { - if (n >= 0 && n < (int)_variables.size()) { +is_variable_used(size_t n) const { + if (n < _variables.size()) { return _variables[n]->is_used(); } return false; @@ -251,22 +251,22 @@ write_prc_variables(ostream &out) const { if (variable->get_value_type() == ConfigVariableCore::VT_list || variable->get_value_type() == ConfigVariableCore::VT_search_path) { // List all of the values for a "list" variable. - int num_references = variable->get_num_trusted_references(); - for (int i = 0; i < num_references; i++) { - out << variable->get_name() << " " + size_t num_references = variable->get_num_trusted_references(); + for (size_t i = 0; i < num_references; ++i) { + out << variable->get_name() << " " << variable->get_trusted_reference(i)->get_string_value() << "\n"; } } else { // List just the one value for a non-list variable. - out << variable->get_name() << " " + out << variable->get_name() << " " << variable->get_trusted_reference(0)->get_string_value() << "\n"; } } } } - + //////////////////////////////////////////////////////////////////// // Function: ConfigVariableManager::list_unused_variables // Access: Published @@ -283,8 +283,8 @@ list_unused_variables() const { ConfigVariableCore *variable = (*ni).second; if (!variable->is_used()) { nout << variable->get_name() << "\n"; - int num_references = variable->get_num_references(); - for (int i = 0; i < num_references; i++) { + size_t num_references = variable->get_num_references(); + for (size_t i = 0; i < num_references; i++) { nout << " " << variable->get_reference(i)->get_page()->get_name() << "\n"; } @@ -380,13 +380,13 @@ list_variable(const ConfigVariableCore *variable, // We treat a "list" variable as a special case: list all of // its values. nout << " current value:\n"; - int num_references = variable->get_num_trusted_references(); - for (int i = 0; i < num_references; i++) { + size_t num_references = variable->get_num_trusted_references(); + for (size_t i = 0; i < num_references; ++i) { decl = variable->get_trusted_reference(i); nout << " " << decl->get_string_value() << " (from " << decl->get_page()->get_name() << ")\n"; } - + } else { // An ordinary, non-list variable gets one line for its // current value (if it has one) and another line for its diff --git a/dtool/src/prc/configVariableManager.h b/dtool/src/prc/configVariableManager.h index 9ac9c18250..69e039d42e 100644 --- a/dtool/src/prc/configVariableManager.h +++ b/dtool/src/prc/configVariableManager.h @@ -45,11 +45,11 @@ PUBLISHED: int flags = 0); - INLINE int get_num_variables() const; - INLINE ConfigVariableCore *get_variable(int n) const; + INLINE size_t get_num_variables() const; + INLINE ConfigVariableCore *get_variable(size_t n) const; MAKE_SEQ(get_variables, get_num_variables, get_variable); - string get_variable_name(int n) const; - bool is_variable_used(int n) const; + string get_variable_name(size_t n) const; + bool is_variable_used(size_t n) const; void output(ostream &out) const; void write(ostream &out) const; diff --git a/dtool/src/prc/configVariableSearchPath.I b/dtool/src/prc/configVariableSearchPath.I index 395e23a9f9..75c9f5edf1 100644 --- a/dtool/src/prc/configVariableSearchPath.I +++ b/dtool/src/prc/configVariableSearchPath.I @@ -240,7 +240,7 @@ is_empty() const { // Access: Published // Description: Returns the number of directories on the search list. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableSearchPath:: +INLINE size_t ConfigVariableSearchPath:: get_num_directories() const { return get_value().get_num_directories(); } @@ -251,7 +251,7 @@ get_num_directories() const { // Description: Returns the nth directory on the search list. //////////////////////////////////////////////////////////////////// INLINE const Filename &ConfigVariableSearchPath:: -get_directory(int n) const { +get_directory(size_t n) const { return get_value().get_directory(n); } @@ -280,7 +280,7 @@ find_file(const Filename &filename) const { // the results list first; otherwise, the newly-found // files will be appended to the list. //////////////////////////////////////////////////////////////////// -INLINE int ConfigVariableSearchPath:: +INLINE size_t ConfigVariableSearchPath:: find_all_files(const Filename &filename, DSearchPath::Results &results) const { return get_value().find_all_files(filename, results); diff --git a/dtool/src/prc/configVariableSearchPath.cxx b/dtool/src/prc/configVariableSearchPath.cxx index 85d8a732a4..0b379ec1ea 100644 --- a/dtool/src/prc/configVariableSearchPath.cxx +++ b/dtool/src/prc/configVariableSearchPath.cxx @@ -28,8 +28,8 @@ reload_search_path() { _cache.clear(); _cache.append_path(_prefix); - int num_unique_references = _core->get_num_unique_references(); - for (int i = 0; i < num_unique_references; i++) { + size_t num_unique_references = _core->get_num_unique_references(); + for (size_t i = 0; i < num_unique_references; i++) { const ConfigDeclaration *decl = _core->get_unique_reference(i); const ConfigPage *page = decl->get_page(); diff --git a/dtool/src/prc/configVariableSearchPath.h b/dtool/src/prc/configVariableSearchPath.h index 8dca25ad7d..ee32dab573 100644 --- a/dtool/src/prc/configVariableSearchPath.h +++ b/dtool/src/prc/configVariableSearchPath.h @@ -69,13 +69,13 @@ PUBLISHED: INLINE void prepend_path(const DSearchPath &path); INLINE bool is_empty() const; - INLINE int get_num_directories() const; - INLINE const Filename &get_directory(int n) const; + INLINE size_t get_num_directories() const; + INLINE const Filename &get_directory(size_t n) const; MAKE_SEQ(get_directories, get_num_directories, get_directory); INLINE Filename find_file(const Filename &filename) const; - INLINE int find_all_files(const Filename &filename, - DSearchPath::Results &results) const; + INLINE size_t find_all_files(const Filename &filename, + DSearchPath::Results &results) const; INLINE DSearchPath::Results find_all_files(const Filename &filename) const; INLINE void output(ostream &out) const; diff --git a/dtool/src/prc/configVariableString.I b/dtool/src/prc/configVariableString.I index 580ad91fd3..65152bcc78 100644 --- a/dtool/src/prc/configVariableString.I +++ b/dtool/src/prc/configVariableString.I @@ -101,8 +101,8 @@ length() const { // Description: //////////////////////////////////////////////////////////////////// INLINE char ConfigVariableString:: -operator [] (int n) const { - assert(n >= 0 && n < (int)length()); +operator [] (size_t n) const { + assert(n < length()); return get_value()[n]; } @@ -181,7 +181,7 @@ get_default_value() const { // Description: Returns the variable's nth value. //////////////////////////////////////////////////////////////////// INLINE string ConfigVariableString:: -get_word(int n) const { +get_word(size_t n) const { return get_string_word(n); } @@ -192,6 +192,6 @@ get_word(int n) const { // local copy of the variable's overall value. //////////////////////////////////////////////////////////////////// INLINE void ConfigVariableString:: -set_word(int n, const string &value) { +set_word(size_t n, const string &value) { set_string_word(n, value); } diff --git a/dtool/src/prc/configVariableString.h b/dtool/src/prc/configVariableString.h index 0685af8a67..ae313f2933 100644 --- a/dtool/src/prc/configVariableString.h +++ b/dtool/src/prc/configVariableString.h @@ -37,7 +37,7 @@ PUBLISHED: INLINE const char *c_str() const; INLINE bool empty() const; INLINE size_t length() const; - INLINE char operator [] (int n) const; + INLINE char operator [] (size_t n) const; // Comparison operators are handy. INLINE bool operator == (const string &other) const; @@ -48,8 +48,8 @@ PUBLISHED: INLINE const string &get_value() const; INLINE string get_default_value() const; - INLINE string get_word(int n) const; - INLINE void set_word(int n, const string &value); + INLINE string get_word(size_t n) const; + INLINE void set_word(size_t n, const string &value); private: AtomicAdjust::Integer _local_modified; diff --git a/dtool/src/prc/encryptStreamBuf.cxx b/dtool/src/prc/encryptStreamBuf.cxx index 5af88e6c04..1dcac25349 100644 --- a/dtool/src/prc/encryptStreamBuf.cxx +++ b/dtool/src/prc/encryptStreamBuf.cxx @@ -289,11 +289,11 @@ open_write(ostream *dest, bool owns_dest, const string &password) { // Now write the header information to the stream. StreamWriter sw(_dest, false); nassertv((PN_uint16)nid == nid); - sw.add_uint16(nid); + sw.add_uint16((PN_uint16)nid); nassertv((PN_uint16)key_length == key_length); - sw.add_uint16(key_length); + sw.add_uint16((PN_uint16)key_length); nassertv((PN_uint16)count == count); - sw.add_uint16(count); + sw.add_uint16((PN_uint16)count); sw.append_data(iv, iv_length); _write_valid = true; @@ -347,7 +347,7 @@ overflow(int ch) { if (ch != EOF) { // Write one more character. - char c = ch; + char c = (char)ch; write_chars(&c, 1); } @@ -364,7 +364,7 @@ int EncryptStreamBuf:: sync() { if (_source != (istream *)NULL) { size_t n = egptr() - gptr(); - gbump(n); + gbump((int)n); } if (_dest != (ostream *)NULL) { @@ -396,7 +396,7 @@ underflow() { if (read_count != num_bytes) { // Oops, we didn't read what we thought we would. if (read_count == 0) { - gbump(num_bytes); + gbump((int)num_bytes); return EOF; } @@ -404,7 +404,7 @@ underflow() { nassertr(read_count < num_bytes, EOF); size_t delta = num_bytes - read_count; memmove(gptr() + delta, gptr(), read_count); - gbump(delta); + gbump((int)delta); } } diff --git a/dtool/src/prc/notify.cxx b/dtool/src/prc/notify.cxx index ebfd19ac42..9d100e5f54 100644 --- a/dtool/src/prc/notify.cxx +++ b/dtool/src/prc/notify.cxx @@ -447,7 +447,7 @@ string_severity(const string &str) { for (string::const_iterator si = str.begin(); si != str.end(); ++si) { - lstring += tolower(*si); + lstring += (char)tolower(*si); } if (lstring == "spam") { diff --git a/dtool/src/prc/notifyCategory.cxx b/dtool/src/prc/notifyCategory.cxx index 6998af4270..5d26421ec0 100644 --- a/dtool/src/prc/notifyCategory.cxx +++ b/dtool/src/prc/notifyCategory.cxx @@ -125,7 +125,7 @@ out(NotifySeverity severity, bool prefix) const { // Description: Returns the number of child Categories of this // particular Category. //////////////////////////////////////////////////////////////////// -int NotifyCategory:: +size_t NotifyCategory:: get_num_children() const { return _children.size(); } @@ -137,8 +137,8 @@ get_num_children() const { // Category. //////////////////////////////////////////////////////////////////// NotifyCategory *NotifyCategory:: -get_child(int i) const { - assert(i >= 0 && i < (int)_children.size()); +get_child(size_t i) const { + assert(i < _children.size()); return _children[i]; } diff --git a/dtool/src/prc/notifyCategory.h b/dtool/src/prc/notifyCategory.h index 30539ec3b8..ad1152546f 100644 --- a/dtool/src/prc/notifyCategory.h +++ b/dtool/src/prc/notifyCategory.h @@ -72,8 +72,9 @@ PUBLISHED: INLINE ostream &error(bool prefix = true) const; INLINE ostream &fatal(bool prefix = true) const; - int get_num_children() const; - NotifyCategory *get_child(int i) const; + size_t get_num_children() const; + NotifyCategory *get_child(size_t i) const; + MAKE_SEQ(get_children, get_num_children, get_child); static void set_server_delta(long delta); diff --git a/dtool/src/prc/prcKeyRegistry.cxx b/dtool/src/prc/prcKeyRegistry.cxx index 9e410a326c..70e18a5735 100644 --- a/dtool/src/prc/prcKeyRegistry.cxx +++ b/dtool/src/prc/prcKeyRegistry.cxx @@ -59,12 +59,12 @@ PrcKeyRegistry:: // code generated by the make-prc-key utility. //////////////////////////////////////////////////////////////////// void PrcKeyRegistry:: -record_keys(const KeyDef *key_def, int num_keys) { - for (int i = 0; i < num_keys; i++) { +record_keys(const KeyDef *key_def, size_t num_keys) { + for (size_t i = 0; i < num_keys; i++) { const KeyDef *def = &key_def[i]; if (def->_data != (char *)NULL) { // Clear the ith key. - while ((int)_keys.size() <= i) { + while (_keys.size() <= i) { Key key; key._def = NULL; key._pkey = NULL; @@ -93,9 +93,9 @@ record_keys(const KeyDef *key_def, int num_keys) { // be freed via EVP_PKEY_free(). //////////////////////////////////////////////////////////////////// void PrcKeyRegistry:: -set_key(int n, EVP_PKEY *pkey, time_t generated_time) { +set_key(size_t n, EVP_PKEY *pkey, time_t generated_time) { // Clear the nth key. - while ((int)_keys.size() <= n) { + while (_keys.size() <= n) { Key key; key._def = NULL; key._pkey = NULL; @@ -119,7 +119,7 @@ set_key(int n, EVP_PKEY *pkey, time_t generated_time) { // might not strictly be the number of keys, since there // may be holes in the list. //////////////////////////////////////////////////////////////////// -int PrcKeyRegistry:: +size_t PrcKeyRegistry:: get_num_keys() const { return _keys.size(); } @@ -131,8 +131,8 @@ get_num_keys() const { // not defined. //////////////////////////////////////////////////////////////////// EVP_PKEY *PrcKeyRegistry:: -get_key(int n) const { - nassertr(n >= 0 && n < (int)_keys.size(), (EVP_PKEY *)NULL); +get_key(size_t n) const { + nassertr(n < _keys.size(), (EVP_PKEY *)NULL); if (_keys[n]._def != (KeyDef *)NULL) { if (_keys[n]._pkey == (EVP_PKEY *)NULL) { @@ -160,8 +160,8 @@ get_key(int n) const { // generated, or 0 if the key is not defined. //////////////////////////////////////////////////////////////////// time_t PrcKeyRegistry:: -get_generated_time(int n) const { - nassertr(n >= 0 && n < (int)_keys.size(), 0); +get_generated_time(size_t n) const { + nassertr(n < _keys.size(), 0); return _keys[n]._generated_time; } @@ -169,7 +169,7 @@ get_generated_time(int n) const { //////////////////////////////////////////////////////////////////// // Function: PrcKeyRegistry::get_global_ptr // Access: Public, Static -// Description: +// Description: //////////////////////////////////////////////////////////////////// PrcKeyRegistry *PrcKeyRegistry:: get_global_ptr() { diff --git a/dtool/src/prc/prcKeyRegistry.h b/dtool/src/prc/prcKeyRegistry.h index 9a7fa2cde8..ebffc10171 100644 --- a/dtool/src/prc/prcKeyRegistry.h +++ b/dtool/src/prc/prcKeyRegistry.h @@ -52,12 +52,12 @@ public: time_t _generated_time; }; - void record_keys(const KeyDef *key_def, int num_keys); - void set_key(int n, EVP_PKEY *pkey, time_t generated_time); + void record_keys(const KeyDef *key_def, size_t num_keys); + void set_key(size_t n, EVP_PKEY *pkey, time_t generated_time); - int get_num_keys() const; - EVP_PKEY *get_key(int n) const; - time_t get_generated_time(int n) const; + size_t get_num_keys() const; + EVP_PKEY *get_key(size_t n) const; + time_t get_generated_time(size_t n) const; static PrcKeyRegistry *get_global_ptr(); @@ -81,8 +81,3 @@ private: #endif // HAVE_OPENSSL #endif - - - - - diff --git a/dtool/src/prc/streamReader.cxx b/dtool/src/prc/streamReader.cxx index c469309b53..77ac276dc1 100644 --- a/dtool/src/prc/streamReader.cxx +++ b/dtool/src/prc/streamReader.cxx @@ -68,7 +68,7 @@ get_z_string() { string result; int ch = _in->get(); while (!_in->eof() && !_in->fail() && ch != '\0') { - result += ch; + result += (char)ch; ch = _in->get(); } @@ -167,7 +167,7 @@ readline() { string line; int ch = _in->get(); while (!_in->eof() && !_in->fail()) { - line += ch; + line += (char)ch; if (ch == '\n') { // Here's the newline character. return line; diff --git a/dtool/src/prc/streamWriter.I b/dtool/src/prc/streamWriter.I index 4c388c387f..b297245c30 100644 --- a/dtool/src/prc/streamWriter.I +++ b/dtool/src/prc/streamWriter.I @@ -335,7 +335,7 @@ add_string(const string &str) { nassertv(str.length() <= (PN_uint16)0xffff); // Strings always are preceded by their length - add_uint16(str.length()); + add_uint16((PN_uint16)str.length()); // Add the string append_data(str); @@ -350,7 +350,7 @@ add_string(const string &str) { INLINE void StreamWriter:: add_string32(const string &str) { // Strings always are preceded by their length - add_uint32(str.length()); + add_uint32((PN_uint32)str.length()); // Add the string append_data(str); diff --git a/dtool/src/prckeys/makePrcKey.cxx b/dtool/src/prckeys/makePrcKey.cxx index 17a95286fb..f61fa7a830 100644 --- a/dtool/src/prckeys/makePrcKey.cxx +++ b/dtool/src/prckeys/makePrcKey.cxx @@ -74,7 +74,7 @@ output_ssl_errors() { //////////////////////////////////////////////////////////////////// void output_c_string(ostream &out, const string &string_name, - int index, BIO *mbio) { + size_t index, BIO *mbio) { char *data_ptr; size_t data_size = BIO_get_mem_data(mbio, &data_ptr); @@ -151,13 +151,13 @@ write_public_keys(Filename outfile) { "\n" "#include \"prcKeyRegistry.h\"\n" "\n"; - + PrcKeyRegistry *pkr = PrcKeyRegistry::get_global_ptr(); BIO *mbio = BIO_new(BIO_s_mem()); - int num_keys = pkr->get_num_keys(); - int i; + size_t num_keys = pkr->get_num_keys(); + size_t i; for (i = 0; i < num_keys; i++) { EVP_PKEY *pkey = pkr->get_key(i); @@ -403,7 +403,7 @@ main(int argc, char **argv) { for (int i = 1; i < argc; i++) { KeyNumber key; char *endptr; - key._number = strtol(argv[i], &endptr, 0); + key._number = (int)strtol(argv[i], &endptr, 0); key._got_pass_phrase = got_pass_phrase; key._pass_phrase = pass_phrase; diff --git a/panda/src/display/windowProperties.h b/panda/src/display/windowProperties.h index dc0fcac84f..28968e458e 100644 --- a/panda/src/display/windowProperties.h +++ b/panda/src/display/windowProperties.h @@ -197,7 +197,7 @@ private: Filename _cursor_filename; Filename _icon_filename; ZOrder _z_order; - unsigned int _flags; + int _flags; PT(WindowHandle) _parent_window; static WindowProperties *_default_properties; diff --git a/panda/src/express/datagram.cxx b/panda/src/express/datagram.cxx index 7a1d9dadb4..677d91fe75 100644 --- a/panda/src/express/datagram.cxx +++ b/panda/src/express/datagram.cxx @@ -91,13 +91,13 @@ dump_hex(ostream &out, unsigned int indent) const { void Datagram:: add_wstring(const wstring &str) { // By convention, wstrings are marked with 32-bit lengths. - add_uint32(str.length()); + add_uint32((PN_uint32)str.length()); // Now append each character in the string. We store each code // little-endian, for no real good reason. wstring::const_iterator ci; for (ci = str.begin(); ci != str.end(); ++ci) { - add_uint16(*ci); + add_uint16((PN_uint16)*ci); } } diff --git a/panda/src/express/datagramIterator.I b/panda/src/express/datagramIterator.I index b3bd9ca1f9..899ea2aaf0 100644 --- a/panda/src/express/datagramIterator.I +++ b/panda/src/express/datagramIterator.I @@ -513,7 +513,7 @@ get_remaining_bytes() const { nassertr(_current_index <= _datagram->get_length(), ""); const char *ptr = (const char *)_datagram->get_data(); - int remaining_size = _datagram->get_length() - _current_index; + size_t remaining_size = _datagram->get_length() - _current_index; return string(ptr + _current_index, remaining_size); } @@ -522,7 +522,7 @@ get_remaining_bytes() const { // Access: Public // Description: Return the bytes left in the datagram. //////////////////////////////////////////////////////////////////// -INLINE int DatagramIterator:: +INLINE size_t DatagramIterator:: get_remaining_size() const { return _datagram->get_length() - _current_index; } diff --git a/panda/src/express/datagramIterator.cxx b/panda/src/express/datagramIterator.cxx index c679536931..b02f2a19dd 100644 --- a/panda/src/express/datagramIterator.cxx +++ b/panda/src/express/datagramIterator.cxx @@ -31,7 +31,7 @@ get_string() { nassertr(_current_index + s_len <= _datagram->get_length(), ""); const char *ptr = (const char *)_datagram->get_data(); - int last_index = _current_index; + size_t last_index = _current_index; _current_index += s_len; @@ -53,7 +53,7 @@ get_string32() { nassertr(_current_index + s_len <= _datagram->get_length(), ""); const char *ptr = (const char *)_datagram->get_data(); - int last_index = _current_index; + size_t last_index = _current_index; _current_index += s_len; @@ -79,7 +79,7 @@ get_z_string() { } nassertr(p < length, ""); // no NULL character? - int last_index = _current_index; + size_t last_index = _current_index; _current_index = p + 1; return string(ptr + last_index, p - last_index); @@ -143,7 +143,7 @@ extract_bytes(size_t size) { nassertr(_current_index + size <= _datagram->get_length(), ""); const char *ptr = (const char *)_datagram->get_data(); - int last_index = _current_index; + size_t last_index = _current_index; _current_index += size; diff --git a/panda/src/express/datagramIterator.h b/panda/src/express/datagramIterator.h index c30a402453..cc6568eed9 100644 --- a/panda/src/express/datagramIterator.h +++ b/panda/src/express/datagramIterator.h @@ -72,7 +72,7 @@ PUBLISHED: size_t extract_bytes(unsigned char *into, size_t size); INLINE string get_remaining_bytes() const; - INLINE int get_remaining_size() const; + INLINE size_t get_remaining_size() const; INLINE const Datagram &get_datagram() const; INLINE size_t get_current_index() const; diff --git a/panda/src/express/hashVal.cxx b/panda/src/express/hashVal.cxx index 1560decd75..a1f886ad32 100644 --- a/panda/src/express/hashVal.cxx +++ b/panda/src/express/hashVal.cxx @@ -51,7 +51,7 @@ input_hex(istream &in) { while (!in.eof() && !in.fail() && isxdigit(ch)) { if (i < 32) { - buffer[i] = ch; + buffer[i] = (char)ch; } i++; ch = in.get(); @@ -63,7 +63,7 @@ input_hex(istream &in) { } if (!in.eof()) { - in.putback(ch); + in.putback((char)ch); } else { in.clear(); } diff --git a/panda/src/express/memoryUsagePointers.cxx b/panda/src/express/memoryUsagePointers.cxx index 4a590f3661..2eb78a1d50 100644 --- a/panda/src/express/memoryUsagePointers.cxx +++ b/panda/src/express/memoryUsagePointers.cxx @@ -43,7 +43,7 @@ MemoryUsagePointers:: // Access: Published // Description: Returns the number of pointers in the set. //////////////////////////////////////////////////////////////////// -int MemoryUsagePointers:: +size_t MemoryUsagePointers:: get_num_pointers() const { return _entries.size(); } @@ -54,8 +54,8 @@ get_num_pointers() const { // Description: Returns the nth pointer of the set. //////////////////////////////////////////////////////////////////// ReferenceCount *MemoryUsagePointers:: -get_pointer(int n) const { - nassertr(n >= 0 && n < get_num_pointers(), NULL); +get_pointer(size_t n) const { + nassertr(n < get_num_pointers(), NULL); return _entries[n]._ref_ptr; } @@ -68,8 +68,8 @@ get_pointer(int n) const { // NULL. //////////////////////////////////////////////////////////////////// TypedObject *MemoryUsagePointers:: -get_typed_pointer(int n) const { - nassertr(n >= 0 && n < get_num_pointers(), NULL); +get_typed_pointer(size_t n) const { + nassertr(n < get_num_pointers(), NULL); TypedObject *typed_ptr = _entries[n]._typed_ptr; if (typed_ptr != (TypedObject *)NULL) { @@ -106,8 +106,8 @@ get_typed_pointer(int n) const { // known. //////////////////////////////////////////////////////////////////// TypeHandle MemoryUsagePointers:: -get_type(int n) const { - nassertr(n >= 0 && n < get_num_pointers(), TypeHandle::none()); +get_type(size_t n) const { + nassertr(n < get_num_pointers(), TypeHandle::none()); return _entries[n]._type; } @@ -118,8 +118,8 @@ get_type(int n) const { // known. //////////////////////////////////////////////////////////////////// string MemoryUsagePointers:: -get_type_name(int n) const { - nassertr(n >= 0 && n < get_num_pointers(), ""); +get_type_name(size_t n) const { + nassertr(n < get_num_pointers(), ""); return get_type(n).get_name(); } @@ -132,8 +132,8 @@ get_type_name(int n) const { // MemoryUsage::get_pointers(). //////////////////////////////////////////////////////////////////// double MemoryUsagePointers:: -get_age(int n) const { - nassertr(n >= 0 && n < get_num_pointers(), 0.0); +get_age(size_t n) const { + nassertr(n < get_num_pointers(), 0.0); return _entries[n]._age; } diff --git a/panda/src/express/memoryUsagePointers.h b/panda/src/express/memoryUsagePointers.h index 2512ea9f00..532e59be6a 100644 --- a/panda/src/express/memoryUsagePointers.h +++ b/panda/src/express/memoryUsagePointers.h @@ -50,17 +50,17 @@ PUBLISHED: MemoryUsagePointers(); ~MemoryUsagePointers(); - int get_num_pointers() const; - ReferenceCount *get_pointer(int n) const; + size_t get_num_pointers() const; + ReferenceCount *get_pointer(size_t n) const; MAKE_SEQ(get_pointers, get_num_pointers, get_pointer); - TypedObject *get_typed_pointer(int n) const; + TypedObject *get_typed_pointer(size_t n) const; MAKE_SEQ(get_typed_pointers, get_num_pointers, get_typed_pointer); - TypeHandle get_type(int n) const; - string get_type_name(int n) const; - double get_age(int n) const; + TypeHandle get_type(size_t n) const; + string get_type_name(size_t n) const; + double get_age(size_t n) const; - EXTENSION(PyObject *get_python_pointer(int n) const); + EXTENSION(PyObject *get_python_pointer(size_t n) const); void clear(); diff --git a/panda/src/express/memoryUsagePointers_ext.cxx b/panda/src/express/memoryUsagePointers_ext.cxx index 63713cc907..73732e274b 100644 --- a/panda/src/express/memoryUsagePointers_ext.cxx +++ b/panda/src/express/memoryUsagePointers_ext.cxx @@ -36,7 +36,7 @@ extern Dtool_PyTypedObject Dtool_ReferenceCount; // type is known, which has a Python representation. //////////////////////////////////////////////////////////////////// PyObject *Extension:: -get_python_pointer(int n) const { +get_python_pointer(size_t n) const { TypedObject *typed_ptr = _this->get_typed_pointer(n); ReferenceCount *ref_ptr = _this->get_pointer(n); diff --git a/panda/src/express/memoryUsagePointers_ext.h b/panda/src/express/memoryUsagePointers_ext.h index 3b4e9c7478..edc0e1651b 100644 --- a/panda/src/express/memoryUsagePointers_ext.h +++ b/panda/src/express/memoryUsagePointers_ext.h @@ -32,7 +32,7 @@ template<> class Extension : public ExtensionBase { public: - PyObject *get_python_pointer(int n) const; + PyObject *get_python_pointer(size_t n) const; }; #endif // HAVE_PYTHON && DO_MEMORY_USAGE diff --git a/panda/src/express/multifile.cxx b/panda/src/express/multifile.cxx index b693e8e5c6..519ba336ee 100644 --- a/panda/src/express/multifile.cxx +++ b/panda/src/express/multifile.cxx @@ -969,7 +969,7 @@ add_signature(const Multifile::CertChain &cert_chain, EVP_PKEY *pkey) { // Now encode that list of certs to a stream in DER form. stringstream der_stream; StreamWriter der_writer(der_stream); - der_writer.add_uint32(cert_chain.size()); + der_writer.add_uint32((PN_uint32)cert_chain.size()); CertChain::const_iterator ci; for (ci = cert_chain.begin(); ci != cert_chain.end(); ++ci) { diff --git a/panda/src/express/nodeReferenceCount.I b/panda/src/express/nodeReferenceCount.I index 1cd5e6bb64..3b13f58eb6 100644 --- a/panda/src/express/nodeReferenceCount.I +++ b/panda/src/express/nodeReferenceCount.I @@ -137,7 +137,7 @@ get_node_ref_count() const { #ifdef _DEBUG test_ref_count_integrity(); #endif - return AtomicAdjust::get(_node_ref_count); + return (int)AtomicAdjust::get(_node_ref_count); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/express/referenceCount.I b/panda/src/express/referenceCount.I index 9f098b0384..d1dac553c7 100644 --- a/panda/src/express/referenceCount.I +++ b/panda/src/express/referenceCount.I @@ -156,7 +156,7 @@ get_ref_count() const { #ifdef _DEBUG test_ref_count_integrity(); #endif - return AtomicAdjust::get(_ref_count); + return (int)AtomicAdjust::get(_ref_count); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/express/virtualFileList.I b/panda/src/express/virtualFileList.I index f66e4fa01d..461cc9e433 100644 --- a/panda/src/express/virtualFileList.I +++ b/panda/src/express/virtualFileList.I @@ -46,7 +46,7 @@ add_file(VirtualFile *file) { // Access: Published // Description: Returns the number of files in the list. //////////////////////////////////////////////////////////////////// -INLINE int VirtualFileList:: +INLINE size_t VirtualFileList:: get_num_files() const { return _files.size(); } @@ -57,8 +57,8 @@ get_num_files() const { // Description: Returns the nth file in the list. //////////////////////////////////////////////////////////////////// INLINE VirtualFile *VirtualFileList:: -get_file(int n) const { - nassertr(n >= 0 && n < (int)_files.size(), NULL); +get_file(size_t n) const { + nassertr(n < _files.size(), NULL); return _files[n]; } @@ -68,8 +68,8 @@ get_file(int n) const { // Description: Returns the nth file in the list. //////////////////////////////////////////////////////////////////// INLINE VirtualFile *VirtualFileList:: -operator [](int n) const { - nassertr(n >= 0 && n < (int)_files.size(), NULL); +operator [](size_t n) const { + nassertr(n < _files.size(), NULL); return _files[n]; } @@ -78,7 +78,7 @@ operator [](int n) const { // Access: Published // Description: Returns the number of files in the list. //////////////////////////////////////////////////////////////////// -INLINE int VirtualFileList:: +INLINE size_t VirtualFileList:: size() const { return _files.size(); } diff --git a/panda/src/express/virtualFileList.h b/panda/src/express/virtualFileList.h index d81ee7838d..12481c60cc 100644 --- a/panda/src/express/virtualFileList.h +++ b/panda/src/express/virtualFileList.h @@ -36,12 +36,12 @@ public: INLINE void add_file(VirtualFile *file); PUBLISHED: - INLINE int get_num_files() const; - INLINE VirtualFile *get_file(int n) const; + INLINE size_t get_num_files() const; + INLINE VirtualFile *get_file(size_t n) const; MAKE_SEQ(get_files, get_num_files, get_file); - INLINE VirtualFile *operator [](int n) const; - INLINE int size() const; + INLINE VirtualFile *operator [](size_t n) const; + INLINE size_t size() const; INLINE void operator += (const VirtualFileList &other); INLINE VirtualFileList operator + (const VirtualFileList &other) const; diff --git a/panda/src/gobj/adaptiveLru.h b/panda/src/gobj/adaptiveLru.h index eab6df8a1a..c5a81f4a23 100644 --- a/panda/src/gobj/adaptiveLru.h +++ b/panda/src/gobj/adaptiveLru.h @@ -105,7 +105,7 @@ private: size_t _max_size; unsigned int _current_frame_identifier; - double _weight; + PN_stdfloat _weight; int _max_updates_per_frame; // This array of linked lists keeps all of the active pages, grouped diff --git a/panda/src/gobj/geomPrimitive.cxx b/panda/src/gobj/geomPrimitive.cxx index 797ea9e1c8..02abb0c407 100644 --- a/panda/src/gobj/geomPrimitive.cxx +++ b/panda/src/gobj/geomPrimitive.cxx @@ -1304,7 +1304,7 @@ set_vertices(const GeomVertexArrayData *vertices, int num_vertices) { // Validate the format and make sure to copy its numeric type. const GeomVertexArrayFormat *format = vertices->get_array_format(); nassertv(format->get_num_columns() == 1); - cdata->_index_type = format->get_column(0)->get_numeric_type(); + cdata->_index_type = format->get_column((size_t)0)->get_numeric_type(); cdata->_modified = Geom::get_next_modified(); cdata->_got_minmax = false; diff --git a/panda/src/gobj/geomVertexArrayData.I b/panda/src/gobj/geomVertexArrayData.I index c8be2ffdb7..6091f465b7 100644 --- a/panda/src/gobj/geomVertexArrayData.I +++ b/panda/src/gobj/geomVertexArrayData.I @@ -137,7 +137,7 @@ clear_rows() { // Access: Published // Description: Returns the number of bytes stored in the array. //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexArrayData:: +INLINE size_t GeomVertexArrayData:: get_data_size_bytes() const { CDReader cdata(_cycler); return cdata->_buffer.get_size(); @@ -464,7 +464,7 @@ clear_rows() { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexArrayDataHandle:: +INLINE size_t GeomVertexArrayDataHandle:: get_data_size_bytes() const { return _cdata->_buffer.get_size(); } diff --git a/panda/src/gobj/geomVertexArrayData.h b/panda/src/gobj/geomVertexArrayData.h index 58ffbb6b46..740b512044 100644 --- a/panda/src/gobj/geomVertexArrayData.h +++ b/panda/src/gobj/geomVertexArrayData.h @@ -90,7 +90,7 @@ PUBLISHED: INLINE bool reserve_num_rows(int n); INLINE void clear_rows(); - INLINE int get_data_size_bytes() const; + INLINE size_t get_data_size_bytes() const; INLINE UpdateSeq get_modified() const; void output(ostream &out) const; @@ -284,7 +284,7 @@ PUBLISHED: bool reserve_num_rows(int n); INLINE void clear_rows(); - INLINE int get_data_size_bytes() const; + INLINE size_t get_data_size_bytes() const; INLINE UpdateSeq get_modified() const; INLINE bool request_resident() const; diff --git a/panda/src/gobj/geomVertexArrayFormat.I b/panda/src/gobj/geomVertexArrayFormat.I index f813084c96..2ded24872c 100644 --- a/panda/src/gobj/geomVertexArrayFormat.I +++ b/panda/src/gobj/geomVertexArrayFormat.I @@ -151,9 +151,9 @@ get_total_bytes() const { // Description: Returns the number of different columns in the // array. //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexArrayFormat:: +INLINE size_t GeomVertexArrayFormat:: get_num_columns() const { - return (int)_columns.size(); + return _columns.size(); } //////////////////////////////////////////////////////////////////// @@ -162,8 +162,8 @@ get_num_columns() const { // Description: Returns the ith column of the array. //////////////////////////////////////////////////////////////////// INLINE const GeomVertexColumn *GeomVertexArrayFormat:: -get_column(int i) const { - nassertr(i >= 0 && i < (int)_columns.size(), NULL); +get_column(size_t i) const { + nassertr(i < _columns.size(), NULL); consider_sort_columns(); return _columns[i]; } diff --git a/panda/src/gobj/geomVertexArrayFormat.h b/panda/src/gobj/geomVertexArrayFormat.h index 9e150d596b..f764b3c3c8 100644 --- a/panda/src/gobj/geomVertexArrayFormat.h +++ b/panda/src/gobj/geomVertexArrayFormat.h @@ -102,8 +102,8 @@ PUBLISHED: void pack_columns(); void align_columns_for_animation(); - INLINE int get_num_columns() const; - INLINE const GeomVertexColumn *get_column(int i) const; + INLINE size_t get_num_columns() const; + INLINE const GeomVertexColumn *get_column(size_t i) const; MAKE_SEQ(get_columns, get_num_columns, get_column); const GeomVertexColumn *get_column(const InternalName *name) const; diff --git a/panda/src/gobj/geomVertexData.cxx b/panda/src/gobj/geomVertexData.cxx index d2202e1831..80aa43dbf4 100644 --- a/panda/src/gobj/geomVertexData.cxx +++ b/panda/src/gobj/geomVertexData.cxx @@ -1675,7 +1675,7 @@ update_animated_vertices(GeomVertexData::CData *cdata, Thread *current_thread) { CPT(GeomVertexArrayFormat) blend_array_format = orig_format->get_array(blend_array_index); if (blend_array_format->get_stride() == 2 && - blend_array_format->get_column(0)->get_component_bytes() == 2) { + blend_array_format->get_column((size_t)0)->get_component_bytes() == 2) { // The blend indices are a table of ushorts. Optimize this // common case. CPT(GeomVertexArrayDataHandle) blend_array_handle = cdata->_arrays[blend_array_index].get_read_pointer()->get_handle(current_thread); diff --git a/panda/src/gobj/geomVertexFormat.I b/panda/src/gobj/geomVertexFormat.I index 0026fae224..974d83022c 100644 --- a/panda/src/gobj/geomVertexFormat.I +++ b/panda/src/gobj/geomVertexFormat.I @@ -100,7 +100,7 @@ set_animation(const GeomVertexAnimationSpec &animation) { // parallel, this will be the same as the number of data // types. //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexFormat:: +INLINE size_t GeomVertexFormat:: get_num_arrays() const { return _arrays.size(); } @@ -112,8 +112,8 @@ get_num_arrays() const { // format. //////////////////////////////////////////////////////////////////// INLINE const GeomVertexArrayFormat *GeomVertexFormat:: -get_array(int array) const { - nassertr(array >= 0 && array < (int)_arrays.size(), NULL); +get_array(size_t array) const { + nassertr(array < _arrays.size(), NULL); return _arrays[array]; } @@ -137,7 +137,7 @@ has_column(const InternalName *name) const { // This may only be called after the format has been // registered. //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexFormat:: +INLINE size_t GeomVertexFormat:: get_num_points() const { nassertr(_is_registered, 0); return _points.size(); @@ -154,9 +154,9 @@ get_num_points() const { // registered. //////////////////////////////////////////////////////////////////// INLINE const InternalName *GeomVertexFormat:: -get_point(int n) const { +get_point(size_t n) const { nassertr(_is_registered, NULL); - nassertr(n >= 0 && n < (int)_points.size(), NULL); + nassertr(n < _points.size(), NULL); return _points[n]; } @@ -169,7 +169,7 @@ get_point(int n) const { // This may only be called after the format has been // registered. //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexFormat:: +INLINE size_t GeomVertexFormat:: get_num_vectors() const { nassertr(_is_registered, 0); return _vectors.size(); @@ -187,9 +187,9 @@ get_num_vectors() const { // registered. //////////////////////////////////////////////////////////////////// INLINE const InternalName *GeomVertexFormat:: -get_vector(int n) const { +get_vector(size_t n) const { nassertr(_is_registered, NULL); - nassertr(n >= 0 && n < (int)_vectors.size(), NULL); + nassertr(n < _vectors.size(), NULL); return _vectors[n]; } @@ -202,7 +202,7 @@ get_vector(int n) const { // This may only be called after the format has been // registered. //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexFormat:: +INLINE size_t GeomVertexFormat:: get_num_texcoords() const { nassertr(_is_registered, 0); return _texcoords.size(); @@ -218,9 +218,9 @@ get_num_texcoords() const { // registered. //////////////////////////////////////////////////////////////////// INLINE const InternalName *GeomVertexFormat:: -get_texcoord(int n) const { +get_texcoord(size_t n) const { nassertr(_is_registered, NULL); - nassertr(n >= 0 && n < (int)_texcoords.size(), NULL); + nassertr(n < _texcoords.size(), NULL); return _texcoords[n]; } @@ -233,7 +233,7 @@ get_texcoord(int n) const { // This may only be called after the format has been // registered. //////////////////////////////////////////////////////////////////// -INLINE int GeomVertexFormat:: +INLINE size_t GeomVertexFormat:: get_num_morphs() const { nassertr(_is_registered, 0); @@ -252,9 +252,9 @@ get_num_morphs() const { // registered. //////////////////////////////////////////////////////////////////// INLINE const InternalName *GeomVertexFormat:: -get_morph_slider(int n) const { +get_morph_slider(size_t n) const { nassertr(_is_registered, NULL); - nassertr(n >= 0 && n < (int)_morphs.size(), NULL); + nassertr(n < _morphs.size(), NULL); return _morphs[n]._slider; } @@ -271,9 +271,9 @@ get_morph_slider(int n) const { // registered. //////////////////////////////////////////////////////////////////// INLINE const InternalName *GeomVertexFormat:: -get_morph_base(int n) const { +get_morph_base(size_t n) const { nassertr(_is_registered, NULL); - nassertr(n >= 0 && n < (int)_morphs.size(), NULL); + nassertr(n < _morphs.size(), NULL); return _morphs[n]._base; } @@ -292,9 +292,9 @@ get_morph_base(int n) const { // registered. //////////////////////////////////////////////////////////////////// INLINE const InternalName *GeomVertexFormat:: -get_morph_delta(int n) const { +get_morph_delta(size_t n) const { nassertr(_is_registered, NULL); - nassertr(n >= 0 && n < (int)_morphs.size(), NULL); + nassertr(n < _morphs.size(), NULL); return _morphs[n]._delta; } diff --git a/panda/src/gobj/geomVertexFormat.cxx b/panda/src/gobj/geomVertexFormat.cxx index ec5a29436e..35401efc1f 100644 --- a/panda/src/gobj/geomVertexFormat.cxx +++ b/panda/src/gobj/geomVertexFormat.cxx @@ -205,8 +205,8 @@ get_union_format(const GeomVertexFormat *other) const { // Add the columns from the first format. if (ai < _arrays.size()) { GeomVertexArrayFormat *array_format = _arrays[ai]; - int num_columns = array_format->get_num_columns(); - for (int i = 0; i < num_columns; ++i) { + size_t num_columns = array_format->get_num_columns(); + for (size_t i = 0; i < num_columns; ++i) { const GeomVertexColumn *column_a = array_format->get_column(i); bool inserted = column_names.insert(column_a->get_name()).second; if (inserted) { @@ -232,8 +232,8 @@ get_union_format(const GeomVertexFormat *other) const { // Add the columns from the second format. if (ai < other->_arrays.size()) { GeomVertexArrayFormat *array_format = other->_arrays[ai]; - int num_columns = array_format->get_num_columns(); - for (int i = 0; i < num_columns; ++i) { + size_t num_columns = array_format->get_num_columns(); + for (size_t i = 0; i < num_columns; ++i) { const GeomVertexColumn *column_a = array_format->get_column(i); bool inserted = column_names.insert(column_a->get_name()).second; if (inserted) { @@ -276,9 +276,9 @@ get_union_format(const GeomVertexFormat *other) const { // registered. //////////////////////////////////////////////////////////////////// GeomVertexArrayFormat *GeomVertexFormat:: -modify_array(int array) { +modify_array(size_t array) { nassertr(!is_registered(), NULL); - nassertr(array >= 0 && array < (int)_arrays.size(), NULL); + nassertr(array < _arrays.size(), NULL); if (_arrays[array]->is_registered() || _arrays[array]->get_ref_count() > 1) { @@ -297,9 +297,9 @@ modify_array(int array) { // registered. //////////////////////////////////////////////////////////////////// void GeomVertexFormat:: -set_array(int array, const GeomVertexArrayFormat *format) { +set_array(size_t array, const GeomVertexArrayFormat *format) { nassertv(!is_registered()); - nassertv(array >= 0 && array < (int)_arrays.size()); + nassertv(array < _arrays.size()); _arrays[array] = (GeomVertexArrayFormat *)format; } @@ -312,10 +312,10 @@ set_array(int array, const GeomVertexArrayFormat *format) { // registered. //////////////////////////////////////////////////////////////////// void GeomVertexFormat:: -remove_array(int array) { +remove_array(size_t array) { nassertv(!is_registered()); - nassertv(array >= 0 && array < (int)_arrays.size()); + nassertv(array < _arrays.size()); _arrays.erase(_arrays.begin() + array); } @@ -330,11 +330,11 @@ remove_array(int array) { // This may not be called once the format has been // registered. //////////////////////////////////////////////////////////////////// -int GeomVertexFormat:: +size_t GeomVertexFormat:: add_array(const GeomVertexArrayFormat *array_format) { - nassertr(!is_registered(), -1); + nassertr(!is_registered(), 0); - int new_array = (int)_arrays.size(); + size_t new_array = _arrays.size(); _arrays.push_back((GeomVertexArrayFormat *)array_format); return new_array; } @@ -351,9 +351,9 @@ add_array(const GeomVertexArrayFormat *array_format) { // registered. //////////////////////////////////////////////////////////////////// void GeomVertexFormat:: -insert_array(int array, const GeomVertexArrayFormat *array_format) { +insert_array(size_t array, const GeomVertexArrayFormat *array_format) { nassertv(!is_registered()); - nassertv(array >= 0 && array <= (int)_arrays.size()); + nassertv(array <= _arrays.size()); _arrays.insert(_arrays.begin() + array, (GeomVertexArrayFormat *)array_format); } @@ -403,9 +403,9 @@ remove_empty_arrays() { // Description: Returns the total number of different columns in // the specification, across all arrays. //////////////////////////////////////////////////////////////////// -int GeomVertexFormat:: +size_t GeomVertexFormat:: get_num_columns() const { - int num_columns = 0; + size_t num_columns = 0; Arrays::const_iterator ai; for (ai = _arrays.begin(); ai != _arrays.end(); ++ai) { num_columns += (*ai)->get_num_columns(); @@ -420,7 +420,7 @@ get_num_columns() const { // across all arrays. //////////////////////////////////////////////////////////////////// const GeomVertexColumn *GeomVertexFormat:: -get_column(int i) const { +get_column(size_t i) const { Arrays::const_iterator ai; for (ai = _arrays.begin(); ai != _arrays.end(); ++ai) { if (i < (*ai)->get_num_columns()) { @@ -445,7 +445,7 @@ get_column(int i) const { // array data. //////////////////////////////////////////////////////////////////// int GeomVertexFormat:: -get_array_with(int i) const { +get_array_with(size_t i) const { int array_index = 0; for (array_index = 0; array_index < (int)_arrays.size(); array_index++) { if (i < _arrays[array_index]->get_num_columns()) { diff --git a/panda/src/gobj/geomVertexFormat.h b/panda/src/gobj/geomVertexFormat.h index ba2faf2c36..d3401911d1 100644 --- a/panda/src/gobj/geomVertexFormat.h +++ b/panda/src/gobj/geomVertexFormat.h @@ -78,20 +78,20 @@ PUBLISHED: CPT(GeomVertexFormat) get_post_animated_format() const; CPT(GeomVertexFormat) get_union_format(const GeomVertexFormat *other) const; - INLINE int get_num_arrays() const; - INLINE const GeomVertexArrayFormat *get_array(int array) const; + INLINE size_t get_num_arrays() const; + INLINE const GeomVertexArrayFormat *get_array(size_t array) const; MAKE_SEQ(get_arrays, get_num_arrays, get_array); - GeomVertexArrayFormat *modify_array(int array); - void set_array(int array, const GeomVertexArrayFormat *format); - void remove_array(int array); - int add_array(const GeomVertexArrayFormat *array_format); - void insert_array(int array, const GeomVertexArrayFormat *array_format); + GeomVertexArrayFormat *modify_array(size_t array); + void set_array(size_t array, const GeomVertexArrayFormat *format); + void remove_array(size_t array); + size_t add_array(const GeomVertexArrayFormat *array_format); + void insert_array(size_t array, const GeomVertexArrayFormat *array_format); void clear_arrays(); void remove_empty_arrays(); - int get_num_columns() const; - int get_array_with(int i) const; - const GeomVertexColumn *get_column(int i) const; + size_t get_num_columns() const; + int get_array_with(size_t i) const; + const GeomVertexColumn *get_column(size_t i) const; int get_array_with(const InternalName *name) const; const GeomVertexColumn *get_column(const InternalName *name) const; @@ -104,22 +104,22 @@ PUBLISHED: void align_columns_for_animation(); void maybe_align_columns_for_animation(); - INLINE int get_num_points() const; - INLINE const InternalName *get_point(int n) const; + INLINE size_t get_num_points() const; + INLINE const InternalName *get_point(size_t n) const; MAKE_SEQ(get_points, get_num_points, get_point); - INLINE int get_num_vectors() const; - INLINE const InternalName *get_vector(int n) const; + INLINE size_t get_num_vectors() const; + INLINE const InternalName *get_vector(size_t n) const; MAKE_SEQ(get_vectors, get_num_vectors, get_vector); - INLINE int get_num_texcoords() const; - INLINE const InternalName *get_texcoord(int n) const; + INLINE size_t get_num_texcoords() const; + INLINE const InternalName *get_texcoord(size_t n) const; MAKE_SEQ(get_texcoords, get_num_texcoords, get_texcoord); - INLINE int get_num_morphs() const; - INLINE const InternalName *get_morph_slider(int n) const; - INLINE const InternalName *get_morph_base(int n) const; - INLINE const InternalName *get_morph_delta(int n) const; + INLINE size_t get_num_morphs() const; + INLINE const InternalName *get_morph_slider(size_t n) const; + INLINE const InternalName *get_morph_base(size_t n) const; + INLINE const InternalName *get_morph_delta(size_t n) const; MAKE_SEQ(get_morph_sliders, get_num_morphs, get_morph_slider); MAKE_SEQ(get_morph_bases, get_num_morphs, get_morph_base); MAKE_SEQ(get_morph_deltas, get_num_morphs, get_morph_delta); diff --git a/panda/src/gobj/lens.I b/panda/src/gobj/lens.I index efb1600bea..94fd617572 100644 --- a/panda/src/gobj/lens.I +++ b/panda/src/gobj/lens.I @@ -802,7 +802,7 @@ get_last_change() const { //////////////////////////////////////////////////////////////////// INLINE void Lens:: do_adjust_user_flags(CData *cdata, int clear_flags, int set_flags) { - cdata->_user_flags = (cdata->_user_flags & ~clear_flags) | set_flags; + cdata->_user_flags = (cdata->_user_flags & ~clear_flags) | (short)set_flags; } //////////////////////////////////////////////////////////////////// @@ -813,7 +813,7 @@ do_adjust_user_flags(CData *cdata, int clear_flags, int set_flags) { //////////////////////////////////////////////////////////////////// INLINE void Lens:: do_adjust_comp_flags(CData *cdata, int clear_flags, int set_flags) { - cdata->_comp_flags = (cdata->_comp_flags & ~clear_flags) | set_flags; + cdata->_comp_flags = (cdata->_comp_flags & ~clear_flags) | (short)set_flags; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/gobj/sliderTable.I b/panda/src/gobj/sliderTable.I index 7b5ed6dcb3..1d76df7b85 100644 --- a/panda/src/gobj/sliderTable.I +++ b/panda/src/gobj/sliderTable.I @@ -62,7 +62,7 @@ register_table(const SliderTable *table) { // Access: Published // Description: Returns the number of sliders in the table. //////////////////////////////////////////////////////////////////// -INLINE int SliderTable:: +INLINE size_t SliderTable:: get_num_sliders() const { return _sliders.size(); } @@ -73,8 +73,8 @@ get_num_sliders() const { // Description: Returns the nth slider in the table. //////////////////////////////////////////////////////////////////// INLINE const VertexSlider *SliderTable:: -get_slider(int n) const { - nassertr(n >= 0 && n < (int)_sliders.size(), NULL); +get_slider(size_t n) const { + nassertr(n < _sliders.size(), NULL); return _sliders[n]._slider; } @@ -85,8 +85,8 @@ get_slider(int n) const { // nth slider in the table. //////////////////////////////////////////////////////////////////// INLINE const SparseArray &SliderTable:: -get_slider_rows(int n) const { - nassertr(n >= 0 && n < (int)_sliders.size(), _empty_array); +get_slider_rows(size_t n) const { + nassertr(n < _sliders.size(), _empty_array); return _sliders[n]._rows; } diff --git a/panda/src/gobj/sliderTable.cxx b/panda/src/gobj/sliderTable.cxx index 9a6d569e5f..25ebeb6479 100644 --- a/panda/src/gobj/sliderTable.cxx +++ b/panda/src/gobj/sliderTable.cxx @@ -75,9 +75,9 @@ SliderTable:: // unregistered tables. //////////////////////////////////////////////////////////////////// void SliderTable:: -set_slider(int n, const VertexSlider *slider) { +set_slider(size_t n, const VertexSlider *slider) { nassertv(!_is_registered); - nassertv(n >= 0 && n < (int)_sliders.size()); + nassertv(n < _sliders.size()); if (_sliders[n]._slider->get_name() != slider->get_name()) { _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n); @@ -94,12 +94,12 @@ set_slider(int n, const VertexSlider *slider) { // valid for unregistered tables. //////////////////////////////////////////////////////////////////// void SliderTable:: -set_slider_rows(int n, const SparseArray &rows) { +set_slider_rows(size_t n, const SparseArray &rows) { // We don't actually enforce the registration requirement, since // gee, it doesn't actually matter here; and the GeomVertexData // needs to be able to change the SparseArrays in the bam reader. // nassertv(!_is_registered); - nassertv(n >= 0 && n < (int)_sliders.size()); + nassertv(n < _sliders.size()); _sliders[n]._rows = rows; } @@ -111,9 +111,9 @@ set_slider_rows(int n, const SparseArray &rows) { // unregistered tables. //////////////////////////////////////////////////////////////////// void SliderTable:: -remove_slider(int n) { +remove_slider(size_t n) { nassertv(!_is_registered); - nassertv(n >= 0 && n < (int)_sliders.size()); + nassertv(n < _sliders.size()); _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n); _sliders.erase(_sliders.begin() + n); @@ -126,11 +126,11 @@ remove_slider(int n) { // index number of the new slider. Only valid for // unregistered tables. //////////////////////////////////////////////////////////////////// -int SliderTable:: +size_t SliderTable:: add_slider(const VertexSlider *slider, const SparseArray &rows) { - nassertr(!_is_registered, -1); + nassertr(!_is_registered, 0); - int new_index = (int)_sliders.size(); + size_t new_index = _sliders.size(); SliderDef slider_def; slider_def._slider = slider; diff --git a/panda/src/gobj/sliderTable.h b/panda/src/gobj/sliderTable.h index 7df0e28ed2..cdb8548b80 100644 --- a/panda/src/gobj/sliderTable.h +++ b/panda/src/gobj/sliderTable.h @@ -49,20 +49,20 @@ PUBLISHED: INLINE bool is_registered() const; INLINE static CPT(SliderTable) register_table(const SliderTable *table); - INLINE int get_num_sliders() const; - INLINE const VertexSlider *get_slider(int n) const; + INLINE size_t get_num_sliders() const; + INLINE const VertexSlider *get_slider(size_t n) const; MAKE_SEQ(get_sliders, get_num_sliders, get_slider); - INLINE const SparseArray &get_slider_rows(int n) const; + INLINE const SparseArray &get_slider_rows(size_t n) const; INLINE const SparseArray &find_sliders(const InternalName *name) const; INLINE bool has_slider(const InternalName *name) const; INLINE bool is_empty() const; INLINE UpdateSeq get_modified(Thread *current_thread) const; - void set_slider(int n, const VertexSlider *slider); - void set_slider_rows(int n, const SparseArray &rows); - void remove_slider(int n); - int add_slider(const VertexSlider *slider, const SparseArray &rows); + void set_slider(size_t n, const VertexSlider *slider); + void set_slider_rows(size_t n, const SparseArray &rows); + void remove_slider(size_t n); + size_t add_slider(const VertexSlider *slider, const SparseArray &rows); void write(ostream &out) const; diff --git a/panda/src/gobj/texture.I b/panda/src/gobj/texture.I index 24a21e06b4..83ebd1fe88 100644 --- a/panda/src/gobj/texture.I +++ b/panda/src/gobj/texture.I @@ -344,7 +344,7 @@ INLINE string Texture:: get_clear_data() const { CDReader cdata(_cycler); unsigned char data[16]; - int size = do_get_clear_data(cdata, data); + size_t size = do_get_clear_data(cdata, data); return string((char *)data, size); } diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 5ae858a926..5f54059fbb 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -4432,7 +4432,7 @@ do_set_ram_mipmap_image(CData *cdata, int n, CPTA_uchar image, size_t page_size) // be initialized with this string repeated for // every pixel. //////////////////////////////////////////////////////////////////// -int Texture:: +size_t Texture:: do_get_clear_data(const CData *cdata, unsigned char *into) const { nassertr(cdata->_has_clear_color, 0); nassertr(cdata->_num_components <= 4, 0); diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index adfc8258bd..fff5770693 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -597,7 +597,7 @@ protected: PTA_uchar do_modify_ram_mipmap_image(CData *cdata, int n); PTA_uchar do_make_ram_mipmap_image(CData *cdata, int n); void do_set_ram_mipmap_image(CData *cdata, int n, CPTA_uchar image, size_t page_size); - int do_get_clear_data(const CData *cdata, unsigned char *into) const; + size_t do_get_clear_data(const CData *cdata, unsigned char *into) const; bool consider_auto_process_ram_image(bool generate_mipmaps, bool allow_compression); bool do_consider_auto_process_ram_image(CData *cdata, bool generate_mipmaps, diff --git a/panda/src/gobj/transformBlend.I b/panda/src/gobj/transformBlend.I index a10ec14689..37e501ab35 100644 --- a/panda/src/gobj/transformBlend.I +++ b/panda/src/gobj/transformBlend.I @@ -145,7 +145,7 @@ operator != (const TransformBlend &other) const { // Description: Returns the number of transforms stored in the blend // object. //////////////////////////////////////////////////////////////////// -INLINE int TransformBlend:: +INLINE size_t TransformBlend:: get_num_transforms() const { return _entries.size(); } @@ -157,8 +157,8 @@ get_num_transforms() const { // object. //////////////////////////////////////////////////////////////////// INLINE const VertexTransform *TransformBlend:: -get_transform(int n) const { - nassertr(n >= 0 && n < (int)_entries.size(), NULL); +get_transform(size_t n) const { + nassertr(n < _entries.size(), NULL); return _entries[n]._transform; } @@ -169,8 +169,8 @@ get_transform(int n) const { // stored in the blend object. //////////////////////////////////////////////////////////////////// INLINE PN_stdfloat TransformBlend:: -get_weight(int n) const { - nassertr(n >= 0 && n < (int)_entries.size(), 0.0f); +get_weight(size_t n) const { + nassertr(n < _entries.size(), 0.0f); return _entries[n]._weight; } @@ -181,8 +181,8 @@ get_weight(int n) const { // object. //////////////////////////////////////////////////////////////////// INLINE void TransformBlend:: -set_transform(int n, const VertexTransform *transform) { - nassertv(n >= 0 && n < (int)_entries.size()); +set_transform(size_t n, const VertexTransform *transform) { + nassertv(n < _entries.size()); _entries[n]._transform = transform; } @@ -193,8 +193,8 @@ set_transform(int n, const VertexTransform *transform) { // stored in the blend object. //////////////////////////////////////////////////////////////////// INLINE void TransformBlend:: -set_weight(int n, PN_stdfloat weight) { - nassertv(n >= 0 && n < (int)_entries.size()); +set_weight(size_t n, PN_stdfloat weight) { + nassertv(n < _entries.size()); _entries[n]._weight = weight; } diff --git a/panda/src/gobj/transformBlend.h b/panda/src/gobj/transformBlend.h index eb0a6c4c49..d85908bfd4 100644 --- a/panda/src/gobj/transformBlend.h +++ b/panda/src/gobj/transformBlend.h @@ -62,12 +62,12 @@ PUBLISHED: bool has_transform(const VertexTransform *transform) const; PN_stdfloat get_weight(const VertexTransform *transform) const; - INLINE int get_num_transforms() const; - INLINE const VertexTransform *get_transform(int n) const; + INLINE size_t get_num_transforms() const; + INLINE const VertexTransform *get_transform(size_t n) const; MAKE_SEQ(get_transforms, get_num_transforms, get_transform); - INLINE PN_stdfloat get_weight(int n) const; - INLINE void set_transform(int n, const VertexTransform *transform); - INLINE void set_weight(int n, PN_stdfloat weight); + INLINE PN_stdfloat get_weight(size_t n) const; + INLINE void set_transform(size_t n, const VertexTransform *transform); + INLINE void set_weight(size_t n, PN_stdfloat weight); INLINE void update_blend(Thread *current_thread) const; diff --git a/panda/src/gobj/transformBlendTable.I b/panda/src/gobj/transformBlendTable.I index f60c8ab996..1c2eecb65c 100644 --- a/panda/src/gobj/transformBlendTable.I +++ b/panda/src/gobj/transformBlendTable.I @@ -19,7 +19,7 @@ // Description: Returns the total number of different blend // combinations in the table. //////////////////////////////////////////////////////////////////// -INLINE int TransformBlendTable:: +INLINE size_t TransformBlendTable:: get_num_blends() const { return _blends.size(); } @@ -30,8 +30,8 @@ get_num_blends() const { // Description: Returns the nth blend in the table. //////////////////////////////////////////////////////////////////// INLINE const TransformBlend &TransformBlendTable:: -get_blend(int n) const { - nassertr(n >= 0 && n < (int)_blends.size(), _blends[0]); +get_blend(size_t n) const { + nassertr(n < _blends.size(), _blends[0]); return _blends[n]; } diff --git a/panda/src/gobj/transformBlendTable.cxx b/panda/src/gobj/transformBlendTable.cxx index cb8e01986c..1efffb1fec 100644 --- a/panda/src/gobj/transformBlendTable.cxx +++ b/panda/src/gobj/transformBlendTable.cxx @@ -78,8 +78,8 @@ TransformBlendTable:: // indicated value. //////////////////////////////////////////////////////////////////// void TransformBlendTable:: -set_blend(int n, const TransformBlend &blend) { - nassertv(n >= 0 && n < (int)_blends.size()); +set_blend(size_t n, const TransformBlend &blend) { + nassertv(n < _blends.size()); _blends[n] = blend; } @@ -89,8 +89,8 @@ set_blend(int n, const TransformBlend &blend) { // Description: Removes the blend at the nth position. //////////////////////////////////////////////////////////////////// void TransformBlendTable:: -remove_blend(int n) { - nassertv(n >= 0 && n < (int)_blends.size()); +remove_blend(size_t n) { + nassertv(n < _blends.size()); _blends.erase(_blends.begin() + n); } @@ -101,7 +101,7 @@ remove_blend(int n) { // index number. If there is already an identical blend // in the table, simply returns that number instead. //////////////////////////////////////////////////////////////////// -int TransformBlendTable:: +size_t TransformBlendTable:: add_blend(const TransformBlend &blend) { consider_rebuild_index(); @@ -113,7 +113,7 @@ add_blend(const TransformBlend &blend) { } bool needs_realloc = (_blends.size() >= _blends.capacity()); - int new_position = (int)_blends.size(); + size_t new_position = _blends.size(); _blends.push_back(blend); if (needs_realloc) { @@ -127,7 +127,7 @@ add_blend(const TransformBlend &blend) { const TransformBlend &added_blend = _blends[new_position]; _blend_index[&added_blend] = new_position; _max_simultaneous_transforms = max(_max_simultaneous_transforms, - blend.get_num_transforms()); + (int)blend.get_num_transforms()); // We can't compute this one as we go, so set it to a special // value to indicate it needs to be recomputed. @@ -144,7 +144,7 @@ add_blend(const TransformBlend &blend) { //////////////////////////////////////////////////////////////////// void TransformBlendTable:: write(ostream &out, int indent_level) const { - for (int i = 0; i < (int)_blends.size(); i++) { + for (size_t i = 0; i < _blends.size(); ++i) { indent(out, indent_level) << i << ". " << _blends[i] << "\n"; } @@ -179,14 +179,14 @@ rebuild_index() { pset transforms; - for (int i = 0; i < (int)_blends.size(); ++i) { + for (size_t i = 0; i < _blends.size(); ++i) { const TransformBlend &blend = _blends[i]; _blend_index[&blend] = i; - for (int ti = 0; ti < blend.get_num_transforms(); ++ti) { + for (size_t ti = 0; ti < blend.get_num_transforms(); ++ti) { transforms.insert(blend.get_transform(ti)); } - _max_simultaneous_transforms = max(_max_simultaneous_transforms, + _max_simultaneous_transforms = max((size_t)_max_simultaneous_transforms, blend.get_num_transforms()); } diff --git a/panda/src/gobj/transformBlendTable.h b/panda/src/gobj/transformBlendTable.h index d169ea19f5..aa7ef3387d 100644 --- a/panda/src/gobj/transformBlendTable.h +++ b/panda/src/gobj/transformBlendTable.h @@ -57,14 +57,14 @@ PUBLISHED: void operator = (const TransformBlendTable ©); virtual ~TransformBlendTable(); - INLINE int get_num_blends() const; - INLINE const TransformBlend &get_blend(int n) const; + INLINE size_t get_num_blends() const; + INLINE const TransformBlend &get_blend(size_t n) const; MAKE_SEQ(get_blends, get_num_blends, get_blend); INLINE UpdateSeq get_modified(Thread *current_thread) const; - void set_blend(int n, const TransformBlend &blend); - void remove_blend(int n); - int add_blend(const TransformBlend &blend); + void set_blend(size_t n, const TransformBlend &blend); + void remove_blend(size_t n); + size_t add_blend(const TransformBlend &blend); INLINE int get_num_transforms() const; INLINE int get_max_simultaneous_transforms() const; diff --git a/panda/src/gobj/transformTable.I b/panda/src/gobj/transformTable.I index 8f7c2a4ffa..25423a7465 100644 --- a/panda/src/gobj/transformTable.I +++ b/panda/src/gobj/transformTable.I @@ -62,7 +62,7 @@ register_table(const TransformTable *table) { // Access: Published // Description: Returns the number of transforms in the table. //////////////////////////////////////////////////////////////////// -INLINE int TransformTable:: +INLINE size_t TransformTable:: get_num_transforms() const { return _transforms.size(); } @@ -73,8 +73,8 @@ get_num_transforms() const { // Description: Returns the nth transform in the table. //////////////////////////////////////////////////////////////////// INLINE const VertexTransform *TransformTable:: -get_transform(int n) const { - nassertr(n >= 0 && n < (int)_transforms.size(), NULL); +get_transform(size_t n) const { + nassertr(n < _transforms.size(), NULL); return _transforms[n]; } diff --git a/panda/src/gobj/transformTable.cxx b/panda/src/gobj/transformTable.cxx index ccbd44a00f..466f30f226 100644 --- a/panda/src/gobj/transformTable.cxx +++ b/panda/src/gobj/transformTable.cxx @@ -71,9 +71,9 @@ TransformTable:: // unregistered tables. //////////////////////////////////////////////////////////////////// void TransformTable:: -set_transform(int n, const VertexTransform *transform) { +set_transform(size_t n, const VertexTransform *transform) { nassertv(!_is_registered); - nassertv(n >= 0 && n < (int)_transforms.size()); + nassertv(n < _transforms.size()); _transforms[n] = transform; } @@ -84,9 +84,9 @@ set_transform(int n, const VertexTransform *transform) { // unregistered tables. //////////////////////////////////////////////////////////////////// void TransformTable:: -remove_transform(int n) { +remove_transform(size_t n) { nassertv(!_is_registered); - nassertv(n >= 0 && n < (int)_transforms.size()); + nassertv(n < _transforms.size()); _transforms.erase(_transforms.begin() + n); } @@ -101,10 +101,10 @@ remove_transform(int n) { // the transform is already present in the table, it // will be added twice. //////////////////////////////////////////////////////////////////// -int TransformTable:: +size_t TransformTable:: add_transform(const VertexTransform *transform) { nassertr(!_is_registered, -1); - int new_index = (int)_transforms.size(); + size_t new_index = _transforms.size(); _transforms.push_back(transform); return new_index; } diff --git a/panda/src/gobj/transformTable.h b/panda/src/gobj/transformTable.h index 2563594a08..0db7146af0 100644 --- a/panda/src/gobj/transformTable.h +++ b/panda/src/gobj/transformTable.h @@ -49,14 +49,14 @@ PUBLISHED: INLINE bool is_registered() const; INLINE static CPT(TransformTable) register_table(const TransformTable *table); - INLINE int get_num_transforms() const; - INLINE const VertexTransform *get_transform(int n) const; + INLINE size_t get_num_transforms() const; + INLINE const VertexTransform *get_transform(size_t n) const; MAKE_SEQ(get_transforms, get_num_transforms, get_transform); INLINE UpdateSeq get_modified(Thread *current_thread) const; - void set_transform(int n, const VertexTransform *transform); - void remove_transform(int n); - int add_transform(const VertexTransform *transform); + void set_transform(size_t n, const VertexTransform *transform); + void remove_transform(size_t n); + size_t add_transform(const VertexTransform *transform); void write(ostream &out) const; diff --git a/panda/src/gobj/vertexDataBook.I b/panda/src/gobj/vertexDataBook.I index 30e6f01ef4..0099c7c86e 100644 --- a/panda/src/gobj/vertexDataBook.I +++ b/panda/src/gobj/vertexDataBook.I @@ -30,7 +30,7 @@ alloc(size_t size) { // Access: Published // Description: Returns the number of pages created for the book. //////////////////////////////////////////////////////////////////// -INLINE int VertexDataBook:: +INLINE size_t VertexDataBook:: get_num_pages() const { return _pages.size(); } diff --git a/panda/src/gobj/vertexDataBook.h b/panda/src/gobj/vertexDataBook.h index 4f5754138b..953e0be0e9 100644 --- a/panda/src/gobj/vertexDataBook.h +++ b/panda/src/gobj/vertexDataBook.h @@ -36,7 +36,7 @@ PUBLISHED: INLINE VertexDataBlock *alloc(size_t size); - INLINE int get_num_pages() const; + INLINE size_t get_num_pages() const; size_t count_total_page_size() const; size_t count_total_page_size(VertexDataPage::RamClass ram_class) const; diff --git a/panda/src/linmath/lcast_to_src.I b/panda/src/linmath/lcast_to_src.I index dc154c9d75..e4c7b586d3 100644 --- a/panda/src/linmath/lcast_to_src.I +++ b/panda/src/linmath/lcast_to_src.I @@ -119,7 +119,7 @@ lcast_to(FLOATTYPE2 *, const FLOATNAME(LPoint4) &source) { INLINE_LINMATH FLOATNAME2(LQuaternion) lcast_to(FLOATTYPE2 *, const FLOATNAME(LQuaternion) &c) { - return FLOATNAME2(LQuaternion)(c.get_r(), c.get_i(), c.get_j(), c.get_k()); + return FLOATNAME2(LQuaternion)((FLOATTYPE2)c.get_r(), (FLOATTYPE2)c.get_i(), (FLOATTYPE2)c.get_j(), (FLOATTYPE2)c.get_k()); } INLINE_LINMATH FLOATNAME2(LMatrix3) @@ -141,45 +141,45 @@ lcast_to(FLOATTYPE2 *, const FLOATNAME(LMatrix4) &source) { INLINE_LINMATH FLOATNAME2(LVecBase2) lcast_to(FLOATTYPE2 *, const LVecBase2i &source) { - return FLOATNAME2(LVecBase2)(source[0], source[1]); + return FLOATNAME2(LVecBase2)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1]); } INLINE_LINMATH FLOATNAME2(LVecBase3) lcast_to(FLOATTYPE2 *, const LVecBase3i &source) { - return FLOATNAME2(LVecBase3)(source[0], source[1], source[2]); + return FLOATNAME2(LVecBase3)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2]); } INLINE_LINMATH FLOATNAME2(LVecBase4) lcast_to(FLOATTYPE2 *, const LVecBase4i &source) { - return FLOATNAME2(LVecBase4)(source[0], source[1], source[2], source[3]); + return FLOATNAME2(LVecBase4)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2], (FLOATTYPE2)source[3]); } INLINE_LINMATH FLOATNAME2(LVector2) lcast_to(FLOATTYPE2 *, const LVector2i &source) { - return FLOATNAME2(LVector2)(source[0], source[1]); + return FLOATNAME2(LVector2)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1]); } INLINE_LINMATH FLOATNAME2(LVector3) lcast_to(FLOATTYPE2 *, const LVector3i &source) { - return FLOATNAME2(LVector3)(source[0], source[1], source[2]); + return FLOATNAME2(LVector3)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2]); } INLINE_LINMATH FLOATNAME2(LVector4) lcast_to(FLOATTYPE2 *, const LVector4i &source) { - return FLOATNAME2(LVector4)(source[0], source[1], source[2], source[3]); + return FLOATNAME2(LVector4)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2], (FLOATTYPE2)source[3]); } INLINE_LINMATH FLOATNAME2(LPoint2) lcast_to(FLOATTYPE2 *, const LPoint2i &source) { - return FLOATNAME2(LPoint2)(source[0], source[1]); + return FLOATNAME2(LPoint2)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1]); } INLINE_LINMATH FLOATNAME2(LPoint3) lcast_to(FLOATTYPE2 *, const LPoint3i &source) { - return FLOATNAME2(LPoint3)(source[0], source[1], source[2]); + return FLOATNAME2(LPoint3)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2]); } INLINE_LINMATH FLOATNAME2(LPoint4) lcast_to(FLOATTYPE2 *, const LPoint4i &source) { - return FLOATNAME2(LPoint4)(source[0], source[1], source[2], source[3]); + return FLOATNAME2(LPoint4)((FLOATTYPE2)source[0], (FLOATTYPE2)source[1], (FLOATTYPE2)source[2], (FLOATTYPE2)source[3]); } diff --git a/panda/src/linmath/lorientation_src.I b/panda/src/linmath/lorientation_src.I index 215575fe72..0c108a0e52 100644 --- a/panda/src/linmath/lorientation_src.I +++ b/panda/src/linmath/lorientation_src.I @@ -47,12 +47,12 @@ FLOATNAME(LOrientation)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k) : // Description: vector + twist //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LOrientation):: -FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &point_at, float twist) { - float radians = deg_2_rad(twist); - float theta_over_2 = radians * FLOATCONST(0.5); - float sin_to2 = sinf(theta_over_2); +FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &point_at, FLOATTYPE twist) { + FLOATTYPE radians = deg_2_rad(twist); + FLOATTYPE theta_over_2 = radians * FLOATCONST(0.5); + FLOATTYPE sin_to2 = csin(theta_over_2); - set_r(cosf(theta_over_2)); + set_r(ccos(theta_over_2)); set_i(point_at[0] * sin_to2); set_j(point_at[1] * sin_to2); set_k(point_at[2] * sin_to2); diff --git a/panda/src/linmath/lorientation_src.h b/panda/src/linmath/lorientation_src.h index 7c4e33d0a7..9c92abbb1a 100644 --- a/panda/src/linmath/lorientation_src.h +++ b/panda/src/linmath/lorientation_src.h @@ -23,7 +23,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LOrientation)(); INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LQuaternion) &c); INLINE_LINMATH FLOATNAME(LOrientation)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &point_at, float twist); + INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &point_at, FLOATTYPE twist); INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix3) &m); INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &m); diff --git a/panda/src/linmath/lquaternion_src.I b/panda/src/linmath/lquaternion_src.I index 05ed166248..79ebf049f6 100644 --- a/panda/src/linmath/lquaternion_src.I +++ b/panda/src/linmath/lquaternion_src.I @@ -339,7 +339,7 @@ get_axis_normalized() const { //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATTYPE FLOATNAME(LQuaternion):: get_angle_rad() const { - return acos(_v(0)) * 2.0; + return acos(_v(0)) * FLOATCONST(2.0); } //////////////////////////////////////////////////////////////////// @@ -368,8 +368,8 @@ get_angle() const { INLINE_LINMATH void FLOATNAME(LQuaternion):: set_from_axis_angle_rad(FLOATTYPE angle_rad, const FLOATNAME(LVector3) &axis) { nassertv(IS_THRESHOLD_EQUAL(axis.length(), 1.0f, 0.001f)); - FLOATTYPE sinHalfAngle = sin(angle_rad * 0.5); - _v(0) = cos(angle_rad * 0.5); + FLOATTYPE sinHalfAngle = sin(angle_rad * FLOATCONST(0.5)); + _v(0) = cos(angle_rad * FLOATCONST(0.5)); _v(1) = axis[0] * sinHalfAngle; _v(2) = axis[1] * sinHalfAngle; _v(3) = axis[2] * sinHalfAngle; diff --git a/panda/src/linmath/lvecBase2_ext_src.I b/panda/src/linmath/lvecBase2_ext_src.I index 00b8fdf616..ba5daf54bf 100644 --- a/panda/src/linmath/lvecBase2_ext_src.I +++ b/panda/src/linmath/lvecBase2_ext_src.I @@ -25,7 +25,7 @@ #else #define PYNUMBER_FLOATTYPE PyNumber_Float #define PY_FROM_FLOATTYPE PyFloat_FromDouble -#define PY_AS_FLOATTYPE PyFloat_AsDouble +#define PY_AS_FLOATTYPE (FLOATTYPE)PyFloat_AsDouble #endif //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lvecBase3_ext_src.I b/panda/src/linmath/lvecBase3_ext_src.I index 56ac6cc176..d343b99303 100644 --- a/panda/src/linmath/lvecBase3_ext_src.I +++ b/panda/src/linmath/lvecBase3_ext_src.I @@ -25,7 +25,7 @@ #else #define PYNUMBER_FLOATTYPE PyNumber_Float #define PY_FROM_FLOATTYPE PyFloat_FromDouble -#define PY_AS_FLOATTYPE PyFloat_AsDouble +#define PY_AS_FLOATTYPE (FLOATTYPE)PyFloat_AsDouble #endif //////////////////////////////////////////////////////////////////// diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index 41a0d9ccce..35df48b008 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -581,6 +581,7 @@ operator != (const FLOATNAME(LVecBase3) &other) const { return !operator == (other); } +#ifndef FLOATTYPE_IS_INT //////////////////////////////////////////////////////////////////// // Function: get_standardized_rotation // Access: file @@ -628,6 +629,7 @@ get_standardized_hpr() const { get_standardized_rotation(_v(1)), get_standardized_rotation(_v(2))); } +#endif // !FLOATTYPE_IS_INT //////////////////////////////////////////////////////////////////// // Function: LVecBase3::compare_to diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index 1a4ec5ce97..f2820acd50 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -112,7 +112,9 @@ PUBLISHED: INLINE_LINMATH bool operator == (const FLOATNAME(LVecBase3) &other) const; INLINE_LINMATH bool operator != (const FLOATNAME(LVecBase3) &other) const; +#ifndef FLOATTYPE_IS_INT INLINE_LINMATH FLOATNAME(LVecBase3) get_standardized_hpr() const; +#endif INLINE_LINMATH int compare_to(const FLOATNAME(LVecBase3) &other) const; INLINE_LINMATH size_t get_hash() const; diff --git a/panda/src/linmath/lvecBase4_ext_src.I b/panda/src/linmath/lvecBase4_ext_src.I index dd06bdc0dc..6b8e4b38de 100644 --- a/panda/src/linmath/lvecBase4_ext_src.I +++ b/panda/src/linmath/lvecBase4_ext_src.I @@ -25,7 +25,7 @@ #else #define PYNUMBER_FLOATTYPE PyNumber_Float #define PY_FROM_FLOATTYPE PyFloat_FromDouble -#define PY_AS_FLOATTYPE PyFloat_AsDouble +#define PY_AS_FLOATTYPE (FLOATTYPE)PyFloat_AsDouble #endif //////////////////////////////////////////////////////////////////// diff --git a/panda/src/nativenet/socket_address.I b/panda/src/nativenet/socket_address.I index fa03c131aa..40d10b9150 100644 --- a/panda/src/nativenet/socket_address.I +++ b/panda/src/nativenet/socket_address.I @@ -98,7 +98,7 @@ operator != (const Socket_Address &in) const { // Description: Set to the broadcast address and a specified port //////////////////////////////////////////////////////////////////// INLINE bool Socket_Address:: -set_broadcast(int port) { +set_broadcast(unsigned short port) { _addr.sin_family = AF_INET; _addr.sin_addr.s_addr = 0xffffffff; _addr.sin_port = htons(port); @@ -111,7 +111,7 @@ set_broadcast(int port) { // Description: Set to any address and a specified port //////////////////////////////////////////////////////////////////// INLINE bool Socket_Address:: -set_any_IP(int port) { +set_any_IP(unsigned short port) { _addr.sin_family = AF_INET; _addr.sin_addr.s_addr = INADDR_ANY; _addr.sin_port = htons(port); @@ -124,7 +124,7 @@ set_any_IP(int port) { // Description: Set to a specified port //////////////////////////////////////////////////////////////////// INLINE bool Socket_Address:: -set_port(int port) { +set_port(unsigned short port) { _addr.sin_port = htons(port); return true; } @@ -182,7 +182,7 @@ get_ip_port() const { // it returns false and the address may be undefined. //////////////////////////////////////////////////////////////////// INLINE bool Socket_Address:: -set_host(const std::string &hostname, int port) { +set_host(const std::string &hostname, unsigned short port) { struct hostent *hp = NULL; // @@ -195,7 +195,7 @@ set_host(const std::string &hostname, int port) { // // - PN_uint32 addr = (long)inet_addr(hostname.c_str()); + PN_uint32 addr = (PN_uint32)inet_addr(hostname.c_str()); if (addr == INADDR_NONE) { hp = gethostbyname(hostname.c_str()); if (hp == NULL) { @@ -226,7 +226,7 @@ set_host(const std::string &hostname) { std::string host = hostname.substr(0, pos); std::string port = hostname.substr(pos + 1, 100);; - int port_dig = atoi(port.c_str()); + unsigned short port_dig = (unsigned short)atoi(port.c_str()); return set_host(host, port_dig); } @@ -236,7 +236,7 @@ set_host(const std::string &hostname) { // Description: ////////////////////////////////////////////////////////////// INLINE bool Socket_Address:: -set_host(PN_uint32 in_hostname, int port) { +set_host(PN_uint32 in_hostname, unsigned short port) { memcpy(&_addr.sin_addr, &in_hostname, sizeof(in_hostname)); _addr.sin_port = htons(port); _addr.sin_family = AF_INET; diff --git a/panda/src/nativenet/socket_address.h b/panda/src/nativenet/socket_address.h index a156e634d6..d177224cb5 100644 --- a/panda/src/nativenet/socket_address.h +++ b/panda/src/nativenet/socket_address.h @@ -25,13 +25,13 @@ PUBLISHED: INLINE virtual ~Socket_Address(); - INLINE bool set_any_IP(int port); - INLINE bool set_port(int port); - INLINE bool set_broadcast(int port); + INLINE bool set_any_IP(unsigned short port); + INLINE bool set_port(unsigned short port); + INLINE bool set_broadcast(unsigned short port); - INLINE bool set_host(const std::string &hostname, int port) ; + INLINE bool set_host(const std::string &hostname, unsigned short port) ; INLINE bool set_host(const std::string &hostname) ; - INLINE bool set_host(unsigned int ip4adr, int port); + INLINE bool set_host(unsigned int ip4adr, unsigned short port); INLINE void clear(); INLINE unsigned short get_port() const; diff --git a/panda/src/nativenet/socket_portable.h b/panda/src/nativenet/socket_portable.h index 4d76be5b24..fe8b6451c1 100644 --- a/panda/src/nativenet/socket_portable.h +++ b/panda/src/nativenet/socket_portable.h @@ -279,16 +279,16 @@ inline int DO_CONNECT(const SOCKET a, const sockaddr_in *b) } inline int DO_SOCKET_READ(const SOCKET a, char * buf, const int size) { - return recv(a, buf, size, 0); + return (int)recv(a, buf, (size_t)size, 0); } inline int DO_SOCKET_WRITE(const SOCKET a, const char * buff, const int len) { - return send(a, buff, len, 0); + return (int)send(a, buff, (size_t)len, 0); } /////////////////////////////////////////////// inline int DO_SOCKET_WRITE_TO(const SOCKET a, const char * buffer, const int buf_len, const sockaddr_in * addr) { - return sendto(a, buffer, buf_len, 0, reinterpret_cast(addr), sizeof(sockaddr)); + return (int)sendto(a, buffer, (size_t)buf_len, 0, reinterpret_cast(addr), sizeof(sockaddr)); } inline SOCKET DO_NEWUDP() { @@ -316,7 +316,7 @@ inline int DO_ACCEPT(SOCKET sck, sockaddr_in * adr) inline int DO_RECV_FROM(SOCKET sck, char * data, int len, sockaddr_in * addr) { socklen_t plen = sizeof(sockaddr); - return recvfrom(sck, data, len, 0, (sockaddr *)addr, &plen); + return (int)recvfrom(sck, data, (size_t)len, 0, (sockaddr *)addr, &plen); } @@ -338,7 +338,7 @@ inline int GETERROR() inline int SOCKIOCTL(const SOCKET s, const long flags, void * val) { - return ioctl(s, flags, val); + return ioctl(s, (unsigned long)flags, val); } inline bool do_shutdown_send(SOCKET s) diff --git a/panda/src/nativenet/time_clock.h b/panda/src/nativenet/time_clock.h index 37ca406df6..c41d8b489e 100644 --- a/panda/src/nativenet/time_clock.h +++ b/panda/src/nativenet/time_clock.h @@ -32,7 +32,7 @@ public: Time_Clock(); Time_Clock(time_t time); Time_Clock(long secs, long usecs); - Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, unsigned long microseconds = 0, int nDST = -1); + Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); Time_Clock(const Time_Clock& timeSrc); inline const Time_Clock& operator=(const Time_Clock& timeSrc); @@ -51,7 +51,7 @@ public: int GetSecond() const; int GetDayOfWeek() const; // 1=Sun, 2=Mon, ..., 7=Sat - void Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, unsigned long microseconds = 0, int nDST = -1); + void Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds = 0, int nDST = -1); // Operations @@ -70,7 +70,7 @@ public: { return _my_time.tv_sec; }; - unsigned long GetUsecPart() + long GetUsecPart() { return _my_time.tv_usec; }; @@ -103,7 +103,7 @@ public: // Argument : int nSec // Argument : int nDST ////////////////////////////////////////////////////////// -inline Time_Clock::Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, unsigned long microseconds , int nDST) +inline Time_Clock::Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) { struct tm atm; atm.tm_sec = nSec; @@ -134,7 +134,7 @@ inline Time_Clock::Time_Clock(int nYear, int nMonth, int nDay, int nHour, int nM // Argument : unsigned long microseconds // Argument : int nDST ////////////////////////////////////////////////////////////// -inline void Time_Clock::Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, unsigned long microseconds , int nDST) +inline void Time_Clock::Set(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, long microseconds , int nDST) { struct tm atm; atm.tm_sec = nSec; diff --git a/panda/src/pgraph/renderAttribRegistry.I b/panda/src/pgraph/renderAttribRegistry.I index 6b3da8d567..ba41733000 100644 --- a/panda/src/pgraph/renderAttribRegistry.I +++ b/panda/src/pgraph/renderAttribRegistry.I @@ -25,7 +25,7 @@ get_slot(TypeHandle type_handle) const { if (type_index >= (int)_slots_by_type.size()) { return 0; } - return _slots_by_type[type_index]; + return _slots_by_type[(size_t)type_index]; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/renderState.I b/panda/src/pgraph/renderState.I index bc7bbad4fe..c15173cdf9 100644 --- a/panda/src/pgraph/renderState.I +++ b/panda/src/pgraph/renderState.I @@ -255,7 +255,7 @@ node_unref() const { // has been cached. This number is not useful for any // practical reason other than performance analysis. //////////////////////////////////////////////////////////////////// -INLINE int RenderState:: +INLINE size_t RenderState:: get_composition_cache_num_entries() const { LightReMutexHolder holder(*_states_lock); return _composition_cache.get_num_entries(); @@ -270,7 +270,7 @@ get_composition_cache_num_entries() const { // records cache entries for the invert_compose() // operation. See get_composition_cache_num_entries(). //////////////////////////////////////////////////////////////////// -INLINE int RenderState:: +INLINE size_t RenderState:: get_invert_composition_cache_num_entries() const { LightReMutexHolder holder(*_states_lock); return _invert_composition_cache.get_num_entries(); @@ -288,7 +288,7 @@ get_invert_composition_cache_num_entries() const { // This has no practical value other than for examining // the cache for performance analysis. //////////////////////////////////////////////////////////////////// -INLINE int RenderState:: +INLINE size_t RenderState:: get_composition_cache_size() const { LightReMutexHolder holder(*_states_lock); return _composition_cache.get_size(); @@ -306,7 +306,7 @@ get_composition_cache_size() const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const RenderState *RenderState:: -get_composition_cache_source(int n) const { +get_composition_cache_source(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_composition_cache.has_element(n)) { return NULL; @@ -329,7 +329,7 @@ get_composition_cache_source(int n) const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const RenderState *RenderState:: -get_composition_cache_result(int n) const { +get_composition_cache_result(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_composition_cache.has_element(n)) { return NULL; @@ -349,7 +349,7 @@ get_composition_cache_result(int n) const { // This has no practical value other than for examining // the cache for performance analysis. //////////////////////////////////////////////////////////////////// -INLINE int RenderState:: +INLINE size_t RenderState:: get_invert_composition_cache_size() const { LightReMutexHolder holder(*_states_lock); return _invert_composition_cache.get_size(); @@ -367,7 +367,7 @@ get_invert_composition_cache_size() const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const RenderState *RenderState:: -get_invert_composition_cache_source(int n) const { +get_invert_composition_cache_source(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_invert_composition_cache.has_element(n)) { return NULL; @@ -391,7 +391,7 @@ get_invert_composition_cache_source(int n) const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const RenderState *RenderState:: -get_invert_composition_cache_result(int n) const { +get_invert_composition_cache_result(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_invert_composition_cache.has_element(n)) { return NULL; diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index a6c6896ee9..9947b68bf1 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -123,15 +123,15 @@ PUBLISHED: INLINE void node_ref() const; INLINE bool node_unref() const; - INLINE int get_composition_cache_num_entries() const; - INLINE int get_invert_composition_cache_num_entries() const; + INLINE size_t get_composition_cache_num_entries() const; + INLINE size_t get_invert_composition_cache_num_entries() const; - INLINE int get_composition_cache_size() const; - INLINE const RenderState *get_composition_cache_source(int n) const; - INLINE const RenderState *get_composition_cache_result(int n) const; - INLINE int get_invert_composition_cache_size() const; - INLINE const RenderState *get_invert_composition_cache_source(int n) const; - INLINE const RenderState *get_invert_composition_cache_result(int n) const; + INLINE size_t get_composition_cache_size() const; + INLINE const RenderState *get_composition_cache_source(size_t n) const; + INLINE const RenderState *get_composition_cache_result(size_t n) const; + INLINE size_t get_invert_composition_cache_size() const; + INLINE const RenderState *get_invert_composition_cache_source(size_t n) const; + INLINE const RenderState *get_invert_composition_cache_result(size_t n) const; EXTENSION(PyObject *get_composition_cache() const); EXTENSION(PyObject *get_invert_composition_cache() const); diff --git a/panda/src/pgraph/shaderAttrib.I b/panda/src/pgraph/shaderAttrib.I index 420e391d8e..f6eba60d83 100644 --- a/panda/src/pgraph/shaderAttrib.I +++ b/panda/src/pgraph/shaderAttrib.I @@ -272,7 +272,7 @@ set_shader_input(CPT_InternalName id, const NodePath &np, int priority) const { //////////////////////////////////////////////////////////////////// INLINE CPT(RenderAttrib) ShaderAttrib:: set_shader_input(CPT_InternalName id, double n1, double n2, double n3, double n4, int priority) const { - return set_shader_input(new ShaderInput(MOVE(id), LVecBase4(n1, n2, n3, n4), priority)); + return set_shader_input(new ShaderInput(MOVE(id), LVecBase4((PN_stdfloat)n1, (PN_stdfloat)n2, (PN_stdfloat)n3, (PN_stdfloat)n4), priority)); } //weifengh diff --git a/panda/src/pgraph/transformState.I b/panda/src/pgraph/transformState.I index 9f4ff96c90..7639e1ced8 100644 --- a/panda/src/pgraph/transformState.I +++ b/panda/src/pgraph/transformState.I @@ -804,7 +804,7 @@ node_unref() const { // has been cached. This number is not useful for any // practical reason other than performance analysis. //////////////////////////////////////////////////////////////////// -INLINE int TransformState:: +INLINE size_t TransformState:: get_composition_cache_num_entries() const { LightReMutexHolder holder(*_states_lock); return _composition_cache.get_num_entries(); @@ -819,7 +819,7 @@ get_composition_cache_num_entries() const { // records cache entries for the invert_compose() // operation. See get_composition_cache_num_entries(). //////////////////////////////////////////////////////////////////// -INLINE int TransformState:: +INLINE size_t TransformState:: get_invert_composition_cache_num_entries() const { LightReMutexHolder holder(*_states_lock); return _invert_composition_cache.get_num_entries(); @@ -837,7 +837,7 @@ get_invert_composition_cache_num_entries() const { // This has no practical value other than for examining // the cache for performance analysis. //////////////////////////////////////////////////////////////////// -INLINE int TransformState:: +INLINE size_t TransformState:: get_composition_cache_size() const { LightReMutexHolder holder(*_states_lock); return _composition_cache.get_size(); @@ -855,7 +855,7 @@ get_composition_cache_size() const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const TransformState *TransformState:: -get_composition_cache_source(int n) const { +get_composition_cache_source(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_composition_cache.has_element(n)) { return NULL; @@ -878,7 +878,7 @@ get_composition_cache_source(int n) const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const TransformState *TransformState:: -get_composition_cache_result(int n) const { +get_composition_cache_result(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_composition_cache.has_element(n)) { return NULL; @@ -898,7 +898,7 @@ get_composition_cache_result(int n) const { // This has no practical value other than for examining // the cache for performance analysis. //////////////////////////////////////////////////////////////////// -INLINE int TransformState:: +INLINE size_t TransformState:: get_invert_composition_cache_size() const { LightReMutexHolder holder(*_states_lock); return _invert_composition_cache.get_size(); @@ -916,7 +916,7 @@ get_invert_composition_cache_size() const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const TransformState *TransformState:: -get_invert_composition_cache_source(int n) const { +get_invert_composition_cache_source(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_invert_composition_cache.has_element(n)) { return NULL; @@ -940,7 +940,7 @@ get_invert_composition_cache_source(int n) const { // the cache for performance analysis. //////////////////////////////////////////////////////////////////// INLINE const TransformState *TransformState:: -get_invert_composition_cache_result(int n) const { +get_invert_composition_cache_result(size_t n) const { LightReMutexHolder holder(*_states_lock); if (!_invert_composition_cache.has_element(n)) { return NULL; diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index dac1f87da0..0de6f213fe 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -182,15 +182,15 @@ PUBLISHED: INLINE void node_ref() const; INLINE bool node_unref() const; - INLINE int get_composition_cache_num_entries() const; - INLINE int get_invert_composition_cache_num_entries() const; + INLINE size_t get_composition_cache_num_entries() const; + INLINE size_t get_invert_composition_cache_num_entries() const; - INLINE int get_composition_cache_size() const; - INLINE const TransformState *get_composition_cache_source(int n) const; - INLINE const TransformState *get_composition_cache_result(int n) const; - INLINE int get_invert_composition_cache_size() const; - INLINE const TransformState *get_invert_composition_cache_source(int n) const; - INLINE const TransformState *get_invert_composition_cache_result(int n) const; + INLINE size_t get_composition_cache_size() const; + INLINE const TransformState *get_composition_cache_source(size_t n) const; + INLINE const TransformState *get_composition_cache_result(size_t n) const; + INLINE size_t get_invert_composition_cache_size() const; + INLINE const TransformState *get_invert_composition_cache_source(size_t n) const; + INLINE const TransformState *get_invert_composition_cache_result(size_t n) const; bool validate_composition_cache() const; EXTENSION(PyObject *get_composition_cache() const); EXTENSION(PyObject *get_invert_composition_cache() const); diff --git a/panda/src/pgraphnodes/sceneGraphAnalyzer.I b/panda/src/pgraphnodes/sceneGraphAnalyzer.I index e7d0a43f59..72a638d9a4 100644 --- a/panda/src/pgraphnodes/sceneGraphAnalyzer.I +++ b/panda/src/pgraphnodes/sceneGraphAnalyzer.I @@ -128,12 +128,11 @@ get_num_geom_vertex_formats() const { // Access: Published // Description: //////////////////////////////////////////////////////////////////// -int SceneGraphAnalyzer:: +size_t SceneGraphAnalyzer:: get_vertex_data_size() const { return _vertex_data_size; } - //////////////////////////////////////////////////////////////////// // Function: SceneGraphAnalyzer::get_num_vertices // Access: Published diff --git a/panda/src/pgraphnodes/sceneGraphAnalyzer.h b/panda/src/pgraphnodes/sceneGraphAnalyzer.h index 4477423ac1..0b1545c7c6 100644 --- a/panda/src/pgraphnodes/sceneGraphAnalyzer.h +++ b/panda/src/pgraphnodes/sceneGraphAnalyzer.h @@ -65,7 +65,7 @@ PUBLISHED: INLINE int get_num_geoms() const; INLINE int get_num_geom_vertex_datas() const; INLINE int get_num_geom_vertex_formats() const; - INLINE int get_vertex_data_size() const; + INLINE size_t get_vertex_data_size() const; INLINE int get_num_vertices() const; INLINE int get_num_normals() const; diff --git a/panda/src/pnmimage/convert_srgb.I b/panda/src/pnmimage/convert_srgb.I index 28ac8aad23..2354138cb9 100644 --- a/panda/src/pnmimage/convert_srgb.I +++ b/panda/src/pnmimage/convert_srgb.I @@ -66,7 +66,7 @@ encode_sRGB_float(unsigned char val) { // This seems like a very unlikely use case, so I didn't bother // making a look-up table for this. return (val == 0) ? 0 - : (1.055f * cpow((float)val * (1.f / 255.f), 0.41666f) - 0.055); + : (1.055f * cpow((float)val * (1.f / 255.f), 0.41666f) - 0.055f); } //////////////////////////////////////////////////////////////////// @@ -80,7 +80,7 @@ INLINE float encode_sRGB_float(float val) { return (val < 0.0031308f) ? (val * 12.92f) - : (1.055f * cpow(val, 0.41666f) - 0.055); + : (1.055f * cpow(val, 0.41666f) - 0.055f); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pnmimage/pnmImage.I b/panda/src/pnmimage/pnmImage.I index 0213df23aa..ea54ba0ffb 100644 --- a/panda/src/pnmimage/pnmImage.I +++ b/panda/src/pnmimage/pnmImage.I @@ -1386,7 +1386,7 @@ take_alpha_array() { //////////////////////////////////////////////////////////////////// INLINE void PNMImage:: allocate_array() { - _array = (xel *)PANDA_MALLOC_ARRAY(_x_size * _y_size * sizeof(xel)); + _array = (xel *)PANDA_MALLOC_ARRAY((size_t)_x_size * (size_t)_y_size * sizeof(xel)); } //////////////////////////////////////////////////////////////////// @@ -1397,7 +1397,7 @@ allocate_array() { //////////////////////////////////////////////////////////////////// INLINE void PNMImage:: allocate_alpha() { - _alpha = (xelval *)PANDA_MALLOC_ARRAY(_x_size * _y_size * sizeof(xelval)); + _alpha = (xelval *)PANDA_MALLOC_ARRAY((size_t)_x_size * (size_t)_y_size * sizeof(xelval)); } //////////////////////////////////////////////////////////////////// @@ -1491,7 +1491,7 @@ compute_spot_pixel(LColorf &c, float d2, } else if (d > min_radius) { d = (d - min_radius) / (max_radius - min_radius); float d2 = d * d; - float t = (3.0 * d2) - (2.0 * d * d2); + float t = (3.0f * d2) - (2.0f * d * d2); c = fg + t * (bg - fg); } else { c = fg; diff --git a/panda/src/pstatclient/pStatClient.I b/panda/src/pstatclient/pStatClient.I index 8af56aac2d..1c26ac4d3c 100644 --- a/panda/src/pstatclient/pStatClient.I +++ b/panda/src/pstatclient/pStatClient.I @@ -76,7 +76,7 @@ get_max_rate() const { INLINE int PStatClient:: get_num_collectors() const { ReMutexHolder holder(_lock); - return _num_collectors; + return (int)_num_collectors; } //////////////////////////////////////////////////////////////////// @@ -100,7 +100,7 @@ get_collector_def(int index) const { INLINE int PStatClient:: get_num_threads() const { ReMutexHolder holder(_lock); - return _num_threads; + return (int)_num_threads; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pstatclient/pStatFrameData.I b/panda/src/pstatclient/pStatFrameData.I index 086ce84810..9e680c6ff0 100644 --- a/panda/src/pstatclient/pStatFrameData.I +++ b/panda/src/pstatclient/pStatFrameData.I @@ -169,7 +169,7 @@ get_net_time() const { // Description: Returns the number of individual events stored in the // FrameData. //////////////////////////////////////////////////////////////////// -INLINE int PStatFrameData:: +INLINE size_t PStatFrameData:: get_num_events() const { return _time_data.size(); } @@ -181,8 +181,8 @@ get_num_events() const { // the nth event. //////////////////////////////////////////////////////////////////// INLINE int PStatFrameData:: -get_time_collector(int n) const { - nassertr(n >= 0 && n < (int)_time_data.size(), 0); +get_time_collector(size_t n) const { + nassertr(n < _time_data.size(), 0); return _time_data[n]._index & 0x7fff; } @@ -193,8 +193,8 @@ get_time_collector(int n) const { // event, or false if it represents a stop event. //////////////////////////////////////////////////////////////////// INLINE bool PStatFrameData:: -is_start(int n) const { - nassertr(n >= 0 && n < (int)_time_data.size(), 0); +is_start(size_t n) const { + nassertr(n < _time_data.size(), 0); return (_time_data[n]._index & 0x8000) == 0; } @@ -207,8 +207,8 @@ is_start(int n) const { // from a given client). //////////////////////////////////////////////////////////////////// INLINE double PStatFrameData:: -get_time(int n) const { - nassertr(n >= 0 && n < (int)_time_data.size(), 0); +get_time(size_t n) const { + nassertr(n < _time_data.size(), 0); return _time_data[n]._value; } @@ -218,7 +218,7 @@ get_time(int n) const { // Description: Returns the number of individual level values stored // in the FrameData. //////////////////////////////////////////////////////////////////// -INLINE int PStatFrameData:: +INLINE size_t PStatFrameData:: get_num_levels() const { return _level_data.size(); } @@ -230,8 +230,8 @@ get_num_levels() const { // the nth level value. //////////////////////////////////////////////////////////////////// INLINE int PStatFrameData:: -get_level_collector(int n) const { - nassertr(n >= 0 && n < (int)_level_data.size(), 0); +get_level_collector(size_t n) const { + nassertr(n < _level_data.size(), 0); return _level_data[n]._index; } @@ -241,8 +241,8 @@ get_level_collector(int n) const { // Description: Returns the height of the nth level value. //////////////////////////////////////////////////////////////////// INLINE double PStatFrameData:: -get_level(int n) const { - nassertr(n >= 0 && n < (int)_level_data.size(), 0); +get_level(size_t n) const { + nassertr(n < _level_data.size(), 0); return _level_data[n]._value; } @@ -255,4 +255,3 @@ INLINE bool PStatFrameData::DataPoint:: operator < (const PStatFrameData::DataPoint &other) const { return _value < other._value; } - diff --git a/panda/src/pstatclient/pStatFrameData.h b/panda/src/pstatclient/pStatFrameData.h index 14f854ce15..12a698354b 100644 --- a/panda/src/pstatclient/pStatFrameData.h +++ b/panda/src/pstatclient/pStatFrameData.h @@ -51,14 +51,14 @@ public: INLINE double get_end() const; INLINE double get_net_time() const; - INLINE int get_num_events() const; - INLINE int get_time_collector(int n) const; - INLINE bool is_start(int n) const; - INLINE double get_time(int n) const; + INLINE size_t get_num_events() const; + INLINE int get_time_collector(size_t n) const; + INLINE bool is_start(size_t n) const; + INLINE double get_time(size_t n) const; - INLINE int get_num_levels() const; - INLINE int get_level_collector(int n) const; - INLINE double get_level(int n) const; + INLINE size_t get_num_levels() const; + INLINE int get_level_collector(size_t n) const; + INLINE double get_level(size_t n) const; bool write_datagram(Datagram &destination, PStatClient *client) const; void read_datagram(DatagramIterator &source, PStatClientVersion *version); diff --git a/panda/src/putil/bitArray.I b/panda/src/putil/bitArray.I index 151277e6cf..cdf3adfd92 100644 --- a/panda/src/putil/bitArray.I +++ b/panda/src/putil/bitArray.I @@ -190,9 +190,9 @@ get_num_bits_per_word() { // This number may grow and/or shrink automatically as // needed. //////////////////////////////////////////////////////////////////// -INLINE int BitArray:: +INLINE size_t BitArray:: get_num_bits() const { - return get_num_words() * num_bits_per_word; + return get_num_words() * (size_t)num_bits_per_word; } //////////////////////////////////////////////////////////////////// @@ -359,7 +359,7 @@ set_range_to(bool value, int low_bit, int size) { // Description: Returns the number of possibly-unique words stored in // the array. //////////////////////////////////////////////////////////////////// -INLINE int BitArray:: +INLINE size_t BitArray:: get_num_words() const { return _array.size(); } @@ -372,7 +372,7 @@ get_num_words() const { // value beyond get_num_words() will always be the same. //////////////////////////////////////////////////////////////////// INLINE BitArray::MaskType BitArray:: -get_word(int n) const { +get_word(size_t n) const { nassertr(n >= 0, MaskType::all_off()); if (n < get_num_words()) { return _array[n]; @@ -392,8 +392,7 @@ get_word(int n) const { // array. //////////////////////////////////////////////////////////////////// INLINE void BitArray:: -set_word(int n, WordType value) { - nassertv(n >= 0); +set_word(size_t n, WordType value) { ensure_has_word(n); _array[n] = value; normalize(); diff --git a/panda/src/putil/bitArray.cxx b/panda/src/putil/bitArray.cxx index 9ce4474d7b..d7a5aace02 100644 --- a/panda/src/putil/bitArray.cxx +++ b/panda/src/putil/bitArray.cxx @@ -575,8 +575,8 @@ output_binary(ostream &out, int spaces_every) const { if (_highest_bits) { out << "...1 "; } - int num_bits = max(get_num_bits(), spaces_every); - for (int i = num_bits - 1; i >= 0; i--) { + size_t num_bits = max(get_num_bits(), (size_t)spaces_every); + for (size_t i = num_bits - 1; i >= 0; i--) { if (spaces_every != 0 && ((i % spaces_every) == spaces_every - 1)) { out << ' '; } @@ -944,11 +944,11 @@ ensure_has_word(int n) { copy_on_write(); if (_highest_bits) { - while (n >= (int)_array.size()) { + while ((size_t)n >= _array.size()) { _array.push_back(MaskType::all_on()); } } else { - while (n >= (int)_array.size()) { + while ((size_t)n >= _array.size()) { _array.push_back(MaskType::all_off()); } } diff --git a/panda/src/putil/bitArray.h b/panda/src/putil/bitArray.h index 9019f2a6f5..8bab5c0876 100644 --- a/panda/src/putil/bitArray.h +++ b/panda/src/putil/bitArray.h @@ -65,7 +65,7 @@ PUBLISHED: CONSTEXPR static int get_max_num_bits(); CONSTEXPR static int get_num_bits_per_word(); - INLINE int get_num_bits() const; + INLINE size_t get_num_bits() const; INLINE bool get_bit(int index) const; INLINE void set_bit(int index); INLINE void clear_bit(int index); @@ -90,9 +90,9 @@ PUBLISHED: int get_highest_off_bit() const; int get_next_higher_different_bit(int low_bit) const; - INLINE int get_num_words() const; - INLINE MaskType get_word(int n) const; - INLINE void set_word(int n, WordType value); + INLINE size_t get_num_words() const; + INLINE MaskType get_word(size_t n) const; + INLINE void set_word(size_t n, WordType value); void invert_in_place(); bool has_bits_in_common(const BitArray &other) const; diff --git a/panda/src/putil/buttonMap.I b/panda/src/putil/buttonMap.I index 9fd7f1af46..39b3a20dfb 100644 --- a/panda/src/putil/buttonMap.I +++ b/panda/src/putil/buttonMap.I @@ -19,7 +19,7 @@ // Description: Returns the number of buttons that this button // mapping specifies. //////////////////////////////////////////////////////////////////// -INLINE int ButtonMap:: +INLINE size_t ButtonMap:: get_num_buttons() const { return _buttons.size(); } @@ -31,7 +31,7 @@ get_num_buttons() const { // the nth button. //////////////////////////////////////////////////////////////////// INLINE ButtonHandle ButtonMap:: -get_raw_button(int i) const { +get_raw_button(size_t i) const { return _buttons[i]->_raw; } @@ -42,7 +42,7 @@ get_raw_button(int i) const { // that the nth raw button is mapped to. //////////////////////////////////////////////////////////////////// INLINE ButtonHandle ButtonMap:: -get_mapped_button(int i) const { +get_mapped_button(size_t i) const { return _buttons[i]->_mapped; } @@ -54,7 +54,7 @@ get_mapped_button(int i) const { // button is mapped to. //////////////////////////////////////////////////////////////////// INLINE const string &ButtonMap:: -get_mapped_button_label(int i) const { +get_mapped_button_label(size_t i) const { return _buttons[i]->_label; } diff --git a/panda/src/putil/buttonMap.h b/panda/src/putil/buttonMap.h index 4959a45265..8a2162a34e 100644 --- a/panda/src/putil/buttonMap.h +++ b/panda/src/putil/buttonMap.h @@ -32,10 +32,10 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_PUTIL ButtonMap : public TypedReferenceCount { PUBLISHED: - INLINE int get_num_buttons() const; - INLINE ButtonHandle get_raw_button(int i) const; - INLINE ButtonHandle get_mapped_button(int i) const; - INLINE const string &get_mapped_button_label(int i) const; + INLINE size_t get_num_buttons() const; + INLINE ButtonHandle get_raw_button(size_t i) const; + INLINE ButtonHandle get_mapped_button(size_t i) const; + INLINE const string &get_mapped_button_label(size_t i) const; INLINE ButtonHandle get_mapped_button(ButtonHandle raw) const; INLINE ButtonHandle get_mapped_button(const string &raw_name) const; diff --git a/panda/src/putil/cachedTypedWritableReferenceCount.I b/panda/src/putil/cachedTypedWritableReferenceCount.I index 4077046c6e..74db9efc9f 100644 --- a/panda/src/putil/cachedTypedWritableReferenceCount.I +++ b/panda/src/putil/cachedTypedWritableReferenceCount.I @@ -134,7 +134,7 @@ get_cache_ref_count() const { #ifdef _DEBUG test_ref_count_integrity(); #endif - return AtomicAdjust::get(_cache_ref_count); + return (int)AtomicAdjust::get(_cache_ref_count); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/putil/nodeCachedReferenceCount.I b/panda/src/putil/nodeCachedReferenceCount.I index 4861ff6c71..b4a373fca7 100644 --- a/panda/src/putil/nodeCachedReferenceCount.I +++ b/panda/src/putil/nodeCachedReferenceCount.I @@ -134,7 +134,7 @@ get_node_ref_count() const { #ifdef _DEBUG test_ref_count_integrity(); #endif - return AtomicAdjust::get(_node_ref_count); + return (int)AtomicAdjust::get(_node_ref_count); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/putil/pbitops.I b/panda/src/putil/pbitops.I index 5273eb8b13..3e3024df42 100644 --- a/panda/src/putil/pbitops.I +++ b/panda/src/putil/pbitops.I @@ -149,7 +149,7 @@ get_lowest_on_bit(PN_uint16 x) { unsigned long result; return (_BitScanForward(&result, (unsigned long) x) == 0) ? -1 : result; #elif defined(__GNUC__) - return __builtin_ffs((unsigned int) x) - 1; + return __builtin_ffs((int) x) - 1; #else if (x == 0) { return -1; @@ -171,7 +171,7 @@ get_lowest_on_bit(PN_uint32 x) { unsigned long result; return (_BitScanForward(&result, (unsigned long) x) == 0) ? -1 : result; #elif defined(__GNUC__) - return __builtin_ffs((unsigned int) x) - 1; + return __builtin_ffs((int) x) - 1; #else if (x == 0) { return -1; @@ -193,7 +193,7 @@ get_lowest_on_bit(PN_uint64 x) { unsigned long result; return (_BitScanForward64(&result, (unsigned __int64) x) == 0) ? -1 : result; #elif defined(__GNUC__) - return __builtin_ffsll((unsigned long long) x) - 1; + return __builtin_ffsll((long long) x) - 1; #else if (x == 0) { return -1; diff --git a/panda/src/putil/simpleHashMap.I b/panda/src/putil/simpleHashMap.I index d605d22235..2dac620091 100644 --- a/panda/src/putil/simpleHashMap.I +++ b/panda/src/putil/simpleHashMap.I @@ -248,7 +248,7 @@ operator [] (const Key &key) { // Description: Returns the total number of slots in the table. //////////////////////////////////////////////////////////////////// template -INLINE int SimpleHashMap:: +INLINE size_t SimpleHashMap:: get_size() const { return _table_size; } @@ -359,7 +359,7 @@ remove_element(int n) { // Now we have put a hole in the table. If there was a hash // conflict in the slot following this one, we have to move it down // to close the hole. - size_t i = n; + size_t i = (size_t)n; i = (i + 1) & (_table_size - 1); while (has_element(i)) { size_t wants_index = get_hash(_table[i]._key); @@ -397,7 +397,7 @@ remove_element(int n) { // get_num_entries(). //////////////////////////////////////////////////////////////////// template -INLINE int SimpleHashMap:: +INLINE size_t SimpleHashMap:: get_num_entries() const { return _num_entries; } diff --git a/panda/src/putil/simpleHashMap.h b/panda/src/putil/simpleHashMap.h index b9b690ffc7..816218251d 100644 --- a/panda/src/putil/simpleHashMap.h +++ b/panda/src/putil/simpleHashMap.h @@ -45,7 +45,7 @@ public: INLINE Value &operator [] (const Key &key); - INLINE int get_size() const; + INLINE size_t get_size() const; INLINE bool has_element(int n) const; INLINE const Key &get_key(int n) const; INLINE const Value &get_data(int n) const; @@ -53,7 +53,7 @@ public: INLINE void set_data(int n, const Value &data); void remove_element(int n); - INLINE int get_num_entries() const; + INLINE size_t get_num_entries() const; INLINE bool is_empty() const; void output(ostream &out) const; diff --git a/panda/src/putil/sparseArray.I b/panda/src/putil/sparseArray.I index ed72375e8c..e9fed81d17 100644 --- a/panda/src/putil/sparseArray.I +++ b/panda/src/putil/sparseArray.I @@ -514,7 +514,7 @@ is_inverse() const { // // Also see is_inverse(). //////////////////////////////////////////////////////////////////// -INLINE int SparseArray:: +INLINE size_t SparseArray:: get_num_subranges() const { return _subranges.size(); } @@ -528,8 +528,8 @@ get_num_subranges() const { // Also see is_inverse(). //////////////////////////////////////////////////////////////////// INLINE int SparseArray:: -get_subrange_begin(int n) const { - nassertr(n >= 0 && n < (int)_subranges.size(), 0); +get_subrange_begin(size_t n) const { + nassertr(n < _subranges.size(), 0); return _subranges[n]._begin; } @@ -542,8 +542,8 @@ get_subrange_begin(int n) const { // Also see is_inverse(). //////////////////////////////////////////////////////////////////// INLINE int SparseArray:: -get_subrange_end(int n) const { - nassertr(n >= 0 && n < (int)_subranges.size(), 0); +get_subrange_end(size_t n) const { + nassertr(n < _subranges.size(), 0); return _subranges[n]._end; } diff --git a/panda/src/putil/sparseArray.h b/panda/src/putil/sparseArray.h index b2d4bda0e9..60657904bc 100644 --- a/panda/src/putil/sparseArray.h +++ b/panda/src/putil/sparseArray.h @@ -123,9 +123,9 @@ PUBLISHED: INLINE void operator >>= (int shift); INLINE bool is_inverse() const; - INLINE int get_num_subranges() const; - INLINE int get_subrange_begin(int n) const; - INLINE int get_subrange_end(int n) const; + INLINE size_t get_num_subranges() const; + INLINE int get_subrange_begin(size_t n) const; + INLINE int get_subrange_end(size_t n) const; private: void do_add_range(int begin, int end); diff --git a/panda/src/putil/weakKeyHashMap.I b/panda/src/putil/weakKeyHashMap.I index 05f9f4266d..03987ef866 100644 --- a/panda/src/putil/weakKeyHashMap.I +++ b/panda/src/putil/weakKeyHashMap.I @@ -247,7 +247,7 @@ operator [] (const Key *key) { // Description: Returns the total number of slots in the table. //////////////////////////////////////////////////////////////////// template -INLINE int WeakKeyHashMap:: +INLINE size_t WeakKeyHashMap:: get_size() const { return _table_size; } @@ -377,7 +377,7 @@ remove_element(int n) { // Now we have put a hole in the table. If there was a hash // conflict in the slot following this one, we have to move it down // to close the hole. - size_t i = n; + size_t i = (size_t)n; i = (i + 1) & (_table_size - 1); while (get_exists_array()[i] != 0) { if (_table[i]._key.was_deleted()) { @@ -426,7 +426,7 @@ remove_element(int n) { // pointers that were recently deleted. //////////////////////////////////////////////////////////////////// template -INLINE int WeakKeyHashMap:: +INLINE size_t WeakKeyHashMap:: get_num_entries() const { return _num_entries; } diff --git a/panda/src/putil/weakKeyHashMap.h b/panda/src/putil/weakKeyHashMap.h index b84213567c..fec1400a56 100644 --- a/panda/src/putil/weakKeyHashMap.h +++ b/panda/src/putil/weakKeyHashMap.h @@ -48,7 +48,7 @@ public: INLINE Value &operator [] (const Key *key); - INLINE int get_size() const; + INLINE size_t get_size() const; INLINE bool has_element(int n) const; INLINE const Key *get_key(int n) const; INLINE const Value &get_data(int n) const; @@ -59,7 +59,7 @@ public: #endif void remove_element(int n); - INLINE int get_num_entries() const; + INLINE size_t get_num_entries() const; INLINE bool is_empty() const; void output(ostream &out) const; From 7738294657d41b9661dd5bf556eb94785748ff85 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 7 Oct 2015 19:10:52 +0200 Subject: [PATCH 201/203] Fix a few more type size issues --- .../interfaceMakerPythonNative.cxx | 22 +++++++++---------- dtool/src/prc/configDeclaration.cxx | 10 ++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 7f5859a233..3c74c066bb 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -3460,23 +3460,23 @@ write_function_for_name(ostream &out, Object *obj, if (map_sets.size() > 1) { switch (args_type) { case AT_keyword_args: - indent(out, 2) << "Py_ssize_t parameter_count = PyTuple_Size(args);\n"; + indent(out, 2) << "int parameter_count = (int)PyTuple_Size(args);\n"; indent(out, 2) << "if (kwds != NULL) {\n"; - indent(out, 2) << " parameter_count += PyDict_Size(kwds);\n"; + indent(out, 2) << " parameter_count += (int)PyDict_Size(kwds);\n"; indent(out, 2) << "}\n"; break; case AT_varargs: - indent(out, 2) << "Py_ssize_t parameter_count = PyTuple_Size(args);\n"; + indent(out, 2) << "int parameter_count = (int)PyTuple_Size(args);\n"; break; case AT_single_arg: // It shouldn't get here, but we'll handle these cases nonetheless. - indent(out, 2) << "const Py_ssize_t parameter_count = 1;\n"; + indent(out, 2) << "const int parameter_count = 1;\n"; break; default: - indent(out, 2) << "const Py_ssize_t parameter_count = 0;\n"; + indent(out, 2) << "const int parameter_count = 0;\n"; break; } @@ -3571,19 +3571,19 @@ write_function_for_name(ostream &out, Object *obj, switch (args_type) { case AT_keyword_args: out << " if (PyTuple_Size(args) > 0 || (kwds != NULL && PyDict_Size(kwds) > 0)) {\n"; - out << " Py_ssize_t parameter_count = PyTuple_Size(args);\n"; + out << " int parameter_count = (int)PyTuple_Size(args);\n"; out << " if (kwds != NULL) {\n"; - out << " parameter_count += PyDict_Size(kwds);\n"; + out << " parameter_count += (int)PyDict_Size(kwds);\n"; out << " }\n"; break; case AT_varargs: out << " if (PyTuple_Size(args) > 0) {\n"; - out << " const Py_ssize_t parameter_count = PyTuple_GET_SIZE(args);\n"; + out << " const int parameter_count = (int)PyTuple_GET_SIZE(args);\n"; break; case AT_single_arg: // Shouldn't happen, but let's handle this case nonetheless. out << " {\n"; - out << " const Py_ssize_t parameter_count = 1;\n"; + out << " const int parameter_count = 1;\n"; break; case AT_no_args: break; @@ -3603,9 +3603,9 @@ write_function_for_name(ostream &out, Object *obj, } else if (args_type == AT_keyword_args && max_required_args == 1 && mii->first == 1) { // Check this to be sure, as we handle the case of only 1 keyword arg // in write_function_forset (not using ParseTupleAndKeywords). - out << " Py_ssize_t parameter_count = PyTuple_Size(args);\n" + out << " int parameter_count = (int)PyTuple_Size(args);\n" " if (kwds != NULL) {\n" - " parameter_count += PyDict_Size(kwds);\n" + " parameter_count += (int)PyDict_Size(kwds);\n" " }\n" " if (parameter_count != 1) {\n" "#ifdef NDEBUG\n"; diff --git a/dtool/src/prc/configDeclaration.cxx b/dtool/src/prc/configDeclaration.cxx index c2661e0035..f299e63d54 100644 --- a/dtool/src/prc/configDeclaration.cxx +++ b/dtool/src/prc/configDeclaration.cxx @@ -63,7 +63,7 @@ set_string_word(size_t n, const string &value) { get_words(); } - while (n >= (int)_words.size()) { + while (n >= _words.size()) { Word w; w._flags = 0; _words.push_back(w); @@ -207,7 +207,7 @@ check_bool_word(size_t n) { get_words(); } - if (n >= 0 && n < (int)_words.size()) { + if (n < _words.size()) { Word &word = _words[n]; if ((word._flags & F_checked_bool) == 0) { word._flags |= F_checked_bool; @@ -254,7 +254,7 @@ check_int_word(size_t n) { get_words(); } - if (n >= 0 && n < (int)_words.size()) { + if (n < _words.size()) { Word &word = _words[n]; if ((word._flags & F_checked_int) == 0) { word._flags |= F_checked_int; @@ -314,7 +314,7 @@ check_int64_word(size_t n) { get_words(); } - if (n >= 0 && n < (int)_words.size()) { + if (n < _words.size()) { Word &word = _words[n]; if ((word._flags & F_checked_int64) == 0) { word._flags |= F_checked_int64; @@ -372,7 +372,7 @@ check_double_word(size_t n) { get_words(); } - if (n >= 0 && n < (int)_words.size()) { + if (n < _words.size()) { Word &word = _words[n]; if ((word._flags & F_checked_double) == 0) { word._flags |= F_checked_double; From a5f340c5870bd6126c44214760c9e95c274a705d Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 7 Oct 2015 19:29:39 +0200 Subject: [PATCH 202/203] Fix errors in OpenGL renderer due to type size mismatches --- panda/src/glstuff/glShaderContext_src.cxx | 8 ++++---- panda/src/gobj/geomPrimitive.cxx | 2 +- panda/src/gobj/geomVertexArrayFormat.I | 10 +++++----- panda/src/gobj/geomVertexArrayFormat.h | 4 ++-- panda/src/gobj/geomVertexData.cxx | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 8cfd20119f..6cac37cf82 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1852,9 +1852,9 @@ void CLP(ShaderContext):: update_transform_table(const TransformTable *table) { LMatrix4f *matrices = (LMatrix4f *)alloca(_transform_table_size * 64); - int i = 0; + size_t i = 0; if (table != NULL) { - int num_transforms = min(_transform_table_size, table->get_num_transforms()); + size_t num_transforms = min((size_t)_transform_table_size, table->get_num_transforms()); for (; i < num_transforms; ++i) { #ifdef STDFLOAT_DOUBLE LMatrix4 matrix; @@ -1885,8 +1885,8 @@ update_slider_table(const SliderTable *table) { memset(sliders, 0, _slider_table_size * 4); if (table != NULL) { - int num_sliders = min(_slider_table_size, table->get_num_sliders()); - for (int i = 0; i < num_sliders; ++i) { + size_t num_sliders = min((size_t)_slider_table_size, table->get_num_sliders()); + for (size_t i = 0; i < num_sliders; ++i) { sliders[i] = table->get_slider(i)->get_slider(); } } diff --git a/panda/src/gobj/geomPrimitive.cxx b/panda/src/gobj/geomPrimitive.cxx index 02abb0c407..797ea9e1c8 100644 --- a/panda/src/gobj/geomPrimitive.cxx +++ b/panda/src/gobj/geomPrimitive.cxx @@ -1304,7 +1304,7 @@ set_vertices(const GeomVertexArrayData *vertices, int num_vertices) { // Validate the format and make sure to copy its numeric type. const GeomVertexArrayFormat *format = vertices->get_array_format(); nassertv(format->get_num_columns() == 1); - cdata->_index_type = format->get_column((size_t)0)->get_numeric_type(); + cdata->_index_type = format->get_column(0)->get_numeric_type(); cdata->_modified = Geom::get_next_modified(); cdata->_got_minmax = false; diff --git a/panda/src/gobj/geomVertexArrayFormat.I b/panda/src/gobj/geomVertexArrayFormat.I index 2ded24872c..10a5adf674 100644 --- a/panda/src/gobj/geomVertexArrayFormat.I +++ b/panda/src/gobj/geomVertexArrayFormat.I @@ -151,9 +151,9 @@ get_total_bytes() const { // Description: Returns the number of different columns in the // array. //////////////////////////////////////////////////////////////////// -INLINE size_t GeomVertexArrayFormat:: +INLINE int GeomVertexArrayFormat:: get_num_columns() const { - return _columns.size(); + return (int)_columns.size(); } //////////////////////////////////////////////////////////////////// @@ -162,10 +162,10 @@ get_num_columns() const { // Description: Returns the ith column of the array. //////////////////////////////////////////////////////////////////// INLINE const GeomVertexColumn *GeomVertexArrayFormat:: -get_column(size_t i) const { - nassertr(i < _columns.size(), NULL); +get_column(int i) const { + nassertr(i >= 0 && i < (int)_columns.size(), NULL); consider_sort_columns(); - return _columns[i]; + return _columns[(size_t)i]; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/gobj/geomVertexArrayFormat.h b/panda/src/gobj/geomVertexArrayFormat.h index f764b3c3c8..9e150d596b 100644 --- a/panda/src/gobj/geomVertexArrayFormat.h +++ b/panda/src/gobj/geomVertexArrayFormat.h @@ -102,8 +102,8 @@ PUBLISHED: void pack_columns(); void align_columns_for_animation(); - INLINE size_t get_num_columns() const; - INLINE const GeomVertexColumn *get_column(size_t i) const; + INLINE int get_num_columns() const; + INLINE const GeomVertexColumn *get_column(int i) const; MAKE_SEQ(get_columns, get_num_columns, get_column); const GeomVertexColumn *get_column(const InternalName *name) const; diff --git a/panda/src/gobj/geomVertexData.cxx b/panda/src/gobj/geomVertexData.cxx index 80aa43dbf4..d2202e1831 100644 --- a/panda/src/gobj/geomVertexData.cxx +++ b/panda/src/gobj/geomVertexData.cxx @@ -1675,7 +1675,7 @@ update_animated_vertices(GeomVertexData::CData *cdata, Thread *current_thread) { CPT(GeomVertexArrayFormat) blend_array_format = orig_format->get_array(blend_array_index); if (blend_array_format->get_stride() == 2 && - blend_array_format->get_column((size_t)0)->get_component_bytes() == 2) { + blend_array_format->get_column(0)->get_component_bytes() == 2) { // The blend indices are a table of ushorts. Optimize this // common case. CPT(GeomVertexArrayDataHandle) blend_array_handle = cdata->_arrays[blend_array_index].get_read_pointer()->get_handle(current_thread); From 7f7f85794dbd94398ebdeace92187d0db881ee6a Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 7 Oct 2015 21:09:35 +0200 Subject: [PATCH 203/203] Fix various compilation and linker issues across several platforms --- direct/src/dcparser/dcPython.h | 4 +++- makepanda/makepanda.py | 2 ++ panda/src/pgraph/renderState.cxx | 8 ++++---- panda/src/pgraph/transformState.cxx | 6 +++--- panda/src/putil/bitArray.cxx | 4 ++-- panda/src/putil/paramValue.h | 4 ++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/direct/src/dcparser/dcPython.h b/direct/src/dcparser/dcPython.h index d5a50baa2f..f04aa11e6b 100644 --- a/direct/src/dcparser/dcPython.h +++ b/direct/src/dcparser/dcPython.h @@ -20,8 +20,10 @@ #ifdef HAVE_PYTHON -#undef HAVE_LONG_LONG // NSPR and Python both define this. +#define PY_SSIZE_T_CLEAN 1 + #undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE #include // Python 2.5 adds Py_ssize_t; earlier versions don't have it. diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index ad9f40792c..07bdd7e538 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1653,6 +1653,8 @@ def CompileLink(dll, obj, opts): else: cmd += " -pthread" + cmd += " -Wl,-allow-multiple-definition" + if LDFLAGS != "": cmd += " " + LDFLAGS diff --git a/panda/src/pgraph/renderState.cxx b/panda/src/pgraph/renderState.cxx index a3f4c6c9a7..fd385668df 100644 --- a/panda/src/pgraph/renderState.cxx +++ b/panda/src/pgraph/renderState.cxx @@ -985,7 +985,7 @@ clear_cache() { RenderState *state = (RenderState *)(*ti).p(); int i; - int cache_size = state->_composition_cache.get_size(); + int cache_size = (int)state->_composition_cache.get_size(); for (i = 0; i < cache_size; ++i) { if (state->_composition_cache.has_element(i)) { const RenderState *result = state->_composition_cache.get_data(i)._result; @@ -995,10 +995,10 @@ clear_cache() { } } } - _cache_stats.add_total_size(-state->_composition_cache.get_num_entries()); + _cache_stats.add_total_size(-(int)state->_composition_cache.get_num_entries()); state->_composition_cache.clear(); - cache_size = state->_invert_composition_cache.get_size(); + cache_size = (int)state->_invert_composition_cache.get_size(); for (i = 0; i < cache_size; ++i) { if (state->_invert_composition_cache.has_element(i)) { const RenderState *result = state->_invert_composition_cache.get_data(i)._result; @@ -1008,7 +1008,7 @@ clear_cache() { } } } - _cache_stats.add_total_size(-state->_invert_composition_cache.get_num_entries()); + _cache_stats.add_total_size(-(int)state->_invert_composition_cache.get_num_entries()); state->_invert_composition_cache.clear(); } diff --git a/panda/src/pgraph/transformState.cxx b/panda/src/pgraph/transformState.cxx index bffa840479..7daf7c0a40 100644 --- a/panda/src/pgraph/transformState.cxx +++ b/panda/src/pgraph/transformState.cxx @@ -1174,7 +1174,7 @@ clear_cache() { TransformState *state = (TransformState *)(*ti).p(); int i; - int cache_size = state->_composition_cache.get_size(); + int cache_size = (int)state->_composition_cache.get_size(); for (i = 0; i < cache_size; ++i) { if (state->_composition_cache.has_element(i)) { const TransformState *result = state->_composition_cache.get_data(i)._result; @@ -1184,7 +1184,7 @@ clear_cache() { } } } - _cache_stats.add_total_size(-state->_composition_cache.get_num_entries()); + _cache_stats.add_total_size(-(int)state->_composition_cache.get_num_entries()); state->_composition_cache.clear(); cache_size = state->_invert_composition_cache.get_size(); @@ -1197,7 +1197,7 @@ clear_cache() { } } } - _cache_stats.add_total_size(-state->_invert_composition_cache.get_num_entries()); + _cache_stats.add_total_size(-(int)state->_invert_composition_cache.get_num_entries()); state->_invert_composition_cache.clear(); } diff --git a/panda/src/putil/bitArray.cxx b/panda/src/putil/bitArray.cxx index d7a5aace02..99e7d7d653 100644 --- a/panda/src/putil/bitArray.cxx +++ b/panda/src/putil/bitArray.cxx @@ -575,8 +575,8 @@ output_binary(ostream &out, int spaces_every) const { if (_highest_bits) { out << "...1 "; } - size_t num_bits = max(get_num_bits(), (size_t)spaces_every); - for (size_t i = num_bits - 1; i >= 0; i--) { + int num_bits = max((int)get_num_bits(), spaces_every); + for (int i = num_bits - 1; i >= 0; i--) { if (spaces_every != 0 && ((i % spaces_every) == spaces_every - 1)) { out << ' '; } diff --git a/panda/src/putil/paramValue.h b/panda/src/putil/paramValue.h index 694c34529d..e1a4ca9cf0 100644 --- a/panda/src/putil/paramValue.h +++ b/panda/src/putil/paramValue.h @@ -153,6 +153,8 @@ private: static TypeHandle _type_handle; }; +#include "paramValue.I" + EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ParamValue); EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ParamValue); @@ -211,8 +213,6 @@ typedef ParamMatrix3f ParamMatrix3; typedef ParamMatrix4f ParamMatrix4; #endif -#include "paramValue.I" - // Tell GCC that we'll take care of the instantiation explicitly here. #ifdef __GNUC__ #pragma interface